#include #include #include #include using namespace std; const int mod = 1e9 + 7; int f[26][3], tmp[26][3], ans[2016]; void calc() { memset(tmp, 0, sizeof tmp); for (int i = 0; i < 26 ; i++) { for (int j = 0 ; j < 26 ; j++) if (i != j) for (int k = 0 ; k < 3; k++) (tmp[i][0] += f[j][k]) %= mod; for (int k = 1 ; k < 3; k++) (tmp[i][k] += f[i][k - 1]) %= mod; } memcpy(f, tmp, sizeof tmp); } void init() { for (int i = 0 ; i < 26 ; i++) f[i][0] = 1; ans[0] = 1; ans[1] = 26; for (int i = 2 ; i <= 2000 ; i++) { calc(); for (int j = 0 ; j < 26 ; j++) for (int k = 0 ; k < 3 ; k++) (ans[i] += f[j][k]) %= mod; } } int main() { init(); int t; scanf("%d", &t); while (t--) { int n; scanf("%d", &n); printf("%d\n", ans[n]); } return 0; }