NIO is given two strings and
consisting of lowercase letters, an integer
and
integers
.
The first line contains a single string.
The second line contains a single string.
The third line contains two integersand
.
Each of the nextlines contains two integers
and
.
Each of the nextlines contains two integers
and
.
lines. The
-th of them contains a single integer - the answer to the
-th query.