402513: GYM100796 G Robot Walk

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

G. Robot Walktime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

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.

The 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.

Given 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.

Input

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.

Output

In a single line output the text printed out by the computer.

ExamplesInput
7 1
taconut
10
RRRLRLRRRR
Output
tacococonut

加入题单

算法标签: