It doesn't matter which one holds the knot, it still picks 5 stats from either parent randomly to inherit. In your case, you have 2 Jolly's, so you can pass it from the F, as it has better stats, and then put knot on the male.
Another thing to consider is instead of maintaining the jolly throughout, you can speed up IV passing by using a power item, which insures passing of that particular stat (hp/atk/speed/etc.). However, then you have to lose the nature passing. So either way is a gamble. Some people prefer to keep nature all the way, or some just go for IVs and then breed for nature later on. It's whatever works for you!
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.