#include #include using namespace std; const long long mod = 1000000007; int main() { int T; cin >> T; while(T--) { int n; long long a3 = 26, a2 = 25 * 26, a1 = 26 * 25 * 26; long long b3 = 26, b2 = 25 * 26, b1 = 26 * 25 * 26; cin >> n; if(n < 4) { cout << pow(26, n) << endl; continue; } n -= 3; while(n--) { a1 = b1; a2 = b2; a3 = b3; b3 = a2 % mod; b2 = a1 % mod; b1 = 25 * a3 % mod + 25 * a1 % mod + 25 * a2 % mod; } cout << (b1 + b2 + b3) % mod << endl; } return 0; }