import numpy as np def convolve(f, g): fft_len = 1 while 2 * fft_len < len(f) + len(g) - 1: fft_len *= 2 fft_len *= 2 Ff = np.fft.rfft(f, fft_len, axis=0) Fg = np.fft.rfft(g, fft_len, axis=0) Fh = Ff @ Fg h = np.fft.irfft(Fh, fft_len, axis=0) h = np.rint(h).astype(np.int64) return h[: len(f) + len(g) - 1] def convolution(f, g, p=998244353): f1, f2 = np.divmod(f, 1 << 15) g1, g2 = np.divmod(g, 1 << 15) a = convolve(f1, g1) % p c = convolve(f2, g2) % p b = (convolve(f1 + f2, g1 + g2) - a - c) % p return ((a << 30) + (b << 15) + c) % p def poly_pow(f, n, p=998244353): res = np.eye(3, dtype=np.int64).reshape(1, 3, 3) while n: if n & 1: res = convolution(res, f, p) f = convolution(f, f, p) n >>= 1 return res mod = 998244353 inv2, inv3, inv5 = pow(2, mod - 2, mod), pow(3, mod - 2, mod), pow(5, mod - 2, mod) P = np.array( [ [[inv2, 0, 0], [inv3, 0, 0], [0, 0, 0]], [[0, inv2, 0], [0, inv3, inv3], [0, 2 * inv3, inv3]], ] ) v = np.array([[2 * inv5 % mod, 0, 0], [0, 2 * inv5 % mod, inv5]]) if __name__ == "__main__": N, H = map(int, input().split()) P = poly_pow(P, N - 1, mod) A = [v[i] @ P[H - i :] % mod for i in range(2)] ans = 0 for a in A: for row in a: for x in row: ans += x if ans >= mod: ans -= mod print(ans)