2. A line of text is read from the input terminal into a stack. Write an program to output the string in the reverse order, each character appearing twice.

(e.g., the string aJb c d e should be changed to ee dd cc bb aa)