main program reads from input and prints to output