joj1064

1064: Caeser Comes Back


ResultTIME LimitMEMORY LimitRun TimesAC TimesJUDGE
3s8192K1540821Standard

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 abcd
ENCODE WXYZ
DECODE zAbC
ENCODE aA
END

Sample Output

defg
ZABC
wXyZ
dD

Problem Source: 1st JOJ Cup Online VContest Warmup Problem


This problem is used for contest: 75 


Submit / Problem List / Status / Discuss


评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值