The first line has the binary string a and the second line has the binary string b. The length of each string is a positive integer at most 200,000.
The third line has the number of queries q (1≤q≤400,000). Each of the next q lines has one query as p1, p2, and len separated by spaces (1≤len, 0≤p1≤∣a∣−len, 0≤p2≤∣b∣−len).