{"problem":{"name":"B. No Name","description":{"content":"This is the most direct problem ever, you are required to implement some basic string operations like insert and substring. In this problem |*S*| means the length of the string *S*. _Note: We didn't","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":4000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF10015B"},"statements":[{"statement_type":"Markdown","content":"This is the most direct problem ever, you are required to implement some basic string operations like insert and substring.\n\nIn this problem |*S*| means the length of the string *S*.\n\n_Note: We didn't find a good name for this problem._\n\nThe input starts with a line containing a string *S* (1  ≤  |*S*|  ≤  200,000), followed by one or more lines each describing one of the following operations to perform on *S* (all indices are zero based, and the quotes are for clarity):\n\nStrings *S* and *R* will consist of lower case English letters only ('a' to 'z'), and |*S*| will never get greater than 200,000 as a result of the operations. Also, the total number of characters to be printed will not exceed 200,000.\n\nFor every \"P *X* *Y*\" operation in the input, print one line with the corresponding substring.\n\n## Input\n\nThe input starts with a line containing a string *S* (1  ≤  |*S*|  ≤  200,000), followed by one or more lines each describing one of the following operations to perform on *S* (all indices are zero based, and the quotes are for clarity):  \"I *R* *X*\" means insert the string *R* (1  ≤  |*R*|  ≤  200,000) in *S* at index *X* (0  ≤  *X*  ≤  |*S*|), when *X* equals |*S*| this means append *R* at the end of *S*. For example, the result of inserting \"xy\" in \"abc\" at position 1 will be \"axybc\", and the result of inserting \"xy\" in \"abc\" at position 3 will be \"abcxy\", and the result of inserting \"xy\" in \"abc\" at position 0 will be \"xyabc\".  \"P *X* *Y*\" means print the substring of *S* from *X* to *Y*, inclusive (0  ≤  *X*  ≤  *Y* < |*S*|). For example the substring from 0 to 2 of \"abc\" is \"abc\", and the string from 1 to 1 of \"abc\" is \"b\".  \"END\" Indicates the end of operations, and will be last line of the input. Strings *S* and *R* will consist of lower case English letters only ('a' to 'z'), and |*S*| will never get greater than 200,000 as a result of the operations. Also, the total number of characters to be printed will not exceed 200,000.\n\n## Output\n\nFor every \"P *X* *Y*\" operation in the input, print one line with the corresponding substring.\n\n[samples]","is_translate":false,"language":"English"},{"statement_type":"Markdown","content":"**Definitions**  \nLet $ S \\in \\Sigma^* $ be the initial string, where $ \\Sigma = \\{a, b, \\dots, z\\} $ and $ 1 \\leq |S| \\leq 200{,}000 $.  \nLet $ \\mathcal{O} $ be a sequence of operations of the form:  \n- $ \\texttt{I } X \\ Y \\ R $: Insert string $ R $ into $ S $ at index $ X $, replacing the substring starting at $ X $ of length $ Y $.  \n- $ \\texttt{P } X \\ Y $: Print the substring $ S[X : X+Y] $ (i.e., from index $ X $ inclusive to $ X+Y $ exclusive).  \n\n**Constraints**  \n1. $ |S| \\leq 200{,}000 $ at all times.  \n2. All indices $ X, Y $ satisfy $ 0 \\leq X \\leq |S| $, $ 0 \\leq Y \\leq |S| - X $.  \n3. $ R \\in \\Sigma^* $, and $ |R| \\geq 0 $.  \n4. Total characters printed across all \"P\" operations $ \\leq 200{,}000 $.  \n\n**Objective**  \nFor each operation $ \\texttt{P } X \\ Y $, output the substring $ S[X : X+Y] $.  \nFor each operation $ \\texttt{I } X \\ Y \\ R $, update $ S \\leftarrow S[0:X] + R + S[X+Y:] $.","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF10015B","tags":[],"sample_group":[],"created_at":"2026-03-03 11:00:39"}}