#C10253. Shift String

    ID: 39438 Type: Default 1000ms 256MiB

Shift String

Shift String

You are given a string s and an integer k. Your task is to shift each alphabetic character in the string by k positions in the English alphabet. The shifting should wrap around if it goes past 'z' or 'Z'. Non-alphabet characters should remain unchanged.

For example, shifting a by 2 yields c and shifting z by 3 yields c. The case of each letter must be preserved.

Your program should read the input from standard input (stdin) and write the result to standard output (stdout).

inputFormat

The input consists of two lines:

  1. The first line contains the string s.
  2. The second line contains an integer k, representing the number of positions to shift each letter.

outputFormat

Output a single line with the resulting shifted string.

## sample
abc
2
cde