Given a string S consists of lower case letters. You're going to perform Q operations one by one. Each operation can be one of the following two types: Modify: Given an integer x. You need to modify S according to the value of x. If x is positive, move the leftmost x letters in S to the right side of S; otherwise, move the rightmost |x| letters in S to the left side of S. Answer: Given a positive integer x. Please answer what the x-th letter in the current string S is.
Given a string S consists of lower case letters. You're going to perform Q operations one by one. Each operation can be one of the following two types: Modify: Given an integer x. You need to modify S according to the value of x. If x is positive, move the leftmost x letters in S to the right side of S; otherwise, move the rightmost |x| letters in S to the left side of S. Answer: Given a positive integer x. Please answer what the x-th letter in the current string S is.
(图片来源网络,侵删)