Palindrome

Time Limit: 6000/3000MS (Java/Others) Memory Limit: 128000/64000KB (Java/Others)

Problem Description

Now we have a long long string, and we will have two kinds of operation on it.

C i y : change the ith letter to y.
Q i j : check whether the substring from ith letter to jth letter is a palindrome.

Input

There are multiple test cases.

The first line contains a string whose length is not large than 1,000,000.

The next line contains a integer N indicating the number of operations.

The next N lines each lines contains a operation.

All letters in the input are lower-case.

Output

For each query operation, output "yes" if the corresponding substring is a palindrome, otherwise output "no".

Sample Input

aaaaa
4
Q 1 5
C 2 b
Q 1 5
Q 1 3

Sample Output

yes
no
yes

Hint

Adapted from a problem by yy17yy, 3x......

Source

dut200901102

Manager

Information
Solved Number36
Submit Number121
Problem Tags
data structures
hashing
No tag edit access
温馨提示:AC后可以编辑标签哦. ^-^
Login
LoginCancel