A and B have certain number of mangoes. A says to B, " If you give me 10 of your mangoes, I will have twice as many as left with you." B replies, "If you give me 10 of your mangoes, I will have thrice the number of mangoes left with you. Find the original number of mangoes each had.