#K64842. Next Character String Transformation
Next Character String Transformation
Next Character String Transformation
Given a string s
consisting of lowercase Latin letters, transform it into a new string by replacing each character with the next character in the alphabet. If the character is z
, it wraps around to a
. In other words, if we define a function \(f(c)\) for each character \(c\) by
\(f(c) = \begin{cases}\text{'a'} & \text{if } c = \text{'z'}\\c+1 & \text{otherwise}\end{cases}\),
then for the string \(s = s_1s_2...s_n\), you should output \(f(s_1)f(s_2)...f(s_n)\).
For example, transforming "xyz" yields "yza", and transforming "abc" yields "bcd".
inputFormat
The input consists of a single line containing a non-empty string (s) of lowercase Latin letters.
outputFormat
Output a single line containing the transformed string after replacing each character with its next character in the alphabet (with 'z' replaced by 'a').## sample
xyz
yza