Don't lose your marbles.
Let X = the number of marbles that Juan or Rachel started with.
Rachel gives away 10 marbles--> X - 10 and Juan gives away 22--> X - 22
Than Rachel has 3 times as many marbles as Juan--> X-10 = 3(X-22)
X - 10 = 3X - 66
-56 =- 2X
X = 28
Plug this back into the problem to make sure it works.