import sys input = sys.stdin.readline from collections import * N = int(input()) dp = [[0]*3 for _ in range(N+1)] dp[0][0] = 1 MOD = 998244353 for _ in range(N): ndp = [[0]*3 for _ in range(N+1)] for i in range(N+1): ndp[i][0] += 25*dp[i][0]%MOD ndp[i][0] %= MOD ndp[i][1] += (25*dp[i][1]+dp[i][0])%MOD ndp[i][1] %= MOD ndp[i][2] += (25*dp[i][2]+dp[i][1])%MOD ndp[i][2] %= MOD if i+1<=N: ndp[i+1][0] += dp[i][2] ndp[i+1][0] %= MOD dp = ndp ans = 0 for i in range(N+1): for j in range(3): ans += i*dp[i][j] ans %= MOD print(ans)