Let the amount of Alice's original money = A
Let the amount of Bob's original money = B
So
(A + n )* 7 = (B - n) → 7A - 2B = -5n (1)
(A - n) = 3 * ( B + n) → A - 3B = 4n (2)
Multiply the first equation by 3 and the second equation by 4 and add them together
3A - 9B = -12n
4A - 8B = 12n
7A - 17B = 0 add 17B to both sides
7A = 17B divide both sides by 7, B
A / B = 17/7