'''Illustrating that giving ordering operators meaning
allows sort to work.'''
from rational import Rational
line = input('Enter rational numbers on one line:\n')
rList = [Rational(v) for v in line.split()]
rList.sort()
print('Now sorted list, as printed directly by Python:')
print(rList)
print('Now as a line of common math expressions:')
print(' '.join([str(v) for v in rList]))