#C11137. Decrypt Message

    ID: 40420 Type: Default 1000ms 256MiB

Decrypt Message

Decrypt Message

You are given an integer \( k \) and an encrypted message consisting of letters, spaces, punctuation, and digits. The encryption process shifts every alphabetical character \( k \) positions forward in the alphabet (with wrap-around). Your task is to reverse this process: decrypt the message by shifting each alphabetical character \( k \) positions back.

Specifically, for each character in the message:

  • If it is an uppercase letter (AZ), shift it back by \( k \) positions. The result should still be an uppercase letter.
  • If it is a lowercase letter (az), shift it back by \( k \) positions. The result should still be a lowercase letter.
  • All other characters (digits, punctuation, spaces, etc.) remain unchanged.

For example, if \( k = 3 \) and the encrypted message is "khoor zruog", the decrypted message should be "hello world".

inputFormat

The input is given via standard input (stdin) and consists of two lines:

  1. The first line contains one integer \( k \) (the number of positions each letter was shifted).
  2. The second line contains the encrypted message as a string. The string may include spaces and punctuation.

outputFormat

Output the decrypted message as a single line to standard output (stdout).

## sample
3
khoor zruog
hello world