func_code_string: #include <bits/stdc++.h>   using namespace std;   const int SIZE = 401;   const int MOD = 1000000007;   struct matr {     long long a[8][8];   };   matr d, f, e;   int n;   void make() {     for (int i = 0; i < 8; i++)       for (int j = 0; j < 8; j++) f.a[i][j] = d.a[i][j] = e.a[i][j] = 0;     d.a[0][1] = 1;     d.a[0][4] = 1;     d.a[1][0] = 1;     d.a[2][3] = 1;     d.a[2][6] = 1;     d.a[3][2] = 1;     d.a[4][5] = 1;     d.a[4][7] = 1;     d.a[5][1] = 1;     d.a[5][4] = 1;     d.a[6][5] = 1;     d.a[6][7] = 1;     d.a[7][3] = 1;     d.a[7][6] = 1;     for (int i = 0; i < 8; i++) f.a[0][i] = e.a[i][i] = 1;   }   void print(matr a) {     for (int i = 0; i < 8; i++) {       for (int j = 0; j < 8; j++) cout << a.a[i][j] <<    ;       cout << endl;     }   }   matr mul(matr a, matr b) {     matr c;     for (int i = 0; i < 8; i++)       for (int j = 0; j < 8; j++) {         c.a[i][j] = 0;         for (int z = 0; z < 8; z++) {           c.a[i][j] += a.a[i][z] * b.a[z][j];           if (c.a[i][j] >= MOD) c.a[i][j] %= MOD;         }       }     return c;   }   matr sum(matr a, matr b) {     matr c;     for (int i = 0; i < 8; i++)       for (int j = 0; j < 8; j++) c.a[i][j] = (a.a[i][j] + b.a[i][j]) % MOD;     return c;   }   matr sqr(matr a) { return mul(a, a); }   matr pow_(matr p, int n) {     if (n <= 1) return p;     if (n % 2 == 0) return sqr(pow_(p, n / 2));     return mul(p, sqr(pow_(p, n / 2)));   }   long long sum(matr a) {     long long ans = 0;     for (int i = 0; i < 8; i++) ans += a.a[0][i];     return ans;   }   long long solve_palin(int n) {     if (n == 1) return 4;     if (n == 2) return 4;     return sum(mul(f, pow_(d, n - 2)));   }   long long solve_one(int n) {     if (n == 1) return 4;     if (n == 2) return 4;     if (n % 2 == 0) return solve_palin(n) / 2;     return solve_palin(n) / 2 + solve_palin((n + 1) / 2);   }   matr clear(matr a) {     for (int i = 0; i < 8; i++)       for (int j = 0; j < 8; j++) a.a[i][j] = 0;     return a;   }   int log_(int n) {     int l = 0;     while ((1 << l) <= n) l++;     return l - 1;   }   int log_less(int n) {     int l = 0;     while ((1 << l) - 1 < n) l++;     return l - 1;   }   int step_2(int n) { return (1 << n); }   matr magic_func(int n) {     if (n == 0) return e;     if (n == 1) return sum(d, e);     matr ans;     ans = clear(ans);     int w = log_less(n);     ans = sum(d, e);     for (int i = 1; i < w; i++) ans = mul(ans, sum(pow_(d, step_2(i)), e));     return sum(ans, mul(pow_(d, step_2(w)), magic_func(n - step_2(w))));   }   long long solve(int n) {     if (n == 1) return 4;     matr ans;     ans = clear(ans);     n -= 2;     ans = magic_func(n);     return sum(mul(f, ans)) + 4;   }   long long real_ans(int n) { return solve(n) / 2 + solve((n + 1) / 2) / 2; }   int l, r;   int main() {     cin >> l >> r;     make();     if (r == 1) {       cout << 4;       return 0;     }     if (l == r) {       cout << solve_one(l) % MOD;       return 0;     }     long long razn = 0;     if (l == 1) {       razn = 4;       l++;     }     cout << ((real_ans(r) - real_ans(l - 1) + razn) % MOD + MOD) % MOD;     return 0;   }   