func_code_string: #include <bits/stdc++.h>   using namespace std;   template <typename T>   inline void Int(T &n) {     n = 0;     int f = 1;     register int ch = getchar();     for (; !isdigit(ch); ch = getchar())       if (ch ==  - ) f = -1;     for (; isdigit(ch); ch = getchar()) n = (n << 3) + (n << 1) + ch -  0 ;     n = n * f;   }   template <typename T>   T gcd(T a, T b) {     return !b ? a : gcd(b, a % b);   }   template <typename T>   inline void umin(T &a, T b) {     a = a < b ? a : b;   }   template <typename T>   inline void umax(T &a, T b) {     a = a > b ? a : b;   }   template <typename T, typename W>   inline void Int(T &x, W &y) {     Int(x), Int(y);   }   template <typename T, typename W, typename Q>   inline void Int(T &x, W &y, Q &z) {     Int(x, y), Int(z);   }   const int N = (int)1e7 + 5;   const int INF = (int)1e9 + 7;   const long long MOD = (long long)1e9 + 7;   long long pa, pb, pc, pd, a, b, c, d;   int main() {     int n;     Int(n);     pa = pb = pc = 0, pd = 1;     for (int i = 1; i <= n; ++i) {       a = (pb + pc + pd) % MOD;       b = (pa + pc + pd) % MOD;       c = (pa + pb + pd) % MOD;       d = (pa + pb + pc) % MOD;       pa = a, pb = b, pc = c, pd = d;     }     printf( %lld n , d);     return 0;   }   