N = int(input()) MOD = 998244353 dp = [[[0 for _ in range(3)] for _ in range(N//3+1)] for _ in range(N+1)] dp[1][0][0] = 25 dp[1][0][1] = 1 for i in range(2,N+1): for j in range(N//3+1): dp[i][j][0] = (dp[i-1][j][0]*25)%MOD if j>=1: dp[i][j][0] = (dp[i][j][0]+dp[i-1][j-1][2])%MOD dp[i][j][1] = (dp[i-1][j][1]*25+dp[i-1][j][0])%MOD dp[i][j][2] = (dp[i-1][j][2]*25+dp[i-1][j][1])%MOD ans = 0 for j in range(1,N//3+1): ans = (ans+(dp[N][j][0]+dp[N][j][1]+dp[N][j][2])*j)%MOD print(ans)