This page is still under construction.

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

Virus

Interview

Time limit2sMemory limit512 MB

Summary
Given a key and one line of ciphertext, undo a Caesar variant whose shift grows by one per letter and resets after 25.
Level

Easy2 of 10

Topics
String, Simulation, Implementation
Solved
No attempts yet

Problem

Shroeder and Patsy heard about a friend whose computer was hit by a ransom virus. A message on his screen said that every file had been encrypted and that getting the files back would cost money.

Both of them like programming, so they wondered how that works and wrote a simple cipher of their own, just for fun. Its key is a single number.

The method is a variant of the Caesar cipher. The alphabet is circular, so a follows z. Start with a shift between 1 and 25, which is the key, and increase the shift by one for every letter. Once the shift passes 25 it becomes 1 again.

Only lowercase letters are shifted. Spaces, digits and punctuation marks are copied unchanged and do not advance the shift.

Decrypting is easy once you know the key, as long as you shift in the opposite direction. Given the key and one line of ciphertext, print the original text.

Input

The first line contains the key KK (1≤K≤251 \le K \le 25).

The second line contains the encrypted text. It is at most 250 characters long and consists of lowercase letters, spaces, digits and punctuation marks only.

Output

Print the decrypted line of text.

Examples4

  1. Example 1

    Input
    24
    ym fpfvdvaqxx adbpaud xhl odb ldx bheqgul ybzseobczfz wjjqcru.
    
    Expected output
    an encryption problem for the new zealand programming contest.
    
  2. Example 2

    Input
    1
    igopt cvzun
    
    Expected output
    hello world
    
  3. Example 3

    Input
    25
    sig tynir jayhz scm zleim jrbp sig oeee kwp
    
    Expected output
    the quick brown fox jumps over the lazy dog
    
  4. Example 4

    Input
    13
    1234567890 !?,.;:'"()[]{}-+=/*&%$#@ 42
    
    Expected output
    1234567890 !?,.;:'"()[]{}-+=/*&%$#@ 42