func_code_string: #include <bits/stdc++.h>   using namespace std;   void File() {     freopen( CF1045H.in ,  r , stdin);     freopen( CF1045H.out ,  w , stdout);   }   template <typename T>   void read(T &_) {     _ = 0;     T f = 1;     char c = getchar();     for (; !isdigit(c); c = getchar())       if (c ==  - ) f = -1;     for (; isdigit(c); c = getchar()) _ = (_ << 1) + (_ << 3) + (c ^  0 );     _ *= f;   }   const int maxn = 5e5 + 10;   const int mod = 1e9 + 7;   const int N = 1e5;   long long fac[maxn], ifac[maxn];   int c[5];   long long qpow(long long x, long long y) {     long long ret = 1;     x %= mod;     while (y) {       if (y & 1) ret = ret * x % mod;       x = x * x % mod;       y >>= 1;     }     return ret;   }   void math_init() {     fac[0] = 1;     for (int i = 1, i_end_ = N; i <= i_end_; ++i) fac[i] = fac[i - 1] * i % mod;     ifac[N] = qpow(fac[N], mod - 2);     for (int i = N - 1, i_end_ = 0; i >= i_end_; --i)       ifac[i] = ifac[i + 1] * (i + 1) % mod;   }   long long C(int x, int y) {     if (x < 0 || y < 0 || x < y) return 0;     return fac[x] * ifac[y] % mod * ifac[x - y] % mod;   }   long long calc(int x, int y) {     if (!x && !y) return 1;     return C(x + y - 1, y - 1);   }   long long solve(char *s, bool type) {     long long ret = 0;     int len = strlen(s + 1), lim = 0, res[5];     for (int i = 0, i_end_ = 3; i <= i_end_; ++i) lim += c[i], res[i] = c[i];     ++lim;     if (len < lim) return 0;     if (len > lim) {       type = 1;       len = lim;       for (int i = 1, i_end_ = len; i <= i_end_; ++i) s[i] =  1 ;     }     for (int i = 1, i_end_ = len; i <= i_end_; ++i) {       if (i > 2) --res[(s[i - 2] ^  0 ) << 1 | (s[i - 1] ^  0 )];       if (s[i] ==  0  || i == 1) continue;       if (i > 1) --res[(s[i - 1] ^  0 ) << 1];       if (res[2] >= res[1] - 1 && res[2] <= res[1]) {         ret = (ret + calc(res[0], res[2] + 1) * calc(res[3], res[1])) % mod;       }       if (i > 1) ++res[(s[i - 1] ^  0 ) << 1];     }     if (type) {       if (len > 1) --res[(s[len - 1] ^  0 ) << 1 | (s[len] ^  0 )];       if (!res[0] && !res[1] && !res[2] && !res[3]) ++ret;     }     return ret;   }   int main() {     char L[maxn], R[maxn];     math_init();     scanf( %s%s , L + 1, R + 1);     for (int i = 0, i_end_ = 3; i <= i_end_; ++i) read(c[i]);     printf( %lld n , ((solve(R, 1) - solve(L, 0)) % mod + mod) % mod);     return 0;   }   