import sys from collections import deque, Counter sys.setrecursionlimit(5 * 10 ** 5) from pypyjit import set_param set_param('max_unroll_recursion=-1') input = lambda: sys.stdin.readline().rstrip() ii = lambda: int(input()) mi = lambda: map(int, input().split()) li = lambda: list(mi()) inf = 2 ** 63 - 1 mod = 998244353 n = ii() dp = [[[0] * 3 for _ in range(n // 3 + 2)] for _ in range(n + 1)] dp[0][0][0] = 1 for i in range(n): for j in range(n // 3 + 1): for k in range(3): if k < 2: dp[i + 1][j][(k + 1) % 3] += dp[i][j][k] dp[i + 1][j][k] += 25 * dp[i][j][k] dp[i + 1][j][k] %= mod dp[i + 1][j][(k + 1) % 3] %= mod dp[i + 1][j + 1][0] += dp[i][j][k] dp[i + 1][j + 1][0] %= mod ans = 0 for i in range(n//3 + 1): for j in range(3): ans += i * dp[n][i][j] ans %= mod print(ans)