Cryptocaesar P75810


Statement
 

pdf   zip

html

Decrypt the secret messages of the Roman centurions is very easy, specially if the addressee of them is the Caesar. A message is a sequence of uppercase letters. Each centurion encrypts his messages using his secret key k (a number between 1 to 25) of the following way: each letter of the message is substituted by the letter that is k positions on the right in the English alphabet. We understand that the letter next to ’Z’ is the ’A’.

As member of the IRRO (Iberian Resistance against Roman Occupation) your task is to decrypt the messages stole to the Romanmessengers while they were eating tapas. We know little about intercepted messages: the only thing that we know is that, for imperial order, all the centurions must end their messages with a AVECAESAR.

Input

The first line contains the number n of captured messages. Each one of the n following lines contains a encrypted message. The messages contain exclusively between 9 and 1000 uppercase letters, and end with a dot. It is known that n < 10000.

Output

Your program must print exactly n lines. Each one of the lines must contain the corresponding decrypted message. It must not to print the dots.

Public test cases
  • Input

    5
    GBKIGKYGX.
    DMVQDQLQDQKQIDMKIMAIZ.
    HJMDOPMDOZNVGPOVIOVQZXVZNVM.
    YZABCDEFGHIJKLMNOPQRSTUVWXYTCAYCQYP.
    NKLKVOKBBYJKVKJYBBKOVKLKNKFOMKOCKB.
    

    Output

    AVECAESAR
    VENIVIDIVICIAVECAESAR
    MORITURITESALUTANTAVECAESAR
    ABCDEFGHIJKLMNOPQRSTUVWXYZAVECAESAR
    DABALEARROZALAZORRAELABADAVECAESAR
    
  • Input

    0
    

    Output

    
            
                                
  • Information
    Author
    Omer Giménez
    Language
    English
    Translator
    Carlos Molina
    Original language
    Spanish
    Other languages
    Spanish
    Official solutions
    C++
    User solutions
    C++