{"raw_statement":[{"iden":"statement","content":"\"_Khoor!_\" David exclaimed to Aram.\n\n\"_Jreeohghbjrrn!_\" Aram responded.\n\nDismayed to find that club members weren't sufficiently confused, Aram and David decided to speak in a new language. Rather invent one from scratch, they decided to encode their speech with a Caesar cipher.\n\nSpecifically, they agree on the _Caesar shift_ $s$. To say a word, they replace each of its letters by the letter that comes $s$ places later in the alphabet. Letters that pass _z_ wrap back around to _a_. For example if $s = 4$, _a_ becomes _e_, _b_ becomes _f_, and _y_ becomes _c_.\n\nEncoding and decoding words in their heads is very slow, so David and Aram asked you to write a program to automate this process. After all, they're still untangling their tongues after saying _jreeohghbjrrn_!\n\nThe first line contains a single character, either \"_E_\" or \"_D_\", indicating whether Aram and David are requesting a word to encode or decode, respectively.\n\nThe second line contains a integer $s$ ($1 <= s <= 25$), the shift.\n\nThe third line contains a single word $w$ ($1 <= | w | <= 100$) consisting solely of the lowercase Latin letters from _a_ to _z_.\n\nOn a single line output the encrypted or decrypted word, as requested.\n\n"},{"iden":"input","content":"The first line contains a single character, either \"_E_\" or \"_D_\", indicating whether Aram and David are requesting a word to encode or decode, respectively.The second line contains a integer $s$ ($1 <= s <= 25$), the shift.The third line contains a single word $w$ ($1 <= | w | <= 100$) consisting solely of the lowercase Latin letters from _a_ to _z_."},{"iden":"output","content":"On a single line output the encrypted or decrypted word, as requested."},{"iden":"examples","content":"InputE\n3\nhello\nOutputkhoor\nInputD\n3\njreeohghbjrrn\nOutputgobbledeygook\n"}],"translated_statement":null,"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ A, B, C \\in \\mathbb{Z}^+ $ with $ 1 \\leq A, B, C \\leq 1000 $.  \nLet $ K \\in \\mathbb{Z}^+ $ be the number of cake pieces, with $ K \\leq 5000 $.  \nFor each piece $ i \\in \\{1, \\dots, K\\} $, define:  \n- $ w_i \\in \\mathbb{R}^+ $: weight of piece $ i $,  \n- $ a_i \\in \\{1, \\dots, A\\} $: recipient index if $ A $ guests arrive,  \n- $ b_i \\in \\{1, \\dots, B\\} $: recipient index if $ B $ guests arrive,  \n- $ c_i \\in \\{1, \\dots, C\\} $: recipient index if $ C $ guests arrive.  \n\n**Constraints**  \n1. $ \\sum_{i=1}^K w_i \\leq 10^{18} $  \n2. For each $ i \\in \\{1, \\dots, K\\} $:  \n   - $ w_i > 0 $,  \n   - $ 1 \\leq a_i \\leq A $,  \n   - $ 1 \\leq b_i \\leq B $,  \n   - $ 1 \\leq c_i \\leq C $.  \n3. $ K \\leq 5000 $  \n\n**Objective**  \nPartition the cake into $ K $ pieces such that:  \n- When $ A $ guests arrive, the pieces can be partitioned into $ A $ groups (one per guest) with equal total weight.  \n- When $ B $ guests arrive, the pieces can be partitioned into $ B $ groups with equal total weight.  \n- When $ C $ guests arrive, the pieces can be partitioned into $ C $ groups with equal total weight.  \n\nThat is, for each $ x \\in \\{A, B, C\\} $, the multiset $ \\{w_i\\} $ can be partitioned into $ x $ subsets, each summing to $ \\frac{W}{x} $, where $ W = \\sum_{i=1}^K w_i $.","simple_statement":"You need to cut a cake into at most 5,000 pieces so that no matter if A, B, or C guests come, you can give each guest exactly the same total weight by combining some pieces. Each piece has a weight and three labels: who gets it if A, B, or C guests arrive. Output the pieces.","has_page_source":false}