Hey Adrian, a quint just means 5. So typically a quint in pokemon refers to a mon with 5 perfect 31 stats.
In your case it looks like the M is the weaker of the two. So just keep breeding until you can replace the M with something with more 31s each time. Eventually both of your parents will have close to 5 stats, with the particular stat you are looking for covered. Optimal parents will have overlapping stats in the spec you are looking for.