program to reverse line of input