{"raw_statement":[{"iden":"statement","content":"Bob has built a tiny robot whose movement he can program. He also has a board that consists of n cells lined up in a row, numbered 1 to n from left to right. Each of the cells also has a single letter written on it. Initially Bob places the robot in the cell number x. Then Bob executes a program that moves the robot on the board. One instruction of the program will move the robot either one cell to the left or one cell to the right.\n\nThe robot also has a photo sensor directed at the board, and whenever Bob changes the location of the robot (including placing it in the initial cell), it recognizes and sends the letter that is written in the cell to Bob's computer. After the robot finishes the program, the computer prints the received text.\n\nGiven the program of m moves for the robot, print out the text the computer will output. The program consists of characters \"_L_\" and \"_R_\", which mean that the robot should move one cell to the left or to the right, respectively.\n\nThe first line contains two space-separated integers n and x (2 ≤ n < 105, 1 ≤ x ≤ n). The second line contains a string s of length n: the i-th character of s is the letter written in the cell number i. The string s will consist of lowercase latin letters. The third line contains a single integer m — the length of the program (1 ≤ m ≤ 105). The fourth line contains the program consisting of symbols \"_L_\" and \"_R_\".\n\nIt is guaranteed that the program will not cause the robot to leave the board.\n\nIn a single line output the text printed out by the computer.\n\n"},{"iden":"input","content":"The first line contains two space-separated integers n and x (2 ≤ n < 105, 1 ≤ x ≤ n). The second line contains a string s of length n: the i-th character of s is the letter written in the cell number i. The string s will consist of lowercase latin letters. The third line contains a single integer m — the length of the program (1 ≤ m ≤ 105). The fourth line contains the program consisting of symbols \"_L_\" and \"_R_\".It is guaranteed that the program will not cause the robot to leave the board."},{"iden":"output","content":"In a single line output the text printed out by the computer."},{"iden":"examples","content":"Input7 1taconut10RRRLRLRRRROutputtacococonut"}],"translated_statement":null,"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ n \\in \\mathbb{Z} $ be the number of cells.  \nLet $ x \\in \\{1, \\dots, n\\} $ be the initial position of the robot.  \nLet $ s \\in \\Sigma^n $ be a string of length $ n $, where $ \\Sigma $ is the set of lowercase Latin letters, and $ s[i] $ is the letter on cell $ i $.  \nLet $ m \\in \\mathbb{Z} $ be the number of instructions.  \nLet $ p \\in \\{L, R\\}^m $ be the program sequence.\n\n**Constraints**  \n1. $ 2 \\leq n < 10^5 $  \n2. $ 1 \\leq x \\leq n $  \n3. $ 1 \\leq m \\leq 10^5 $  \n4. The robot never moves outside $ [1, n] $.\n\n**Objective**  \nSimulate the robot's movement starting at position $ x $, and output the sequence of letters $ s[\\text{position}] $ collected at each step (including the initial placement).  \nLet $ \\text{pos}_0 = x $, and for $ j \\in \\{1, \\dots, m\\} $:  \n$$\n\\text{pos}_j = \n\\begin{cases}\n\\text{pos}_{j-1} - 1 & \\text{if } p[j] = L \\\\\n\\text{pos}_{j-1} + 1 & \\text{if } p[j] = R\n\\end{cases}\n$$  \nOutput the string:  \n$$\ns[\\text{pos}_0] \\cdot s[\\text{pos}_1] \\cdot \\dots \\cdot s[\\text{pos}_m]\n$$  \nwhere $ \\cdot $ denotes concatenation, and positions are 1-indexed.","simple_statement":"Bob has a robot on a row of n cells, each with a letter. The robot starts at position x. It follows a program of L (left) and R (right) moves. Every time the robot moves (including the start), it reads the letter under it. Print the sequence of letters read.","has_page_source":false}