#include #include #include #include using namespace std; const int N = 2020; const long long mod = 1000000007; long long dp[N][4]; void debug(int n) { for(int i = 0; i < n; i++) { for(int j = 0; j < 4; j++) cout << dp[i][j] << ' '; cout << endl; } cout << endl; } int main(void) { int T; memset(dp, 0, sizeof(dp)); dp[1][1] = 26; int i; for(i = 2; i <= N; i++) { //dp[i][0] = ( (dp[i-1][0] + dp[i-1][1] + dp[i-1][2])*25 ) %mod; dp[i][1] = ( ( dp[i-1][1] + dp[i-1][2] + dp[i-1][3] ) * 25)%mod; dp[i][2] = (dp[i-1][1])%mod; dp[i][3] = (dp[i-1][2])%mod; } // debug(10); cin >> T; while(T--) { int n; cin >> n; long long ans = 0; for(i = 1; i < 4; i++) { ans = (ans+dp[n][i])%mod; } cout << ans << endl; } return 0; }