{"raw_statement":[{"iden":"problem statement","content":"You are given a string $S$ of length $N$ consisting of uppercase and lowercase English letters.\nLet us perform $Q$ operations on the string $S$. The $i$\\-th operation $(1\\leq i\\leq Q)$ is represented by a tuple $(t _ i,x _ i,c _ i)$ of two integers and one character, as follows.\n\n*   If $t _ i=1$, change the $x _ i$\\-th character of $S$ to $c _ i$.\n*   If $t _ i=2$, convert all uppercase letters in $S$ to lowercase (do not use $x _ i,c _ i$ for this operation).\n*   If $t _ i=3$, convert all lowercase letters in $S$ to uppercase (do not use $x _ i,c _ i$ for this operation).\n\nPrint the $S$ after the $Q$ operations."},{"iden":"constraints","content":"*   $1\\leq N\\leq5\\times10^5$\n*   $S$ is a string of length $N$ consisting of uppercase and lowercase English letters.\n*   $1\\leq Q\\leq5\\times10^5$\n*   $1\\leq t _ i\\leq3\\ (1\\leq i\\leq Q)$\n*   If $t _ i=1$, then $1\\leq x _ i\\leq N\\ (1\\leq i\\leq Q)$.\n*   $c _ i$ is an uppercase or lowercase English letter.\n*   If $t _ i\\neq 1$, then $x _ i=0$ and $c _ i=$ `'a'`.\n*   $N,Q,t _ i,x _ i$ are all integers."},{"iden":"input","content":"The input is given from Standard Input in the following format:\n\n$N$\n$S$\n$Q$\n$t _ 1$ $x _ 1$ $c _ 1$\n$t _ 2$ $x _ 2$ $c _ 2$\n$\\vdots$\n$t _ Q$ $x _ Q$ $c _ Q$"},{"iden":"sample input 1","content":"7\nAtCoder\n5\n1 4 i\n3 0 a\n1 5 b\n2 0 a\n1 4 Y"},{"iden":"sample output 1","content":"atcYber\n\nInitially, the string $S$ is `AtCoder`.\n\n*   The first operation changes the $4$\\-th character to `i`, changing $S$ to `AtCider`.\n*   The second operation converts all lowercase letters to uppercase, changing $S$ to `ATCIDER`.\n*   The third operation changes the $5$\\-th character to `b`, changing $S$ to `ATCIbER`.\n*   The fourth operation converts all uppercase letters to lowercase, changing $S$ to `atciber`.\n*   The fifth operation changes the $4$\\-th character to `Y`, changing $S$ to `atcYber`.\n\nAfter the operations, the string $S$ is `atcYber`, so print `atcYber`."},{"iden":"sample input 2","content":"35\nTheQuickBrownFoxJumpsOverTheLazyDog\n10\n2 0 a\n1 19 G\n1 13 m\n1 2 E\n1 21 F\n2 0 a\n1 27 b\n3 0 a\n3 0 a\n1 15 i"},{"iden":"sample output 2","content":"TEEQUICKBROWMFiXJUGPFOVERTBELAZYDOG"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}