joj1064

来源:互联网 发布:淘宝品牌信息怎么写 编辑:程序博客网 时间:2024/05/21 11:27

1064: Caeser Comes Back


ResultTIME LimitMEMORY LimitRun TimesAC TimesJUDGE3s8192K1540821Standard

Assume you are a spy who is fulfilling a very important task. You have just stole a very important file from enemy's computer. Now you have to send the file to your headquarter by a special equipment. But in order to make safety, you should encode the file before sending it. Because the soldiers of enemy may come at any time, the encode process shouldn't take too much time. Under such situation, the only encode algorithm you could do is Caeser Encode Algorithm.

The Caeser algorithm can be expressed as:

In the encode process, a character is replaced by the 3rd one after it. Here you can assume that the file consists of only 'a' to 'z' and 'A' to 'Z'. So the last 3 characters are replaced by the first 3 characters. For example, consider this string abcdABCDwxyzWXYZ. After the encode process, it becomes defgDEFGzabcZABC. While in the decode process, this algorithm applies reversely.

Input Specification

The input consists of several lines. Each line consists of two strings A and B(at most 80 characters), separated by a space. If A equals to ENCODE, you should encode B while if A equals to DECODE, you should decode B. If A equals to END, that means the end of input, which you shouldn't process. No other values will A equal to except ENCODE, DECODE and END.

Output Specification

For each A=ENCODE or DECODE, you should encode or decode B and output the result on a single line each.

Sample Input

ENCODE abcdENCODE WXYZDECODE zAbCENCODE aAEND

Sample Output

defgZABCwXyZdD

Problem Source: 1st JOJ Cup Online VContest Warmup Problem


This problem is used for contest: 75 


Submit / Problem List / Status / Discuss


原创粉丝点击