Tom and peter are friends and each has some money.If Tom gives Rs 30 to Peter,then Peter will have twice the money left with Tom.But if Peter gives Rs 10 to Tom then Tom will have thrice as much as is left with Peter.How much money does each have?

Ans Tom has Rs 62 and Peter has 34 or vice versa