OK, Kaman, let's work backward.
If M gives back the 12 cards to H, then H has 52 and M has 80.
M had given 1/6 of her cards to H, so the 5/6 she had left was 80, meaning 1/6 was 80/5= 16 and she had 96 cards before giving H those 16 cards.
Before getting those 16 cards, H had 36, which was 3/4 of what she started with. Since 3/4 is 36, 1/4 is 12 and she started with 36 + 12 = 48 cards.
Take those 12 cards away from M and she started with 84 cards.
Let's check...
1/4 of 48 is 12, so H gives M 12 cards and M now has 96. H is left with 36.
1/6 of 96 is 16, so M gives H 16 cards and has 80 left. H now has 52.
H gives M 12 cards and has 40 left and M has 92.
Check!