Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat problems/string-sezar-shifri

Caesar cipher

Easy 1000 ms 128 MB 27%
Share

A string $s$ of lowercase Latin letters and an integer $k$ are given. In the Caesar cipher every letter is shifted $k$ positions to the right in the alphabet; after the end of the alphabet it wraps around to the beginning (a follows z). Print the encrypted string.

Shifting letters along the alphabet by a given number of steps

Input

The first line contains the string $s$, the second line $k$.

Output

The encrypted string on one line.

Note

$1 \le |s| \le 10^{5}$
$s$ consists of lowercase Latin letters (a–z) only
$0 \le k \le 10^{9}$

Examples

Input #1
salom
3
Output #1
vdorp
Input #2
xyz
26
Output #2
xyz

Sign in to submit a solution

Signing up is free and takes a minute.