Let Susan's original amount be S RM, Adam is given S/3 RM, so altogether he has S/3+40 RM, and he gives ⅛ of this to Gopal so he has ⅞ of it left, that is:
(7/8)(S/3+40)=350, so (1/8)(S/3+40)=50, S/24+5=50, S/24=45, so S=24×45=RM1080. Susan initially has RM1080.
(She gives 1080/3=RM360 to Adam, so he has RM400 altogether, and he gives away 400/8=RM50 leaving him with 400-50=RM350.)