1/3 of Milo's money was 4/5 of Alan's money. If Milo gave $18 to Alan and he returned $4 to him a few days later, then both of them would have an equal amount of money left. How much did Milo have at first?

1/3 m = 4/5 a

so a = 5/12 m

m-18+4 = a+18-4
so m-14 = a+14

m-14 = 5/12 m + 14
7/12 m = 28
m = 48