시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB23418016380.693%

문제

A Caesar cipher is a way of encrypting text. Each letter in the text is replaced by the letter s places after it in the alphabet. S is called the shift – with a shift of 5, for example, 'A' becomes 'F', 'H' becomes 'M' and 'Y' becomes 'D '(the alphabet wraps round so 'A' follows 'Z'). The text is easy to decrypt if you know the value of s.

Cedric has come up with a variation on this. Instead of telling his friends what the shift is, he encrypts the letter 'A' (always producing an upper case letter) and places it at the end of his message. In that way, they can work out what the shift is and thus decrypt the text.

입력

Input will consist of a number of lines of text, terminated by a line consisting of only #. Each line will consist of up to 255 characters of encrypted text (including the encrypted 'A').

출력

Output will be one line for each line of input containing the decrypted text. The final letter 'A' should NOT be included. Punctuation, spaces, digits and any other non-letter characters are output unchanged.

예제 입력 1

N hfs wjfi ymnx xjsyjshj, xt rd fqltwnymr btwpx.F
Serq Unzvygba-Wbarf vf 85 gbqnl! Unccl oveguqnl, Serq.N
Ocz lpdxf, wmjri ajs ephkzy jqzm ocz gvut yjbn.V
#

예제 출력 1

I can read this sentence, so my algorithm works.
Fred Hamilton-Jones is 85 today! Happy birthday, Fred.
The quick, brown fox jumped over the lazy dogs.