The digital root of a number is defined next way: we take the sum of digits of , then the sum of digits of obtained number and so on until we get one digit number.
You must sort the elements of array in increasing order of their digital roots. If the digital roots are equal, put first the less number.
One line contains the array elements. The length of array is no more than , each number is positive and does not exceed .
Print the elements of array sorted in increasing order of their digital roots.