{"raw_statement":[{"iden":"statement","content":"You're trying to come up with a good Codeforces username. You want to use something similar to your real name, but not exactly your real name, to not release too much info about yourself online. Thus, you decide to encode your username using an Affine cipher.\n\nAn affine cipher uses a key of two values: $a$ and $b$. Given a letter $l$, you first convert it into it's \"character code\", for example, \"a\" would become $0$, \"b\" would become $1$, etc. We'll call this $x$. Then, you calculate the value of $a$$x$ + $b$ mod $26$, and reverse the character code mapping that you used previously, to convert the answer back into a letter. The affine cipher runs this process on all letters (not spaces) in a given string.\n\nFor example, let's use the letter $c$, and a key of $a$ = $15$, and $b$ = $5$. $c$ has a character code of $2$. Then, the encoded character has a character code of $15$*$2$ + $5$ mod $26$ = $35$ mod $26$ = $9$. Thus, the encoded character is $j$.\n\nThe first line of input contains two space-separated integers $a$ and $b$: the affine cipher's key, as described above. The second line of input consists of a string consisting only of lowercase characters and spaces.\n\nOutput the input string, encoded using the affine cipher as described above.\n\n"},{"iden":"input","content":"The first line of input contains two space-separated integers $a$ and $b$: the affine cipher's key, as described above. The second line of input consists of a string consisting only of lowercase characters and spaces."},{"iden":"output","content":"Output the input string, encoded using the affine cipher as described above."},{"iden":"examples","content":"Input7 5\nxavier\nOutputkfwjhu\nInput11 1\ncoderams club\nOutputxzitgbdr xsnm\n"}],"translated_statement":null,"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ a, b \\in \\mathbb{Z} $ be the affine cipher key, with $ \\gcd(a, 26) = 1 $.  \nLet $ S $ be the input string over the alphabet $ \\Sigma = \\{ \\text{a}, \\dots, \\text{z}, \\text{ } \\} $.  \nDefine the character code mapping $ c: \\{\\text{a}, \\dots, \\text{z}\\} \\to \\{0, \\dots, 25\\} $ by $ c(\\text{a}) = 0, c(\\text{b}) = 1, \\dots, c(\\text{z}) = 25 $.  \nLet $ c^{-1}: \\{0, \\dots, 25\\} \\to \\{\\text{a}, \\dots, \\text{z}\\} $ be its inverse.\n\n**Constraints**  \n1. $ 1 \\leq a \\leq 25 $, $ 0 \\leq b \\leq 25 $, $ \\gcd(a, 26) = 1 $  \n2. $ S $ contains only lowercase English letters and spaces.\n\n**Objective**  \nFor each character $ l \\in S $:  \n- If $ l $ is a space, output $ l $.  \n- If $ l $ is a letter, compute:  \n  $$\n  y = (a \\cdot c(l) + b) \\mod 26\n  $$  \n  and output $ c^{-1}(y) $.  \n\nOutput the resulting encoded string.","simple_statement":"Given a key (a, b), encode each letter in the string using the affine cipher: new_char = (a * old_char + b) mod 26. Leave spaces unchanged.","has_page_source":false}