MOD = 998244353 n,k = map(int, input().split()) dp = [0 for i in range(6)] dp[0] = 1 div = pow(6, MOD-2, MOD) for i in range(n): ndp = [0 for i in range(6)] for j in range(6): dist = dp[j] * div % MOD for k in range(6): ndp[k] += dist dp = ndp print(dp[k])