You are given a string , consisting of small latin letters 'a' and 'b'. You are also given queries to process. The queries are as follows:
C : all the symbols in the string, starting at the , ending at the become equal to ;
S : swap two consecutive fragments of the string, where the first is denoted by a substring starting from ending at and the second is denoted by a substring starting at ending at ;
R : reverse the fragment of the string that starts at the symbol and ends at the one;
W : output the substring of the string that starts at the symbol and ends at the one;
H : output the Hamming distance between the consecutive substrings that starts at and respectively and have the length of .
Everything is 1-indexed here.
The first line of input contains a single integer the length of the string.
The second line contains the initial string itself.
The third line of input contains a single integer the number of queries.
Then, there are lines, each denotes a query of one of the types above.
Total number of characters printed in W-type queries will not exceed
For C-type, R-type, W-type queries: ; equals either a, or b
For S-type queries:
For H-type queries: ; ; .
For each query of the type W or the type H output an answer on the separate line of output.