func_code_string: #include <bits/stdc++.h>   using namespace std;   uint64_t mat[5][5] = {{0, 0, 1, 0, 0},                         {1, 0, 1, 0, 0},                         {0, 1, 1, 0, 0},                         {0, 0, 1, 1, 0},                         {0, 0, 0, 1, 1}};   uint64_t ex[5][5] = {{0, 0, 0, 0, 0},                        {0, 0, 0, 0, 0},                        {0, 0, 0, 0, 0},                        {0, 0, 0, 0, 0},                        {0, 0, 0, 0, 0}};   static const uint64_t mod = 1000000000 + 6;   static const uint64_t mod2 = 1000000000 + 7;   void mult(int i) {     uint64_t tmp[5][5];     uint64_t tmp2[5][5];     if (i == 1) {       for (int c = 0; c < 5; c++) {         for (int d = 0; d < 5; d++) {           tmp[c][d] = ex[c][d];         }       }     } else {       for (int c = 0; c < 5; c++) {         for (int d = 0; d < 5; d++) {           tmp[c][d] = mat[c][d];         }       }     }     for (int c = 0; c < 5; c++) {       for (int d = 0; d < 5; d++) {         tmp2[c][d] = ex[c][d];       }     }     for (int c = 0; c < 5; c++) {       for (int d = 0; d < 5; d++) {         ex[c][d] = 0;         for (int k = 0; k < 5; k++) {           ex[c][d] += (tmp2[c][k] * tmp[k][d]) % mod;           ex[c][d] %= mod;         }       }     }   }   void expo(uint64_t n) {     if (n == 1) {       for (int c = 0; c < 5; c++) {         for (int d = 0; d < 5; d++) {           ex[c][d] = mat[c][d];         }       }       return;     }     if (n % 2 == 0) {       expo(n / 2);       mult(1);     } else {       expo(n - 1);       mult(0);     }   }   static inline uint64_t calcCoeff(uint64_t a[5]) {     uint64_t ans = 0;     for (int c = 0; c < 5; c++) {       ans += (a[c] * ex[c][2]) % mod;       ans %= mod;     }     return ans;   }   uint64_t sexp(uint64_t a, uint64_t n) {     if (n == 0) {       return 1;     }     if (n % 2 == 0) {       uint64_t ans = sexp(a, n / 2);       return (ans * ans) % mod2;     } else {       return (a * sexp(a, n - 1)) % mod2;     }   }   int main(void) {     uint64_t n, f1, f2, f3, mc;     cin >> n >> f1 >> f2 >> f3 >> mc;     expo(n - 3);     uint64_t nf1, nf2, nf3;     uint64_t nc;     uint64_t a, b, c;     {       uint64_t init[5] = {1, 0, 0, 0, 0};       nf1 = calcCoeff(init);     }     {       uint64_t init[5] = {0, 1, 0, 0, 0};       nf2 = calcCoeff(init);     }     {       uint64_t init[5] = {0, 0, 1, 0, 0};       nf3 = calcCoeff(init);     }     {       uint64_t init[5] = {0, 0, 0, 2, 2};       nc = calcCoeff(init);     }     uint64_t ans = (((sexp(f1, nf1) * sexp(f2, nf2)) % mod2 * sexp(f3, nf3)) %                     mod2 * sexp(mc, nc)) %                    mod2;     cout << ans << endl;     return 0;   }   