13601 - Ultimate caesar salad
|
Time |
Memory |
Case 1 |
1 sec |
32 MB |
Case 2 |
1 sec |
32 MB |
Case 3 |
1 sec |
32 MB |
Case 4 |
1 sec |
32 MB |
Case 5 |
1 sec |
32 MB |
Case 6 |
1 sec |
32 MB |
Case 7 |
1 sec |
32 MB |
Case 8 |
1 sec |
32 MB |
Case 9 |
1 sec |
32 MB |
Case 10 |
1 sec |
32 MB |
Description
Sometimes, the hackers would intercept the messages sent by Caesar. Since privacy is quite valued by Caesar, he discovers a new way of encryption.
The encryption process includes two steps:
- First, we would apply a specific number of right shifts (within [0, 25]) for each letter in the string. For instance, if we have a message "AAAAA", and we want to apply {1, 2, 3, 4, 5} of right shifts for each letter, then the encrypted message would be "BCDEF". We can regard the letter following Z as A again. For example, if we apply 3 right shifts on Y, it would be B.
- Second, we change every letter from uppercase to lowercase and lowercase to uppercase. For instance, if we have a shifted message "aBcDe", the final encrypted message would be "AbCdE". (It does not help for the encryption. Caesar does it for fun.)
Given a pair of plaintext and encrypted message, we can derive the encryption scheme, that is, how many right shifts are applied to each letter of the string. Caesar can't wait to have more salads! To order more salads, please help him to encrypt another given message by applying the encryption scheme.
Sample I/O's number of shifts: {1, 24, 5, 3, 21}.
Input
The input has three lines: Plaintext A, encrypted message A' of A, and another plaintext B to be encrypted. These strings contain only uppercase and lowercase letters (A-Z, a-z), and their length is all exactly 5.
Output
Print one line, the encrypted message B' of B.
Please remember to print '\n' at the end.
Tags