This page is still under construction.

Parts of this page are still being built. What you see may change.

Veni, vidi, vici

Interview

Time limit1sMemory limit256 MB

Summary
Drop the last letter of each odd-length ciphertext, then decode every letter pair into one plain letter with the given key.
Level

Easy2 of 10

Topics
String, Math
Solved
No attempts yet

Problem

Woncheol learned the Caesar cipher in a cryptography class. The Caesar cipher is a well known substitution cipher, and its rules are these.

  1. Treat a as 0, b as 1, and in the same way z as 25.
  2. Encrypting the number xx with a key nn gives y≡(x+n) mod 26y \equiv (x+n) \bmod 26. For example, when n=1n = 1, a becomes b, b becomes c, and z becomes a.
  3. Decrypting the encrypted number yy gives x≡(y−n) mod 26x \equiv (y-n) \bmod 26.

Woncheol also learned the weakness of this cipher. Counting how often each letter appears breaks it quickly. He decided that turning one letter into two letters avoids that weakness. A letter "x" is replaced by two letters "yz" that satisfy x≡(y+z−n) mod 26x \equiv (y+z-n) \bmod 26, and Woncheol calls this the Woncheol cipher. To encrypt a word he replaces its letters one at a time from the front and joins the results in order.

A word encrypted this way always has even length, which reveals that the Woncheol cipher was used. So Woncheol may append one dummy letter of his choice to the end of an encrypted word. A ciphertext of odd length therefore ends with a dummy letter, and a ciphertext of even length has no dummy letter.

Decrypt what Woncheol said in the Woncheol cipher.

Input

The first line contains an integer nn (0≤n<260 \le n < 26), the key used for encryption.

The second line contains at most 100 words separated by one space each. Every word is 2 to 101 characters long and consists only of the lowercase English letters 'a' to 'z'. All of these words are ciphertexts of the Woncheol cipher.

Output

Decrypt each word in the order given in the input and print the results on one line, separated by one space each.

Examples4

  1. Example 1

    Input
    2
    axcexseg yzkansuqe mlssltqu
    
    Expected output
    veni vidi vici
    
  2. Example 2

    Input
    0
    aa ab ba zz
    
    Expected output
    a b b y
    
  3. Example 3

    Input
    25
    aaz zaz azb
    
    Expected output
    b a a
    
  4. Example 4

    Input
    13
    nm
    
    Expected output
    m