#t184. 加密的病历单
加密的病历单
Decrypting the Medical Record
Problem Description
Xiaoying is a third-year pharmacy student who got an internship at a hospital pharmacy during the summer.
During the internship, her solid professional foundation won praise from the doctors. Learning that Xiaoying had done well in "Introduction to Computing", the director gave her an extra task: to decrypt a list of wounded soldiers encrypted during the War of Resistance.
After research, Xiaoying found the following encryption rules (the bracket shows an "original → ciphertext" example):
- Every character in the original text is cyclically shifted left by three positions in the alphabet (
dec→abz). - The characters are stored in reverse order (
abcd→dcba). - The case of every letter is inverted (
abXY→ABxy).
Given an encrypted string, output the decrypted (original) string. To decrypt, reverse the three steps in opposite order: first invert the case, then reverse the string, then cyclically shift each letter right by three positions (a ← d).
Input Format
One encrypted string (length less than , containing only uppercase and lowercase letters).
Output Format
Output the decrypted string.
Sample Input
GSOOWFASOq
Sample Output
Trvdizrrvj