文理学院程序设计在线练习


Mirror, Mirror

Time Limit: 1 Second(s)    Memory Limit: 32 MB

Total Submission(s): 213   Accepted Submission(s): 157
Problem Description

Walking towards his parked car, John was amused to note what appeared to be a string of gibberish painted along the front of an emergency vehicle parked behind him: ECNALUBMA. I was only after he climbed into his own car and glanced into his rear-view mirror that the string suddenly made sense: AMBULANCE.

John belatedly realized that even the individual letters had been reversed, but that he had mentally corrected these without even being aware of doing so. It was the rearrangement of the letters into an appropriate word that had stymied him.

Fascinated with this idea, John would now like to practice his mirror-reading skills. Write a program that accepts input phrases and prints them, reversing the order of the characters.

Input

Input consists of one or more lines, each containing from 1 to 80 printable ASCII characters (alphabetics,numerals,blanks, and punctuation).

End of input is signaled bya line containing only the string“***”.

Output

For each line of input data, your program should print a single line of output containing the same characters asthe inputline, in reverse order.

Sample Input
AMBULANCE
Evian
madam, i’m adam
***
Sample Output
ECNALUBMA
naivE
mada m’i ,madam
Source

Mid-Atlantic 2006, Practice