func_code_string: #include <bits/stdc++.h>   using namespace std;   string s, p;   vector<int> a, b, x, y;   int main() {     cin >> s >> p;     a.push_back(0);     b.push_back(0);     x.push_back(0);     y.push_back(0);     for (int i = 0; i < s.size(); i++) {       a.push_back(a[a.size() - 1]);       x.push_back(x[x.size() - 1]);       if (s[i] !=  A ) {         a[a.size() - 1]++;         x[x.size() - 1] = i + 1;       }     }     for (int i = 0; i < p.size(); i++) {       b.push_back(b[b.size() - 1]);       y.push_back(y[y.size() - 1]);       if (p[i] !=  A ) {         b[b.size() - 1]++;         y[y.size() - 1] = i + 1;       }     }     int q;     int r1, r2;     cin >> q;     int i, j, k, l;     int moze;     for (; q > 0; q--) {       moze = 1;       cin >> i >> j >> k >> l;       if ((b[l] - b[k - 1]) - (a[j] - a[i - 1]) < 0) {         moze = 0;       }       if (((b[l] - b[k - 1]) - (a[j] - a[i - 1])) % 2 != 0) {         moze = 0;       }       r2 = l - y[l];       r1 = j - x[j];       if (r1 > j - i + 1) r1 = j - i + 1;       if (r2 > l - k + 1) r2 = l - k + 1;       if (r1 < r2) {         moze = 0;       } else if ((a[j] - a[i - 1]) == 0 && (b[l] - b[k - 1]) > 0 && r1 == r2)         moze = 0;       else {         if ((r1 - r2) % 3 != 0 && (b[l] - b[k - 1]) - (a[j] - a[i - 1]) == 0) {           moze = 0;         }       }       cout << moze;     }     return 0;   }   