Three years ago Juma was three times as old as Ali. In two years time the sum of their ages will be 62. Determine their present ages.