Hacker

Simulate substring comparisons, substring copy from a fixed string, and range letter-increment operations on a mutable string of length N.

Hard9Segment treeHash mapString matchingLinked listNo attempts yetTime limit4sMemory limit512 MB

Problem

A hacker has broken into Miltos's e-mail account again. Miltos decides to replace his password with a much stronger one. The old password WW is a string of NN lowercase Latin letters, and the new password starts as an exact copy of WW. Miltos applies QQ operations to the new password in order, and he asks you to simulate them.

There are three kinds of operations.

  • 1 i j k: compare the substring of the new password from position ii to position jj with the substring of the new password that starts at position kk and has length ji+1j - i + 1. Print Y if the two substrings are equal, otherwise print N.
  • 2 i j k: replace positions ii to jj of the new password with the substring of the old password WW that starts at position kk and has length ji+1j - i + 1.
  • 3 i j: advance every letter of the new password from position ii to position jj to the next letter, cyclically. The letter a becomes b, b becomes c, and z becomes a.

Positions are counted from 1. Every operation is valid, so 1ijN1 \le i \le j \le N, and operations of kind 1 and kind 2 satisfy k+jiNk + j - i \le N. The old password WW never changes, and the length of the new password is always NN.

Input

The first line contains the old password WW. The second line contains the number of operations QQ. Each of the next QQ lines contains one operation in one of the formats above.

Output

For every operation of kind 1, print Y or N on its own line, in the order the operations are given.