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.