CF598B Queries on a String
Description
You are given a string $ s $ and should process $ m $ queries. Each query is described by two 1-based indices $ l_{i} $ , $ r_{i} $ and integer $ k_{i} $ . It means that you should cyclically shift the substring $ s[l_{i}...\ r_{i}] $ $ k_{i} $ times. The queries should be processed one after another in the order they are given.
One operation of a cyclic shift (rotation) is equivalent to moving the last character to the position of the first character and shifting all other characters one position to the right.
For example, if the string $ s $ is abacaba and the query is $ l_{1}=3,r_{1}=6,k_{1}=1 $ then the answer is abbacaa. If after that we would process the query $ l_{2}=1,r_{2}=4,k_{2}=2 $ then we would get the string baabcaa.
Input Format
The first line of the input contains the string $ s $ ( $ 1
Output Format
Print the resulting string $ s $ after processing all $ m $ queries.
Explanation/Hint
The sample is described in problem statement.