Bob is decorating his kitchen, more precisely, the floor. He has found a prime candidate for the tiles he will use. They come in a simple form factor — a square tile that is diagonally split into white and black part as depicted in the figure below. [Image] 

The dimension of this tile is perfect for this kitchen, as he will need exactly $w \times h$ tiles without any scraps. That is, the width of the kitchen is $w$ tiles, and the height is $h$ tiles. As each tile can be rotated in one of four ways, he still needs to decide on how exactly he will tile the floor. There is a single aesthetic criterion that he wants to fulfil: two adjacent tiles must not share a colour on the edge — i.e. one of the tiles must have a white colour on the shared border, and the second one must be black. [Image] The picture on the left shows one valid tiling of a $3 \times 2$ kitchen. The picture on the right shows an invalid arrangement, as the bottom two tiles touch with their white parts. 

Find the number of possible tilings. As this number may be large, output its remainder when divided by $998244353$ (a prime number). 


-----Input-----

The only line contains two space separated integers $w$, $h$ ($1 \leq w,h \leq 1\,000$) — the width and height of the kitchen, measured in tiles.


-----Output-----

Output a single integer $n$ — the remainder of the number of tilings when divided by $998244353$.


-----Examples-----
Input
2 2

Output
16

Input
2 4

Output
64

Source: codeforces | Difficulty: EASY
Tags: Combinatorics

Mathematics

Greedy algorithms


Solutions:
import math
a = input().split()
w = int(a[0])
h = int(a[1])
num = pow(2, w + h)
num = num % 998244353
print(num)


(w, h) = map(int, input().split())

def powermod(x, y, mod):
	if y == 0:
		return 1
	return powermod(x * x % mod, y // 2, mod) * (x if y % 2 else 1) % mod
print(powermod(2, w + h, 998244353))


print(2 ** sum(list(map(int, input().split()))) % 998244353)


(a, b) = map(int, input().split())
ans = 2 ** (a + b) % 998244353
print(ans)


mod = 998244353
(W, H) = map(int, input().split())
print(pow(2, H + W, mod))


a = [int(i) for i in input().split()]
w = a[0]
h = a[1]
p = 998244353
dp = [[0 for i in range(h)] for i in range(w)]
dp[0][0] = 4
for i in range(w):
	for j in range(h):
		if i == 0 and j == 0:
			continue
		elif i == 0:
			dp[i][j] = 2 * dp[i][j - 1] % p
		elif j == 0:
			dp[i][j] = 2 * dp[i - 1][j] % p
		else:
			dp[i][j] = (dp[i - 1][j] + dp[i][j - 1]) % p
print(dp[w - 1][h - 1])


import sys

class CTiles:

	def solve(self):
		MOD = 998244353
		(w, h) = [int(_) for _ in input().split()]
		print(pow(2, h + w, MOD))
solver = CTiles()
input = sys.stdin.readline
solver.solve()


(r, c) = map(int, input().split())
table = []
for _ in range(r):
	table.append([1] * c)
for i in range(c):
	table[0][i] = 2
for i in range(r):
	table[i][0] = 2
table[0][0] = 4
res = 1
for i in range(r):
	for j in range(c):
		res *= table[i][j]
print(res % 998244353)


(m, n) = map(int, input().split())
print(pow(2, m + n, 998244353))


(l, b) = map(int, input().split())
print(2 ** (l + b) % 998244353)


data = input().split()
a = int(data[0])
b = int(data[1])
print(2 ** (a + b) % 998244353)


def check_root(n, d):
	return n * n + 2 * n + 1 >= 4 * d

def mod_expo(n, p, m):
	result = 1
	while p != 0:
		if p % 2 == 1:
			result = result * n % m
		p //= 2
		n = n * n % m
	return result
t = 1
while t:
	t = t - 1
	(x, y) = map(int, input().split())
	print(mod_expo(2, x + y, 998244353))


mod = 998244353
(w, h) = map(int, input().split())
print(int(pow(2, h, mod)) * int(pow(2, w, mod)) % mod)


a = input()
a = a.split(' ')
w = int(a[0])
h = int(a[1])
v = 4 * 2 ** (w - 1 + h - 1)
print(v % 998244353)


(w, h) = map(int, input().split())
p = 998244353
k = 1
for i in range(w + h):
	k = 2 * k % p
print(k)


from collections import Counter
import string
import bisect
import math
import sys
mod = 998244353
from fractions import Fraction

def array_int():
	return [int(i) for i in sys.stdin.readline().split()]

def vary(arrber_of_variables):
	if arrber_of_variables == 1:
		return int(sys.stdin.readline())
	if arrber_of_variables >= 2:
		return map(int, sys.stdin.readline().split())

def makedict(var):
	return dict(Counter(var))
testcases = 1
for _ in range(testcases):
	(n, k) = vary(2)
	print(pow(2, n + k, mod))


p = 998244353
a = 2
(n, m) = map(int, input().split())
b = n + m
d = pow(a, b, p)
print(d)


(w, h) = map(int, input().split())
print(2 ** (h - 1) * 4 * 2 ** (w - 1) % 998244353)


(a, b) = list(map(int, input().split()))
print(2 ** (a + b) % 998244353)


m = list(map(int, input().split()))
k = sum(m)
print(pow(2, k, 998244353))


n = list(map(int, input().split()))
print(2 ** (n[0] + n[1]) % 998244353)


(w, h) = list((int(a) for a in input().split()))
print(2 ** (w + h) % 998244353)


(a, b) = input().split()
print(2 ** (int(a) + int(b)) % 998244353)


(n, m) = map(int, input().split())
ans = (n - 1) * (m - 1)
print(2 ** (n * m - ans - 1) * 4 % 998244353)


(n, m) = [int(x) for x in input().split()]
print(pow(2, n + m, 998244353))


(a, b) = [int(x) for x in input().split()]
print(pow(2, a + b, 998244353))


a = input().split(' ')
(b, c) = (int(a[0]), int(a[1]))
print(2 ** (b + c) % 998244353)


mod = 998244353
(w, h) = map(int, input().split())
w += h
w = w % (mod - 1)
print(2 ** w % mod)


def int_list():
	return [int(c) for c in input().split()]

def int1():
	return int(input())

def str_list():
	return [c for c in input().split()]

def str1():
	return input()
(w, h) = int_list()
ex = w + h
res = 1
for i in range(w + h):
	res = res * 2 % 998244353
print(res)


import sys
input = sys.stdin.buffer.readline

def I():
	return list(map(int, input().split()))

def sieve(n):
	a = [1] * n
	for i in range(2, n):
		if a[i]:
			for j in range(i * i, n, i):
				a[j] = 0
	return a
(w, h) = I()
print(pow(2, w + h, 998244353))


s = input().split()
w = eval(s[0])
h = eval(s[1])
ans = 2 ** w * 2 ** h
print(ans % 998244353)


import math
q = 1
for _ in range(q):
	c = 998244353
	(w, h) = list(map(int, input().split()))
	ans = 2 ** (w + h) % c
	print(ans % c)


import sys
(a, b) = input().split()
a = int(a)
b = int(b)
res = 2 ** (2 + (a + b - 2)) % 998244353
print(res)


import sys
import math
import collections
inp = lambda : sys.stdin.readline()
m = 998244353
(w, h) = map(int, input().split())
ans = 4
mul = 2
for i in range(1, h):
	ans *= 2
w -= 1
h -= 1
for i in range(w):
	ans *= 2
print(ans % m)


import math
(w, h) = map(int, input().split())
print(pow(2, w + h) % 998244353)


(w, h) = map(int, input().split())
ans1 = pow(2, w - 1, 998244353)
ans2 = pow(2, h - 1, 998244353)
print(ans1 * ans2 * 4 % 998244353)


import sys
input = sys.stdin.readline
sys.setrecursionlimit(100000)

def getN():
	return int(input())

def getList():
	return list(map(int, input().split()))
import math
MOD = 998244353
(w, h) = getList()
print(2 ** (h + w) % MOD)


import math as mt
import sys, string, bisect
input = sys.stdin.readline
from collections import deque, defaultdict
L = lambda : list(map(int, input().split()))
Ls = lambda : list(input().split())
M = lambda : map(int, input().split())
I = lambda : int(input())
(w, h) = M()
print(pow(2, w + h, 998244353))


s = input()
s = s.split()
a = int(s[0])
b = int(s[1])
print(2 ** (a + b) % 998244353)


a = input()
a = a.split(' ')
i = int(a[0])
j = int(a[1])
print(4 * 2 ** (i - 1) * 2 ** (j - 1) % 998244353)


(a, b) = map(int, input().split())
mod = 998244353
print(2 ** (a + b) % mod)


M = 998244353
(x, y) = [int(i) for i in input().split()]
print(pow(2, x + y, M))


(a, b) = map(int, input().split())
mod = 998244353
val = pow(2, a - 1)
val *= pow(2, b - 1)
val %= mod
val *= 4
print(val % mod)


(w, h) = map(int, input().split())
prime = 998244353
n = 1
for _ in range(w + h):
	n *= 2
	n %= prime
print(n % prime)


(a, b) = list(map(int, input().split()))
mod = 998244353
if a == 1 or b == 1:
	ans = 4 * 2 ** (max(a, b) - 1)
else:
	ans = 4 * 2 ** (a + b - 2)
print(ans % mod)


(w, h) = map(int, input().split())
ways = 4
for _ in range(w + h - 2):
	ways = ways * 2 % 998244353
print(ways)


(*a,) = map(int, input().split())
print(2 ** (a[0] + a[1] - 2) * 4 % 998244353)


import sys
input = sys.stdin.readline
mod = 998244353
(w, h) = list(map(int, input().split()))
print(4 * pow(2, w - 1 + (h - 1), mod) % mod)


import sys
import math
fileoperation = 0
if fileoperation:
	orig_stdout = sys.stdout
	orig_stdin = sys.stdin
	inputfile = open('W:/Competitive Programming/input.txt', 'r')
	outputfile = open('W:/Competitive Programming/output.txt', 'w')
	sys.stdin = inputfile
	sys.stdout = outputfile
mod = 1000000007

def nospace(l):
	ans = ''.join((str(i) for i in l))
	return ans
t = 1
for tt in range(t):
	mmm = 998244353
	(n, m) = map(int, sys.stdin.readline().split(' '))
	val = 4
	val *= pow(2, n - 1, mmm)
	val %= mmm
	val *= pow(2, m - 1, mmm)
	val %= mmm
	print(val)
if fileoperation:
	sys.stdout = orig_stdout
	sys.stdin = orig_stdin
	inputfile.close()
	outputfile.close()


(w, h) = input().split()
w = int(w)
h = int(h)
ans = 1
for i in range(w + h):
	ans = ans * 2 % 998244353
print(ans)


(width, height) = map(int, input().split())
print(2 ** (width + height) % 998244353)


(w, h) = map(int, input().split())
ans = 4
mod = 998244353
ans *= pow(2, w - 1, mod)
ans %= mod
ans *= pow(2, h - 1, mod)
ans %= mod
print(ans)


(w, h) = map(int, input().split())
ans = 4 * 2 ** (w + h - 2)
print(ans % 998244353)


def find_tiles(w, h):
	possible_tiles = 2 ** w * 2 ** h
	return possible_tiles % 998244353
(w, h) = input().strip().split()
print(find_tiles(int(w), int(h)))


(a, b) = [int(i) for i in input().split()]
possible_combinations = 2 ** (a + b)
print(possible_combinations % 998244353)


(x, y) = [int(k) for k in input().split()]
total = 1
for k in range(x):
	total *= 2
	total %= 998244353
for j in range(y):
	total *= 2
	total %= 998244353
print(total)


(w, h) = map(int, input().split())
print(2 ** h % 998244353 * (2 ** w % 998244353) % 998244353)


(x, y) = map(int, input().split())
MOD = 998244353
print(pow(2, x + y - 2, MOD) * 4 % MOD)


def main():
	(w, h) = map(int, input().split())
	print(pow(2, w + h, 998244353))
main()


arr = input().split()
mod = 998244353
ans1 = pow(2, int(arr[1]) + 1, mod)
ans2 = pow(2, int(arr[0]) - 1, mod)
ans = ans1 * ans2 % mod
print(ans)


import os
import heapq
import sys, threading
import math
import bisect
import operator
from collections import defaultdict
sys.setrecursionlimit(10 ** 5)
from io import BytesIO, IOBase

def gcd(a, b):
	if b == 0:
		return a
	else:
		return gcd(b, a % b)

def power(x, p, m):
	res = 1
	while p:
		if p & 1:
			res = res * x % m
		x = x * x % m
		p >>= 1
	return res

def inar():
	return [int(k) for k in input().split()]

def lcm(num1, num2):
	return num1 * num2 // gcd(num1, num2)

def main():
	(n, m) = inar()
	print(power(2, n + m, 998244353))
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


(a, b) = map(int, input().split())
print(pow(2, a + b, 998244353))


MOD = 998244353
(w, h) = input().split()
w = int(w)
h = int(h)
p = 2 ** (w + h)
p = p % MOD
print(p)


(nim, mike) = map(int, input().split())
print(2 ** (nim + mike) % 998244353)


def main():
	MOD = 998244353
	(w, h) = map(int, input().split())
	power = w + h
	res = 1
	x = 2
	while power > 0:
		if power % 2 == 1:
			res = res * x % MOD
		x = x * x % MOD
		power //= 2
	print(res)
main()


(w, h) = map(int, input().split())
s = 4 * pow(2, h - 1) * pow(2, w - 1)
print(s % 998244353)


prime = 998244353
(w, h) = list(map(int, input().split()))
print(pow(2, w + h, prime))


def modexp(x, y, p):
	ans = 1
	while y != 0:
		if y & 1:
			ans = ans * x % p
		y >>= 1
		x = x * x % p
	return ans
M = 998244353
(n, m) = map(int, input().split())
print(modexp(2, n + m, M))


def rint():
	return int(input())

def rints():
	return list(map(int, input().split()))
(w, h) = rints()
print(pow(2, w + h, 998244353))


(w, h) = map(int, input().split())
x = 1
x <<= w + h
print(x % 998244353)


(b, c) = map(int, input().split())
f = 1
for i in range(b + c):
	f *= 2
	if f >= 998244353:
		f -= 998244353
print(str(f))


arr = [int(i) for i in filter(None, input().split(' '))]
print(4 * 2 ** (arr[0] - 1) * 2 ** (arr[1] - 1) % 998244353)


(w, h) = map(int, input().split())
tot = 1
for i in range(w + h):
	tot = 2 * tot % 998244353
print(tot)


(w, h) = map(int, input().split())
pow = 1
mod = 998244353
for i in range(w + h):
	pow = pow * 2 % mod
print(pow)


def main():
	(x, y) = [int(x) for x in input().split(' ')]
	return 2 ** (x + y) % 998244353
print(main())


print(2 ** sum((int(i) for i in input().split())) % 998244353)


(w, h) = input().split()
answer = 2 ** (int(w) + int(h))
print(answer % 998244353)


(a, b) = input().strip().split()
a = int(a)
b = int(b)
ans = 2 ** (a + b)
ans %= 998244353
print(ans)


(b, c) = map(int, input().split())
print(str(pow(2, b + c, 998244353)))


import math
import sys
DEBUG = False

def inp():
	return sys.stdin.readline().rstrip()

def dprint(*value, sep=' ', end='\n'):
	if DEBUG:
		print(*value, sep=sep, end=end)
MOD = 998244353

def solve(W, H):
	ans = 1
	for _ in range(W + H):
		ans *= 2
		ans %= MOD
	return ans

def main():
	(W, H) = [int(e) for e in inp().split()]
	print(solve(W, H))
main()


(x, y) = [int(x) for x in input().split()]
print(2 ** (x + y) % 998244353)


inp = list(map(int, input().split()))
h = inp[0]
w = inp[1]
print(4 * 2 ** (h + w - 2) % 998244353)


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
(n, m) = map(int, input().split())
print(2 ** n % 998244353 * 2 ** m % 998244353 % 998244353)


(w, h) = map(int, input().split())
p = 998244353
x = w + h
y = 2 ** x % p
print(y)


(w, h) = map(int, input().split())
ways = 4
for i in range(1, w + h - 1):
	ways *= 2
ways = ways % 998244353
print(ways)


mod = 998244353
line = input().split()
n = int(line[0])
m = int(line[1])
ans = 1
for i in range(n + m):
	ans = ans * 2 % mod
print(ans)


(n, m) = map(int, input().split())
res = 4
for _ in range(n - 1):
	res *= 2
for _ in range(m - 1):
	res *= 2
print(res % 998244353)


import sys
inf = float('inf')
ip = lambda : sys.stdin.readline().rstrip()
split = lambda : ip().split(' ')
ip1 = lambda : map(int, split())
arr = lambda : list(ip1())
arr1 = lambda n: [arr() for _ in range(n)]
mod = 998244353
(n, m) = ip1()
print(2 ** (n + m) % mod)


from sys import stdin, stdout
from collections import Counter
import math

def rsingle_int():
	return int(stdin.readline().rstrip())

def rmult_int():
	return [int(x) for x in stdin.readline().rstrip().split()]

def rmult_str():
	return stdin.readline().rstrip().split()

def r_str():
	return stdin.readline().rstrip()

def rsingle_char():
	return stdin.read(1)

def main():
	(w, h) = rmult_int()
	opts = 2 ** (w + 1) * 2 ** (h - 1)
	print(opts % 998244353)
main()


def powmod(x, k, m):
	res = 1
	s = 1
	while s <= k:
		if k & s:
			res = res * x % m
		x = x * x % m
		s <<= 1
	return res
m = 998244353
(w, h) = map(int, input().split())
print(powmod(2, w + h, m))


(w, h) = (int(i) for i in input().split())
print(2 ** (h + w) % 998244353)


import sys
for line in sys.stdin:
	line = line.strip().split()
	w = int(line[0])
	h = int(line[1])
	ans = 2 ** (w + h)
	p = 998244353
	ans = ans % p
	print(ans)


from __future__ import division, print_function
from sys import stdin, stdout
import itertools, os, sys, threading
from collections import deque, Counter, OrderedDict, defaultdict
import heapq
from math import ceil, floor, log, sqrt, factorial, pow, pi, gcd

def ii():
	return int(input())

def si():
	return str(input())

def mi():
	return map(int, input().split())

def li():
	return list(mi())

def fii():
	return int(stdin.readline())

def fsi():
	return str(stdin.readline())

def fmi():
	return map(int, stdin.readline().split())

def fli():
	return list(fmi())
abc = 'abcdefghijklmnopqrstuvwxyz'
abd = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
mod = 1000000007
(dx, dy) = ([-1, 1, 0, 0], [0, 0, 1, -1])

def getKey(item):
	return item[0]

def sort2(l):
	return sorted(l, key=getKey)

def d2(n, m, num):
	return [[num for x in range(m)] for y in range(n)]

def isPowerOfTwo(x):
	return x and (not x & x - 1)

def decimalToBinary(n):
	return bin(n).replace('0b', '')

def ntl(n):
	return [int(i) for i in str(n)]

def powerMod(x, y, p):
	res = 1
	x %= p
	while y > 0:
		if y & 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x
graph = defaultdict(list)
visited = [0] * 1000000
col = [-1] * 1000000

def dfs(v, c):
	if visited[v]:
		if col[v] != c:
			print('-1')
			exit()
		return
	col[v] = c
	visited[v] = 1
	for i in graph[v]:
		dfs(i, c ^ 1)

def bfs(d, v):
	q = []
	q.append(v)
	visited[v] = 1
	while len(q) != 0:
		x = q[0]
		q.pop(0)
		for i in d[x]:
			if visited[i] != 1:
				visited[i] = 1
				q.append(i)
		print(x)

def make_graph(e):
	d = {}
	for i in range(e):
		(x, y) = mi()
		if x not in d.keys():
			d[x] = [y]
		else:
			d[x].append(y)
		if y not in d.keys():
			d[y] = [x]
		else:
			d[y].append(x)
	return d

def gr2(n):
	d = {}
	for i in range(n):
		(x, y) = mi()
		if x not in d.keys():
			d[x] = [y]
		else:
			d[x].append(y)
	return d

def connected_components(graph):
	seen = set()

	def dfs(v):
		vs = set([v])
		component = []
		while vs:
			v = vs.pop()
			seen.add(v)
			vs |= set(graph[v]) - seen
			component.append(v)
		return component
	ans = []
	for v in graph:
		if v not in seen:
			d = dfs(v)
			ans.append(d)
	return ans

def primeFactors(n):
	s = set()
	while n % 2 == 0:
		s.add(2)
		n = n // 2
	for i in range(3, int(sqrt(n)) + 1, 2):
		while n % i == 0:
			s.add(i)
			n = n // i
	if n > 2:
		s.add(n)
	return s
(n, m) = mi()
x = powerMod(2, n, 998244353)
y = powerMod(2, m, 998244353)
print(x * y % 998244353)


mo = 998244353

def get_pow(a, b):
	if b == 0:
		return 1
	if b == 1:
		return a
	else:
		re1 = get_pow(a, b // 2) % mo
		re2 = get_pow(a, b // 2) % mo
		re3 = get_pow(a, b % 2) % mo
		return re1 * re2 * re3 % mo
(n, k) = map(int, input().split())
ans = get_pow(2, n - 1)
ans = ans * get_pow(2, k - 1)
ans = ans % mo
ans = ans * 4
ans = ans % mo
print(ans)


import sys
a = list(map(int, sys.stdin.readline().split()))
print(2 ** (a[0] + a[1]) % 998244353)


(h, w) = map(int, input().split())
k = 4 * 2 ** (w + h - 2)
print(k % 998244353)


(w, h) = map(int, input().split())
modulo = 998244353
ans = 4
for row in range(h):
	for column in range(w):
		if row == 0 and column == 0:
			pass
		elif row == 0:
			ans *= 2
		else:
			ans *= 2
			break
	ans %= modulo
	ans = 1 if ans == 0 else ans
print(ans)


import sys
from collections import defaultdict, deque
from math import sqrt, gcd

def input():
	return sys.stdin.readline()[:-1]
(a, b) = [int(x) for x in input().split()]
print(4 * 2 ** (a + b - 2) % 998244353)


(x, y) = input().split()
(x, y) = (int(x), int(y))
out = 2 ** (x + y)
out = out % 998244353
print(out)


(x, y) = map(int, input().split())
x += y
mod = 998244353
x = 2 ** x
x %= mod
print(x)


from math import ceil, floor, gcd, fabs, factorial, fmod, sqrt, inf
import math

def sp():
	return map(int, input().split())

def fun(x):
	return sum((int(i) for i in str(x)))
t = 1
for _ in range(t):
	d = 998244353
	(w, h) = sp()
	ans = pow(2, w) * pow(2, h)
	print(ans % d)


def power(x, y, p):
	if y == 0:
		return 1
	temp = power(x, y // 2, p) % p
	if y % 2 == 0:
		return temp * temp % p
	else:
		return x * temp * temp % p
(a, b) = tuple(map(int, input().split()))
p = 998244353
print(power(2, a + b, p))


m = 998244353
(h, w) = map(int, input().split(' '))
if h >= 2 and w >= 2:
	a22 = 16
	out = a22 * (2 ** (w + h - 4) % m)
	out = out % m
else:
	out = 2 * 2 ** (h * w)
	out = out % m
print(out)


(w, h) = input().split()
w = int(w)
h = int(h)
damn = (1 << w + h) % 998244353
print(damn)


import re
s = input()
d = re.findall('\\d+', s)
tiles = 2 ** (int(d[0]) + int(d[1])) % 998244353
print(tiles)


(a, b) = map(int, input().split())
a -= 1
b -= 1
num = 998244353
ans = pow(2, a + b) % num
print(ans * 4 % num)


(w, h) = [int(x) for x in input().split()]
mod = 998244353

def mul(x, y, z):
	return x * y * z % mod
print(mul(2 ** (w - 1), 2 ** (h - 1), 4))


(w, h) = map(int, input().split())
ans = w + h
print(pow(2, ans) % 998244353)


(w, h) = map(int, input().split())
n = pow(2, w + h, 998244353)
print(n)


(a, b) = input().strip().split(' ')
(a, b) = [int(a), int(b)]
print(pow(2, a + b, 998244353))


from math import *
(w, h) = map(int, input().split())
x = 1
while w > 0:
	x = 2 * x % 998244353
	w = w - 1
while h > 0:
	x = 2 * x % 998244353
	h = h - 1
print(int(x))


inputs = input().split(' ')
h = int(inputs[0])
w = int(inputs[1])
ans = 4 * 2 ** (h - 1) * 2 ** (w - 1)
print(ans % 998244353)


import sys
from math import ceil
fast_reader = sys.stdin.readline
fast_writer = sys.stdout.write

def input():
	return fast_reader().strip()

def list_input():
	return list(map(int, input().split()))

def sep_input():
	return map(int, input().split())
mod = 998244353
(h, w) = sep_input()
a = (h + w) % mod
ans = 1
for i in range(a):
	ans = ans * 2 % mod
print(ans)


int_inp = lambda : int(input())
strng = lambda : input().strip()
strl = lambda : list(input().strip())
mul = lambda : map(int, input().split())
mulf = lambda : map(float, input().split())
seq = lambda : list(map(int, input().split()))
import math
from collections import Counter, defaultdict
(a, b) = mul()
print(4 * 2 ** (a + b - 2) % 998244353)


import collections, heapq, itertools, math
groupby = itertools.groupby
rs = lambda : input()
ri = lambda : int(input())
rm = lambda : map(int, input().split())
rai = lambda : [int(x) for x in input().split()]
MOD = 998244353

def solve(a, b):
	return 2 ** (a + b) % MOD

def main():
	(a, b) = rm()
	print(solve(a, b))
main()


import math
from itertools import *
from collections import *
from bisect import *
MOD = 998244353
(w, h) = map(int, input().split())
tot = w + h
ans = 4 * pow(2, tot - 2, MOD)
ans %= MOD
print(ans)


(n, m) = map(int, input().split())
ans = 0
MOD = 998244353
ans += pow(2, n, MOD)
ans *= pow(2, m, MOD)
print(ans % MOD)


from sys import stdin, stdout

def INI():
	return int(stdin.readline())

def INL():
	return [int(_) for _ in stdin.readline().split()]

def INS():
	return stdin.readline()

def OPS(ans):
	stdout.write(str(ans) + '\n')

def OPL(ans):
	[stdout.write(str(_) + ' ') for _ in ans]
	stdout.write('\n')
(w, h) = sorted(INL())
OPS(2 ** (h + w) % 998244353)


import sys, os
from io import BytesIO, IOBase
import collections, itertools, bisect, heapq, math, string
from decimal import *
BUFSIZE = 8192
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def main():
	(w, h) = map(int, input().split())
	mod = 998244353
	ans = 1
	print(2 ** (w + h) % mod)
main()


def main():
	(h, w) = [int(elem) for elem in input().split()]
	print(2 ** (w + h) % 998244353)
main()


(a, b) = map(int, input().split())
c = a + b
print(2 ** c % 998244353)


M = 998244353
(w, h) = map(int, input().split())
print(pow(2, w + h, M))


(n, m) = map(int, input().split())
x = 2 ** (n + m)
x = x % 998244353
print(x)


import math
(x, y) = map(int, input().split())
p = 1
for i in range(0, x + y):
	p = p % 998244353 * (2 % 998244353) % 998244353
print(p)


(w, h) = map(int, input().split())
ans = 2 ** (w + h - 1)
print(ans * 2 % 998244353)


(w, h) = map(int, input().split())
ans = 4
for i in range(w + h - 2):
	ans *= 2
	ans %= 998244353
print(ans)


M = 998244353
(w, h) = map(int, input().split())
a = 4 * pow(2, w - 1, M) * pow(2, h - 1, M)
print(a % M)


inp = list(map(int, input().split()))
(w, h) = (inp[0], inp[1])
if w == 1 and h == 1:
	print(4)
else:
	kq = 1
	for i in range(w + h):
		kq = int(kq * 2 % 998244353)
	print(kq)


l = list(map(int, input().split()))
m = l[0] + l[1]
n = 2 ** m
print(n % 998244353)


(h, w) = [int(ele) for ele in input().split(' ')]
MODULO = 998244353
print(2 ** (h + w) % MODULO)


import math
(x, y) = (int(i) for i in input().split())
mod = 998244353
res = 4 * 2 ** (x - 1) * 2 ** (y - 1)
print(res % mod)


(w, h) = map(int, input().split())
pw = w + h
res = 2 ** pw
res = res % 998244353
print(res)


arr = input().split(' ')
(w, h) = (int(arr[0]), int(arr[1]))
MOD = 998244353
print(pow(2, w + h, MOD))


(w, h) = list(map(int, input().split()))
ways = 4 * 2 ** (w - 1)
print(ways * 2 ** (h - 1) % 998244353)


import sys
input = lambda : sys.stdin.readline().strip()
(n, m) = map(int, input().split())
print(pow(2, n + m, 998244353))


def modExp(a, p):
	m = 998244353
	ans = 1
	while p > 0:
		if p % 2:
			ans = ans * a % m
		p //= 2
		a = a * a % m
	return ans
(a, b) = list(map(int, input().split()))
print(modExp(2, a + b))


(n, k) = map(int, input().split())
print(2 ** (n + k) % 998244353)


import math
for _ in range(1):
	(w, h) = map(int, input().split())
	print(pow(2, w + h, 998244353))


import io, sys, atexit, os
import math as ma
from sys import exit
from decimal import Decimal as dec
from itertools import permutations
from itertools import combinations

def li():
	return list(map(int, input().split()))

def num():
	return map(int, input().split())

def nu():
	return int(input())

def find_gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def lcm(x, y):
	gg = find_gcd(x, y)
	return x * y // gg
mm = 1000000007
mm1 = 998244353
yp = 0

def solve():
	t = 1
	for tt in range(t):
		(n, m) = num()
		print(pow(2, n + m, mm1))
solve()


def binpow(a, p, Mod=998244353):
	if p == 1:
		return a
	if p % 2 == 0:
		x = binpow(a, p / 2)
		return x * x % Mod
	else:
		return binpow(a, p - 1) * a % Mod
(w, h) = [int(i) for i in input().split()]
print(binpow(2, w + h))


X = list(map(int, input().split()))
if X[0] == X[1] == 1:
	print(4)
	exit()
if X[0] == 1:
	print(4 * 2 ** (X[1] - 1) % 998244353)
	exit()
print(4 * 2 ** (X[0] - 2) * 2 ** X[1] % 998244353)


(n, m) = map(int, input().split())
mod = 998244353
(n, m) = (min(n, m) % 998244353, (max(n, m) - min(n, m)) % 998244353)
print(pow(4, n) * pow(2, m) % 998244353)


(W, H) = list(map(int, input().split()))
Arr = [[0] * W] * H
MOD = 998244353
Prod = 4
for i in range(1, H):
	Prod = Prod * 2 % MOD
for i in range(1, W):
	Prod = Prod * 2 % MOD
print(Prod)


import math

def check(n, d):
	return n * n + 2 * n + 1 >= 4 * d

def num(x, y):
	const_prime = 998244353
	s = x + y - 2
	n = 4 * 2 ** s
	n = n % const_prime
	print(n)
(x, y) = map(int, input().split())
num(x, y)


(a, b) = map(int, input().split())
ans = 1
for i in range(a + b):
	ans *= 2
	ans %= 998244353
print(ans)


(h, m) = list(map(int, input().split()))
k = h + m
p = 1
a = 2
while k > 0:
	if k % 2:
		p *= a
		k -= 1
	else:
		a *= a
		k /= 2
print(p % 998244353)


(n, m) = input().split()
n = int(n)
m = int(m)
print(4 * pow(2, n + m - 2, 998244353) % 998244353)


import sys
inf = float('inf')
(mod, MOD) = (1000000007, 998244353)
from bisect import bisect_left, bisect_right

def get_array():
	return list(map(int, sys.stdin.readline().strip().split()))

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def input():
	return sys.stdin.readline().strip()
mat = [[0 for i in range(1005)] for j in range(1005)]
mat[1][1] = 4
for i in range(2, 1005):
	mat[1][i] = mat[1][i - 1] * 2 % MOD
for i in range(2, 1005):
	mat[i][1] = mat[i - 1][1] * 2 % MOD
for i in range(2, 1005):
	for j in range(2, 1005):
		mat[i][j] = (mat[i - 1][j] + mat[i][j - 1]) % MOD
(r, c) = get_ints()
print(mat[r][c])


(n, m) = map(int, input().split())
print((1 << m) * (1 << n - 1) * 2 % 998244353)


import math
import sys
from collections import Counter

def getdict(n):
	d = {}
	if type(n) is list:
		for i in n:
			if i in d:
				d[i] += 1
			else:
				d[i] = 1
	else:
		for i in range(n):
			t = ii()
			if t in d:
				d[t] += 1
			else:
				d[t] = 1
	return d

def cdiv(n, k):
	return n // k + (n % k != 0)

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return list(map(int, input().split()))
(n, k) = mi()
print(4 * 2 ** (k - 1) * 2 ** (n - 1) % 998244353)


from fractions import gcd
import math
mod = 998244353

def inverse(a):
	return pow(a, mod - 2, mod)

def usearch(x, a):
	lft = 0
	rgt = len(a) + 1
	while rgt - lft > 1:
		mid = (rgt + lft) // 2
		if a[mid] <= x:
			lft = mid
		else:
			rgt = mid
	return lft

def main():
	(w, h) = map(int, input().split())
	print(4 * pow(2, w - 1, mod) % mod * pow(2, h - 1, mod) % mod)
main()


(h, w) = [int(x) for x in input().split()]
print(pow(2, h + w, 998244353))


def plitki(w, h):
	mod = 998244353
	result = 1
	while w > 0:
		result = 2 * result % mod
		w -= 1
	while h > 0:
		result = 2 * result % mod
		h -= 1
	return result
(W, H) = [int(i) for i in input().split()]
print(plitki(W, H))


import sys
z = [int(x) for x in sys.stdin.readline().split()]
x = z[0]
y = z[1]
print(4 * pow(2, x - 1) * pow(2, y - 1) % 998244353)


def user99():
	(n, m) = map(int, input().split())
	print(pow(2, n + m, 998244353))
user99()


(n, m) = map(int, input().split())
mod = 998244353
print(2 ** n * 2 ** m % mod)


(a, b) = map(int, input().split())
d = 1
for i in range(0, a + b):
	d *= 2
print(d % 998244353)


def Input():
	tem = input().split()
	ans = []
	for it in tem:
		ans.append(int(it))
	return ans
mod = 998244353
(m, n) = Input()
dp = [[0] * m for i in range(n)]
dp[0][0] = 4
for i in range(1, m):
	dp[0][i] = 2 * dp[0][i - 1]
for i in range(1, n):
	dp[i][0] = 2 * dp[i - 1][0]
	for j in range(1, m):
		dp[i][j] = dp[i - 1][j] + dp[i][j - 1]
print(dp[n - 1][m - 1] % mod)


import math
from collections import deque, defaultdict
from sys import stdin, stdout
input = stdin.readline
listin = lambda : list(map(int, input().split()))
mapin = lambda : map(int, input().split())
(n, m) = mapin()
print(pow(2, m + n, 998244353))


(w, h) = list(map(int, input().split()))
res = 1
mod = 998244353
for _ in range(w + h):
	res = 2 * res % mod
print(res)


(n, m) = [int(i) for i in input().split()]
print(4 * pow(2, n - 1, 998244353) * pow(2, m - 1, 998244353) % 998244353)


(w, h) = map(int, input().split())
d = [[0] * (w + 1) for i in range(h + 1)]
d[1][1] = 4
mod = 998244353
for i in range(2, w + 1):
	d[1][i] = 2 * d[1][i - 1] % mod
for i in range(2, h + 1):
	d[i][1] = 2 * d[i - 1][1] % mod
for i in range(2, h + 1):
	for j in range(2, w + 1):
		d[i][j] = (d[i - 1][j] + d[i][j - 1]) % mod
print(d[h][w])


(h, w) = map(int, input().split())
mod = 998244353
if h > w:
	(h, w) = (w, h)
if h == w == 2:
	print(16)
elif h == w == 1:
	print(4)
elif h == 1:
	ans = 4
	for i in range(w - 1):
		ans *= 2
		ans %= mod
	print(ans)
else:
	ans = 16
	for i in range(h - 2):
		ans *= 2
		ans %= mod
	for i in range(w - 2):
		ans *= 2
		ans %= mod
	print(ans)


(w, h) = map(int, input().split())
m = 998244353
z1 = pow(2, w - 1, m)
z2 = pow(2, h - 1, m)
print(4 * z1 * z2 % m)


p = list(map(int, input().split()))
w = p[0]
h = p[1]
res = 4 * pow(2, w - 1) * pow(2, h - 1)
print(res % 998244353)


def pow1(x, base):
	if base == 0:
		return 1
	sq = pow1(x, base // 2)
	sq = sq * sq % mod
	if base % 2:
		sq *= x
	return sq
(w, h) = map(int, input().split())
mod = 998244353
print(pow1(2, w + h) % mod)


(w, h) = map(int, input().split())
print(pow(2, 2 + (w - 1) + (h - 1), 998244353))


import sys
(w, h) = list(map(int, sys.stdin.readline().strip().split()))
p = 998244353
b = w + h
a = 2
ans = 1
while b > 0:
	if b % 2 == 1:
		b = b - 1
		ans = ans * a % p
	else:
		b = b // 2
		a = a * a % p
print(ans)


(w, h) = map(int, input().split())
a = 2 ** w % 998244353
b = 2 ** h % 998244353
print(a * b % 998244353)


(n, m) = [int(s) for s in input().split()]
print(pow(2, n + m) % 998244353)


(a, b) = map(int, input().split())
print((1 << a + b) % 998244353)


M = 998244353
print(2 * pow(2, sum(map(int, input().split())) - 1, M) % M)


import sys
inf = sys.stdin
lines = inf.readlines()
(w, h) = (int(val) for val in lines[0].split())
print(2 ** (w + h) % 998244353)


valor = input()
listaV = valor.split()
w = int(listaV[0]) - 1
h = int(listaV[1]) - 1
valor = 2 ** w * 2 ** h * 4 % 998244353
print(valor)


MOD = 998244353
(w, h) = [int(x) for x in input().split()]
ans = 4
for _ in range(w + h - 2):
	ans *= 2
	ans %= MOD
print(ans)


ll = lambda : list(map(int, input().split()))
testcases = 1
for testcase in range(testcases):
	[w, h] = ll()
	mod = 998244353
	ans = pow(2, w + h, mod)
	print(ans)


n = sum(list(map(int, input().split())))
ans = pow(2, n) % 998244353
print(ans)


m = 998244353
(x, y) = map(int, input().split())
print(pow(2, x + y, m))


data = input()
data = data.split(' ')
data_min = min(int(data[1]), int(data[0]))
data_max = max(int(data[1]), int(data[0]))
print(pow(4, data_min) * pow(2, data_max - data_min) % 998244353)


(w, h) = map(int, input().split())
a = 2 ** (w - 1) % 998244353
b = 2 ** (h - 1) % 998244353
print(4 * a * b % 998244353)


import math
mi = lambda : map(int, input().split())
print(pow(2, sum(mi()), 998244353))


mod = 998244353
(x, y) = map(int, input().split())
if x == 1 and y == 1:
	print(4)
else:
	print(pow(2, x + y - 2) % mod * 4 % mod)


def solve():
	from sys import stdin
	line = stdin.readline
	(a, b) = map(int, line().split())
	print(pow(2, a + b, 998244353))
solve()


line = input()
tmp = line.split(' ')
(n, m) = (int(tmp[0]), int(tmp[1]))

def p(x):
	ret = 1
	for i in range(x):
		ret = ret * 2 % 998244353
	return ret
print(p(n) * p(m) % 998244353)


m = {1: 2, 2: 4, 3: 8, 4: 16, 5: 32, 6: 64, 7: 128, 8: 256, 9: 512, 10: 1024, 11: 2048, 12: 4096, 13: 8192, 14: 16384, 15: 32768, 16: 65536, 17: 131072, 18: 262144, 19: 524288, 20: 1048576, 21: 2097152, 22: 4194304, 23: 8388608, 24: 16777216, 25: 33554432, 26: 67108864, 27: 134217728, 28: 268435456, 29: 536870912, 30: 75497471, 31: 150994942, 32: 301989884, 33: 603979768, 34: 209715183, 35: 419430366, 36: 838860732, 37: 679477111, 38: 360709869, 39: 721419738, 40: 444595123, 41: 889190246, 42: 780136139, 43: 562027925, 44: 125811497, 45: 251622994, 46: 503245988, 47: 8247623, 48: 16495246, 49: 32990492, 50: 65980984, 51: 131961968, 52: 263923936, 53: 527847872, 54: 57451391, 55: 114902782, 56: 229805564, 57: 459611128, 58: 919222256, 59: 840200159, 60: 682155965, 61: 366067577, 62: 732135154, 63: 466025955, 64: 932051910, 65: 865859467, 66: 733474581, 67: 468704809, 68: 937409618, 69: 876574883, 70: 754905413, 71: 511566473, 72: 24888593, 73: 49777186, 74: 99554372, 75: 199108744, 76: 398217488, 77: 796434976, 78: 594625599, 79: 191006845, 80: 382013690, 81: 764027380, 82: 529810407, 83: 61376461, 84: 122752922, 85: 245505844, 86: 491011688, 87: 982023376, 88: 965802399, 89: 933360445, 90: 868476537, 91: 738708721, 92: 479173089, 93: 958346178, 94: 918448003, 95: 838651653, 96: 679058953, 97: 359873553, 98: 719747106, 99: 441249859, 100: 882499718, 101: 766755083, 102: 535265813, 103: 72287273, 104: 144574546, 105: 289149092, 106: 578298184, 107: 158352015, 108: 316704030, 109: 633408060, 110: 268571767, 111: 537143534, 112: 76042715, 113: 152085430, 114: 304170860, 115: 608341720, 116: 218439087, 117: 436878174, 118: 873756348, 119: 749268343, 120: 500292333, 121: 2340313, 122: 4680626, 123: 9361252, 124: 18722504, 125: 37445008, 126: 74890016, 127: 149780032, 128: 299560064, 129: 599120128, 130: 199995903, 131: 399991806, 132: 799983612, 133: 601722871, 134: 205201389, 135: 410402778, 136: 820805556, 137: 643366759, 138: 288489165, 139: 576978330, 140: 155712307, 141: 311424614, 142: 622849228, 143: 247454103, 144: 494908206, 145: 989816412, 146: 981388471, 147: 964532589, 148: 930820825, 149: 863397297, 150: 728550241, 151: 458856129, 152: 917712258, 153: 837180163, 154: 676115973, 155: 353987593, 156: 707975186, 157: 417706019, 158: 835412038, 159: 672579723, 160: 346915093, 161: 693830186, 162: 389416019, 163: 778832038, 164: 559419723, 165: 120595093, 166: 241190186, 167: 482380372, 168: 964760744, 169: 931277135, 170: 864309917, 171: 730375481, 172: 462506609, 173: 925013218, 174: 851782083, 175: 705319813, 176: 412395273, 177: 824790546, 178: 651336739, 179: 304429125, 180: 608858250, 181: 219472147, 182: 438944294, 183: 877888588, 184: 757532823, 185: 516821293, 186: 35398233, 187: 70796466, 188: 141592932, 189: 283185864, 190: 566371728, 191: 134499103, 192: 268998206, 193: 537996412, 194: 77748471, 195: 155496942, 196: 310993884, 197: 621987768, 198: 245731183, 199: 491462366, 200: 982924732, 201: 967605111, 202: 936965869, 203: 875687385, 204: 753130417, 205: 508016481, 206: 17788609, 207: 35577218, 208: 71154436, 209: 142308872, 210: 284617744, 211: 569235488, 212: 140226623, 213: 280453246, 214: 560906492, 215: 123568631, 216: 247137262, 217: 494274524, 218: 988549048, 219: 978853743, 220: 959463133, 221: 920681913, 222: 843119473, 223: 687994593, 224: 377744833, 225: 755489666, 226: 512734979, 227: 27225605, 228: 54451210, 229: 108902420, 230: 217804840, 231: 435609680, 232: 871219360, 233: 744194367, 234: 490144381, 235: 980288762, 236: 962333171, 237: 926421989, 238: 854599625, 239: 710954897, 240: 423665441, 241: 847330882, 242: 696417411, 243: 394590469, 244: 789180938, 245: 580117523, 246: 161990693, 247: 323981386, 248: 647962772, 249: 297681191, 250: 595362382, 251: 192480411, 252: 384960822, 253: 769921644, 254: 541598935, 255: 84953517, 256: 169907034, 257: 339814068, 258: 679628136, 259: 361011919, 260: 722023838, 261: 445803323, 262: 891606646, 263: 784968939, 264: 571693525, 265: 145142697, 266: 290285394, 267: 580570788, 268: 162897223, 269: 325794446, 270: 651588892, 271: 304933431, 272: 609866862, 273: 221489371, 274: 442978742, 275: 885957484, 276: 773670615, 277: 549096877, 278: 99949401, 279: 199898802, 280: 399797604, 281: 799595208, 282: 600946063, 283: 203647773, 284: 407295546, 285: 814591092, 286: 630937831, 287: 263631309, 288: 527262618, 289: 56280883, 290: 112561766, 291: 225123532, 292: 450247064, 293: 900494128, 294: 802743903, 295: 607243453, 296: 216242553, 297: 432485106, 298: 864970212, 299: 731696071, 300: 465147789, 301: 930295578, 302: 862346803, 303: 726449253, 304: 454654153, 305: 909308306, 306: 820372259, 307: 642500165, 308: 286755977, 309: 573511954, 310: 148779555, 311: 297559110, 312: 595118220, 313: 191992087, 314: 383984174, 315: 767968348, 316: 537692343, 317: 77140333, 318: 154280666, 319: 308561332, 320: 617122664, 321: 236000975, 322: 472001950, 323: 944003900, 324: 889763447, 325: 781282541, 326: 564320729, 327: 130397105, 328: 260794210, 329: 521588420, 330: 44932487, 331: 89864974, 332: 179729948, 333: 359459896, 334: 718919792, 335: 439595231, 336: 879190462, 337: 760136571, 338: 522028789, 339: 45813225, 340: 91626450, 341: 183252900, 342: 366505800, 343: 733011600, 344: 467778847, 345: 935557694, 346: 872871035, 347: 747497717, 348: 496751081, 349: 993502162, 350: 988759971, 351: 979275589, 352: 960306825, 353: 922369297, 354: 846494241, 355: 694744129, 356: 391243905, 357: 782487810, 358: 566731267, 359: 135218181, 360: 270436362, 361: 540872724, 362: 83501095, 363: 167002190, 364: 334004380, 365: 668008760, 366: 337773167, 367: 675546334, 368: 352848315, 369: 705696630, 370: 413148907, 371: 826297814, 372: 654351275, 373: 310458197, 374: 620916394, 375: 243588435, 376: 487176870, 377: 974353740, 378: 950463127, 379: 902681901, 380: 807119449, 381: 615994545, 382: 233744737, 383: 467489474, 384: 934978948, 385: 871713543, 386: 745182733, 387: 492121113, 388: 984242226, 389: 970240099, 390: 942235845, 391: 886227337, 392: 774210321, 393: 550176289, 394: 102108225, 395: 204216450, 396: 408432900, 397: 816865800, 398: 635487247, 399: 272730141, 400: 545460282, 401: 92676211, 402: 185352422, 403: 370704844, 404: 741409688, 405: 484575023, 406: 969150046, 407: 940055739, 408: 881867125, 409: 765489897, 410: 532735441, 411: 67226529, 412: 134453058, 413: 268906116, 414: 537812232, 415: 77380111, 416: 154760222, 417: 309520444, 418: 619040888, 419: 239837423, 420: 479674846, 421: 959349692, 422: 920455031, 423: 842665709, 424: 687087065, 425: 375929777, 426: 751859554, 427: 505474755, 428: 12705157, 429: 25410314, 430: 50820628, 431: 101641256, 432: 203282512, 433: 406565024, 434: 813130048, 435: 628015743, 436: 257787133, 437: 515574266, 438: 32904179, 439: 65808358, 440: 131616716, 441: 263233432, 442: 526466864, 443: 54689375, 444: 109378750, 445: 218757500, 446: 437515000, 447: 875030000, 448: 751815647, 449: 505386941, 450: 12529529, 451: 25059058, 452: 50118116, 453: 100236232, 454: 200472464, 455: 400944928, 456: 801889856, 457: 605535359, 458: 212826365, 459: 425652730, 460: 851305460, 461: 704366567, 462: 410488781, 463: 820977562, 464: 643710771, 465: 289177189, 466: 578354378, 467: 158464403, 468: 316928806, 469: 633857612, 470: 269470871, 471: 538941742, 472: 79639131, 473: 159278262, 474: 318556524, 475: 637113048, 476: 275981743, 477: 551963486, 478: 105682619, 479: 211365238, 480: 422730476, 481: 845460952, 482: 692677551, 483: 387110749, 484: 774221498, 485: 550198643, 486: 102152933, 487: 204305866, 488: 408611732, 489: 817223464, 490: 636202575, 491: 274160797, 492: 548321594, 493: 98398835, 494: 196797670, 495: 393595340, 496: 787190680, 497: 576137007, 498: 154029661, 499: 308059322, 500: 616118644, 501: 233992935, 502: 467985870, 503: 935971740, 504: 873699127, 505: 749153901, 506: 500063449, 507: 1882545, 508: 3765090, 509: 7530180, 510: 15060360, 511: 30120720, 512: 60241440, 513: 120482880, 514: 240965760, 515: 481931520, 516: 963863040, 517: 929481727, 518: 860719101, 519: 723193849, 520: 448143345, 521: 896286690, 522: 794329027, 523: 590413701, 524: 182583049, 525: 365166098, 526: 730332196, 527: 462420039, 528: 924840078, 529: 851435803, 530: 704627253, 531: 411010153, 532: 822020306, 533: 645796259, 534: 293348165, 535: 586696330, 536: 175148307, 537: 350296614, 538: 700593228, 539: 402942103, 540: 805884206, 541: 613524059, 542: 228803765, 543: 457607530, 544: 915215060, 545: 832185767, 546: 666127181, 547: 334010009, 548: 668020018, 549: 337795683, 550: 675591366, 551: 352938379, 552: 705876758, 553: 413509163, 554: 827018326, 555: 655792299, 556: 313340245, 557: 626680490, 558: 255116627, 559: 510233254, 560: 22222155, 561: 44444310, 562: 88888620, 563: 177777240, 564: 355554480, 565: 711108960, 566: 423973567, 567: 847947134, 568: 697649915, 569: 397055477, 570: 794110954, 571: 589977555, 572: 181710757, 573: 363421514, 574: 726843028, 575: 455441703, 576: 910883406, 577: 823522459, 578: 648800565, 579: 299356777, 580: 598713554, 581: 199182755, 582: 398365510, 583: 796731020, 584: 595217687, 585: 192191021, 586: 384382042, 587: 768764084, 588: 539283815, 589: 80323277, 590: 160646554, 591: 321293108, 592: 642586216, 593: 286928079, 594: 573856158, 595: 149467963, 596: 298935926, 597: 597871852, 598: 197499351, 599: 394998702, 600: 789997404, 601: 581750455, 602: 165256557, 603: 330513114, 604: 661026228, 605: 323808103, 606: 647616206, 607: 296988059, 608: 593976118, 609: 189707883, 610: 379415766, 611: 758831532, 612: 519418711, 613: 40593069, 614: 81186138, 615: 162372276, 616: 324744552, 617: 649489104, 618: 300733855, 619: 601467710, 620: 204691067, 621: 409382134, 622: 818764268, 623: 639284183, 624: 280324013, 625: 560648026, 626: 123051699, 627: 246103398, 628: 492206796, 629: 984413592, 630: 970582831, 631: 942921309, 632: 887598265, 633: 776952177, 634: 555660001, 635: 113075649, 636: 226151298, 637: 452302596, 638: 904605192, 639: 810966031, 640: 623687709, 641: 249131065, 642: 498262130, 643: 996524260, 644: 994804167, 645: 991363981, 646: 984483609, 647: 970722865, 648: 943201377, 649: 888158401, 650: 778072449, 651: 557900545, 652: 117556737, 653: 235113474, 654: 470226948, 655: 940453896, 656: 882663439, 657: 767082525, 658: 535920697, 659: 73597041, 660: 147194082, 661: 294388164, 662: 588776328, 663: 179308303, 664: 358616606, 665: 717233212, 666: 436222071, 667: 872444142, 668: 746643931, 669: 495043509, 670: 990087018, 671: 981929683, 672: 965615013, 673: 932985673, 674: 867726993, 675: 737209633, 676: 476174913, 677: 952349826, 678: 906455299, 679: 814666245, 680: 631088137, 681: 263931921, 682: 527863842, 683: 57483331, 684: 114966662, 685: 229933324, 686: 459866648, 687: 919733296, 688: 841222239, 689: 684200125, 690: 370155897, 691: 740311794, 692: 482379235, 693: 964758470, 694: 931272587, 695: 864300821, 696: 730357289, 697: 462470225, 698: 924940450, 699: 851636547, 700: 705028741, 701: 411813129, 702: 823626258, 703: 649008163, 704: 299771973, 705: 599543946, 706: 200843539, 707: 401687078, 708: 803374156, 709: 608503959, 710: 218763565, 711: 437527130, 712: 875054260, 713: 751864167, 714: 505483981, 715: 12723609, 716: 25447218, 717: 50894436, 718: 101788872, 719: 203577744, 720: 407155488, 721: 814310976, 722: 630377599, 723: 262510845, 724: 525021690, 725: 51799027, 726: 103598054, 727: 207196108, 728: 414392216, 729: 828784432, 730: 659324511, 731: 320404669, 732: 640809338, 733: 283374323, 734: 566748646, 735: 135252939, 736: 270505878, 737: 541011756, 738: 83779159, 739: 167558318, 740: 335116636, 741: 670233272, 742: 342222191, 743: 684444382, 744: 370644411, 745: 741288822, 746: 484333291, 747: 968666582, 748: 939088811, 749: 879933269, 750: 761622185, 751: 525000017, 752: 51755681, 753: 103511362, 754: 207022724, 755: 414045448, 756: 828090896, 757: 657937439, 758: 317630525, 759: 635261050, 760: 272277747, 761: 544555494, 762: 90866635, 763: 181733270, 764: 363466540, 765: 726933080, 766: 455621807, 767: 911243614, 768: 824242875, 769: 650241397, 770: 302238441, 771: 604476882, 772: 210709411, 773: 421418822, 774: 842837644, 775: 687430935, 776: 376617517, 777: 753235034, 778: 508225715, 779: 18207077, 780: 36414154, 781: 72828308, 782: 145656616, 783: 291313232, 784: 582626464, 785: 167008575, 786: 334017150, 787: 668034300, 788: 337824247, 789: 675648494, 790: 353052635, 791: 706105270, 792: 413966187, 793: 827932374, 794: 657620395, 795: 316996437, 796: 633992874, 797: 269741395, 798: 539482790, 799: 80721227, 800: 161442454, 801: 322884908, 802: 645769816, 803: 293295279, 804: 586590558, 805: 174936763, 806: 349873526, 807: 699747052, 808: 401249751, 809: 802499502, 810: 606754651, 811: 215264949, 812: 430529898, 813: 861059796, 814: 723875239, 815: 449506125, 816: 899012250, 817: 799780147, 818: 601315941, 819: 204387529, 820: 408775058, 821: 817550116, 822: 636855879, 823: 275467405, 824: 550934810, 825: 103625267, 826: 207250534, 827: 414501068, 828: 829002136, 829: 659759919, 830: 321275485, 831: 642550970, 832: 286857587, 833: 573715174, 834: 149185995, 835: 298371990, 836: 596743980, 837: 195243607, 838: 390487214, 839: 780974428, 840: 563704503, 841: 129164653, 842: 258329306, 843: 516658612, 844: 35072871, 845: 70145742, 846: 140291484, 847: 280582968, 848: 561165936, 849: 124087519, 850: 248175038, 851: 496350076, 852: 992700152, 853: 987155951, 854: 976067549, 855: 953890745, 856: 909537137, 857: 820829921, 858: 643415489, 859: 288586625, 860: 577173250, 861: 156102147, 862: 312204294, 863: 624408588, 864: 250572823, 865: 501145646, 866: 4046939, 867: 8093878, 868: 16187756, 869: 32375512, 870: 64751024, 871: 129502048, 872: 259004096, 873: 518008192, 874: 37772031, 875: 75544062, 876: 151088124, 877: 302176248, 878: 604352496, 879: 210460639, 880: 420921278, 881: 841842556, 882: 685440759, 883: 372637165, 884: 745274330, 885: 492304307, 886: 984608614, 887: 970972875, 888: 943701397, 889: 889158441, 890: 780072529, 891: 561900705, 892: 125557057, 893: 251114114, 894: 502228228, 895: 6212103, 896: 12424206, 897: 24848412, 898: 49696824, 899: 99393648, 900: 198787296, 901: 397574592, 902: 795149184, 903: 592054015, 904: 185863677, 905: 371727354, 906: 743454708, 907: 488665063, 908: 977330126, 909: 956415899, 910: 914587445, 911: 830930537, 912: 663616721, 913: 328989089, 914: 657978178, 915: 317712003, 916: 635424006, 917: 272603659, 918: 545207318, 919: 92170283, 920: 184340566, 921: 368681132, 922: 737362264, 923: 476480175, 924: 952960350, 925: 907676347, 926: 817108341, 927: 635972329, 928: 273700305, 929: 547400610, 930: 96556867, 931: 193113734, 932: 386227468, 933: 772454936, 934: 546665519, 935: 95086685, 936: 190173370, 937: 380346740, 938: 760693480, 939: 523142607, 940: 48040861, 941: 96081722, 942: 192163444, 943: 384326888, 944: 768653776, 945: 539063199, 946: 79882045, 947: 159764090, 948: 319528180, 949: 639056360, 950: 279868367, 951: 559736734, 952: 121229115, 953: 242458230, 954: 484916460, 955: 969832920, 956: 941421487, 957: 884598621, 958: 770952889, 959: 543661425, 960: 89078497, 961: 178156994, 962: 356313988, 963: 712627976, 964: 427011599, 965: 854023198, 966: 709802043, 967: 421359733, 968: 842719466, 969: 687194579, 970: 376144805, 971: 752289610, 972: 506334867, 973: 14425381, 974: 28850762, 975: 57701524, 976: 115403048, 977: 230806096, 978: 461612192, 979: 923224384, 980: 848204415, 981: 698164477, 982: 398084601, 983: 796169202, 984: 594094051, 985: 189943749, 986: 379887498, 987: 759774996, 988: 521305639, 989: 44366925, 990: 88733850, 991: 177467700, 992: 354935400, 993: 709870800, 994: 421497247, 995: 842994494, 996: 687744635, 997: 377244917, 998: 754489834, 999: 510735315, 1000: 23226277}
(a, b) = map(int, input().split())
print(m[a] * m[b] % 998244353)


from sys import stdin, stdout
import math
(a, b) = list(map(int, stdin.readline().split()))
M = 998244353
print(pow(2, a + b, M))


def c(a, b):
	return 2 ** a * 2 ** b % 998244353
(a, b) = input().strip().split()
print(c(int(a), int(b)))


import sys
input = sys.stdin.readline
(w, h) = map(int, input().split())

def exp_mod(base, exp, mod):
	if exp == 0:
		return 1
	elif exp == 1:
		return base
	elif exp % 2 == 0:
		return exp_mod(base, exp / 2, mod) % mod * (exp_mod(base, exp / 2, mod) % mod) % mod
	else:
		return base * exp_mod(base, exp - 1, mod) % mod
print(exp_mod(2, w + h, 998244353))


(k, m) = map(int, input().split())
print(2 ** (k + m) % 998244353)


(a, b) = list(map(int, input().split()))
print(4 * (2 ** (a - 1) * 2 ** (b - 1)) % 998244353)


(w, h) = map(int, input().split())
c = 998244353
x = 1
while w >= 1:
	x = x * 2 % c
	w -= 1
while h >= 1:
	x = x * 2 % c
	h -= 1
print(x)


mod = 998244353
(w, h) = list(map(int, input().split()))
temp = 4
temp = temp * pow(2, w - 1, mod)
temp = temp * pow(2, h - 1, mod)
print(temp % mod)


(w, h) = map(int, input().split())
mod = 998244353
ans1 = ans2 = 1
for i in range(w):
	ans1 *= 2
	ans1 %= mod
for i in range(h):
	ans2 *= 2
	ans2 %= mod
print(ans1 * ans2 % mod)


from sys import stdin
mod = 998244353
(n, m) = map(int, stdin.readline().strip().split())
ans = 4 * pow(2, n - 1 + m - 1, mod) % mod
print(ans)


from sys import stdin, stdout
(w, h) = map(int, stdin.readline().strip().split())
div = 998244353
ans = 1
for i in range(1, w + 1):
	ans = ans * 2 % div
for i in range(1, h + 1):
	ans = ans * 2 % div
print(ans % div)


(x, y) = map(int, input().split())
print(4 * 2 ** (x - 1) * 2 ** (y - 1) % 998244353)


MOD = 998244353
[w, h] = [int(item) for item in input().split(' ')]
ans = 4
for i in range(w + h - 2):
	ans = ans * 2 % MOD
print(ans)


m = 998244353
(n, k) = map(int, input().split())
a = n + k
ans = [2]
for i in range(2001):
	p = ans[-1] % m * 2 % m
	ans.append(p)
print(ans[a - 1])


(a, b) = map(int, input().split())
n = 998244353
p = a + b
wyn = 1
mno = 2
while p > 0:
	if p % 2 == 1:
		wyn = wyn * mno % n
	mno = mno ** 2 % n
	p //= 2
print(wyn)


ser = input().split()
series = [int(num) for num in ser]
sum1 = sum(series)
print(2 ** sum1 % 998244353)


import sys
import os
from io import BytesIO, IOBase

def ceil(n, k):
	return n // k + (n % k != 0)

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return list(map(int, input().split()))

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)

def prr(a, sep=' '):
	print(sep.join(map(str, a)))

def dd():
	return defaultdict(int)

def ddl():
	return defaultdict(list)

def ddd():
	return defaultdict(defaultdict(int))
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
from collections import defaultdict
mod = 998244353
for _ in range(1):
	(w, h) = mi()
	print(4 * pow(2, w - 1, mod) * pow(2, h - 1, mod) % mod)


(w, h) = input().split()
w = int(w)
h = int(h)
s = 2 ** (w + h)
print(s % 998244353)


MOD = 998244353
ans = 4
(w, h) = [int(item) for item in input().split()]
ans *= pow(2, w - 1, MOD)
ans *= pow(2, h - 1, MOD)
print(ans % MOD)


import sys
(a, b) = input().split()
(a, b) = [int(a), int(b)]
print(pow(2, a + b) % 998244353)


r = [int(x) for x in input().split()]
m = pow(2, r[0] + r[1], 998244353)
print(m)


import math
(w, h) = [int(x) for x in input().split(' ')]
t = w + h
ans = 1
for i in range(t):
	ans = ans * 2
	ans = ans % 998244353
print(ans)


import math
(w, h) = map(int, input().rstrip().split())
print(2 ** w % 998244353 * (2 ** h % 998244353) % 998244353)


from bisect import bisect_left as bl
from bisect import bisect_right as br
import heapq
import math
from collections import *
from functools import reduce, cmp_to_key
import sys
input = sys.stdin.readline
M = mod = 998244353

def factors(n):
	return sorted(set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0))))

def inv_mod(n):
	return pow(n, mod - 2, mod)

def li():
	return [int(i) for i in input().rstrip('\n').split()]

def st():
	return input().rstrip('\n')

def val():
	return int(input().rstrip('\n'))

def li2():
	return [i for i in input().rstrip('\n')]

def li3():
	return [int(i) for i in input().rstrip('\n')]
(w, h) = li()
print(2 ** (w + h) % mod)


(are, bre) = map(int, input().split())
nre = 998244353
pre = are + bre
sdskdhs = 1
dfjbdjfbd = 2
while pre > 0:
	if pre % 2 == 1:
		sdskdhs = sdskdhs * dfjbdjfbd % nre
	dfjbdjfbd = dfjbdjfbd ** 2 % nre
	pre //= 2
print(sdskdhs)


(w, h) = map(int, input().split())
ans = 1
for _ in range(w + h):
	ans = ans * 2 % 998244353
print(ans)


from sys import stdin
input = stdin.readline
(w, h) = map(int, input().split())
(h, w) = sorted([w, h])
ans = 1
mod = 998244353
for i in range(w):
	ans += 2 ** i
for i in range(h):
	ans += ans
print(ans % mod)


I = lambda : map(int, input().split())
(x, y) = I()
tt = 2
mod = 998244353
ans = 1
for i in range(x + y):
	ans = ans * 2
	ans = ans % mod
print(ans)


N = 998244353

def expn(bas, exp):
	t = 1
	while exp > 0:
		if exp % 2 != 0:
			t = t * bas % N
		bas = bas * bas % N
		exp = int(exp / 2)
	return t % N
(w, h) = map(int, input().split())
ans = w - 1 + (h - 1)
res = expn(2, ans)
print(res * 4 % N)


def main():
	import sys
	input = sys.stdin.readline
	MOD = 998244353
	(n, m) = map(int, input().split())
	(n, m) = (min(n, m), max(n, m) - min(n, m))
	print(pow(4, n, MOD) * pow(2, m, MOD) % MOD)
	return 0
main()


[w, h] = input().split(' ')
w = int(w)
h = int(h)
resW = 1
for i in range(w - 1):
	resW *= 2
	resW %= 998244353
resH = 1
for i in range(h - 1):
	resH *= 2
	resH %= 998244353
print(resW * resH * 4 % 998244353)


(h, w) = map(int, input().split())
res = h + w
print(pow(2, res, 998244353))


import sys

def main():
	(a, b) = [int(s) for s in sys.stdin.readline().strip().split()]
	print(2 ** (a + b) % 998244353)
main()


edges = sum([int(x) for x in input().split(' ')])
powerOf2 = 1
for i in range(edges):
	powerOf2 *= 2
	powerOf2 %= 998244353
print(powerOf2)


p = input().rstrip().split(' ')
print(2 ** (int(p[0]) + int(p[1])) % 998244353)


z = input().split(' ')
x = int(z[0])
y = int(z[1])
a = 1
for i in range(0, y + x):
	a = a * 2 % 998244353
print(a)


mod = 998244353

def quick_pow(a, b):
	res = 1
	while b > 0:
		if b & 1:
			res = res * a % mod
		a = a * a % mod
		b >>= 1
	return res
(n, m) = input().split()
n = int(n)
m = int(m)
print(quick_pow(2, n + m))


from sys import stdin, stdout
import collections
(W, H) = [int(x) for x in stdin.readline().split()]
A = 1
for i in range(W):
	A *= 2
	A = A % 998244353
B = 1
for i in range(H):
	B *= 2
	B = B % 998244353
res = A * B
res = res % 998244353
print(res)


(a, b) = map(int, input().split())
pro = 4
m = 998244353
x = pow(2, b - 1, m)
y = pow(2, a - 1, m)
print(x * y * pro % m)


import sys

def rl(proc=None):
	if proc is not None:
		return proc(sys.stdin.readline())
	else:
		return sys.stdin.readline().rstrip()

def srl(proc=None):
	if proc is not None:
		return list(map(proc, rl().split()))
	else:
		return rl().split()

def main():
	(w, h) = srl(int)
	print(pow(2, w + h, 998244353))
main()


import sys, math, queue, bisect
MOD = 998244353
sys.setrecursionlimit(1000000)
(w, h) = map(int, input().split())
print(pow(2, w + h, MOD))


def gns():
	return list(map(int, input().split()))
(w, h) = gns()
x = w + h
m = 998244353
li = [2]
for i in range(30):
	li.append(li[-1] * li[-1] % m)
ans = 1
for i in range(30):
	if x >> i & 1 == 1:
		ans *= li[i]
		ans = ans % m
print(ans)


strs = input().split(' ')
w = int(strs[0])
h = int(strs[1])
print(pow(2, w + h, 998244353))


(w, h) = map(int, input().split())
mod = 998244353
ans = 2 ** (w + h)
print(ans % mod)


mod = 998244353

def bigmod(a, p, m):
	res = 1 % m
	x = a % m
	while p > 0:
		if p % 2 == 1:
			res = res * x % m
		x = x * x % m
		p /= 2
	return res
(w, h) = map(int, input().split())
ans = 2 ** (w + h) % mod
print(ans)


(n, m) = [int(p) for p in input().split()]
mod = 998244353
print(2 ** (n + m) % mod)


k = input().split()
a = int(k[0])
b = int(k[1])
print(pow(2, a + b) % 998244353)


(n, m) = map(int, input().split())
mod = 998244353
dp = []
for i in range(n + 1):
	dp.append([0] * (m + 1))
dp[1][1] = 4
for i in range(2, n + 1):
	dp[i][1] = dp[i - 1][1] * 2 % mod
for i in range(2, m + 1):
	dp[1][i] = dp[1][i - 1] * 2 % mod
for i in range(2, n + 1):
	for j in range(2, m + 1):
		dp[i][j] = dp[i - 1][j - 1] * 2 * 2 % mod
print(dp[n][m] % mod)


MOD = 998244353
(r, c) = [int(i) for i in input().split(' ')]
x = 1
while r != 0:
	x = 2 * x % MOD
	r -= 1
while c != 0:
	x = 2 * x % MOD
	c -= 1
print(x)


print(str(pow(2, sum(list(map(int, input().split()))), 998244353)))


import math
(w, h) = map(int, input().split())
ans = int(1)
for i in range(h + w):
	ans = int(ans * 2)
	ans = int(ans % 998244353)
print(ans)


mod = 998244353
(n, m) = [int(i) for i in input().split()]
print(2 ** (n + m) % mod)


fst = list(map(int, input().split()))
print(pow(2, fst[0] + fst[1]) % 998244353)


mod = 998244353

def bigmod(a, p, m):
	if p == 0:
		return 1
	if p % 2:
		return a % m * bigmod(a, p - 1, m)
	else:
		c = bigmod(a, p / 2, m)
		return c % m * (c % m) % m
(w, h) = map(int, input().split())
ans = 4 * bigmod(2, h - 1, mod) * bigmod(2, w - 1, mod) % mod
print(ans)


from sys import stdin
from math import gcd, sqrt
from collections import deque
input = stdin.readline
R = lambda : map(int, input().split())
I = lambda : int(input())
S = lambda : input().rstrip('\n')
hg = lambda x, y: (y + x - 1) // x * x
(n, m) = R()
mod = 998244353
x = 1
while n:
	x = 2 * x % mod
	n -= 1
while m:
	x = 2 * x % mod
	m -= 1
print(x)


import sys
import math
from collections import defaultdict
(w, h) = map(int, input().split())
c = int(pow(2, w + h))
print(c % 998244353)


import sys
input = sys.stdin.readline
write = lambda x: sys.stdout.write(f'{x}\n')
MOD = 998244353
(w, h) = map(int, input().split())
print(4 * pow(2, w - 1, MOD) * pow(2, h - 1, MOD) % MOD)


print(pow(2, sum(map(int, input().split())), 998244353))


(m, n) = map(int, input().split())
ans = 2 ** (m + n)
ans = ans % 998244353
print(ans)


(w, h) = (int(i) for i in input().split())
g = 4
for i in range(1, w):
	g *= 2
	g = g % 998244353
for i in range(1, h):
	g *= 2
	g = g % 998244353
print(g)


(x, y) = [int(k) for k in input().split()]
out = 2 ** (x + y)
out = out % 998244353
print(out)


(m, n) = input().split()
print(2 ** (int(m) + int(n)) % 998244353)


t = list(map(int, input().split(' ')))
print(2 ** (t[0] + t[1]) % 998244353)


(w, h) = map(int, input().split())
l = w + h
res = 1
mod = 998244353
for i in range(l):
	res = res % mod * 2
print(res % mod)


(w, h) = map(int, input().split())
wh = w + h
res = 2 ** wh
res %= 998244353
print(res)


import math
wh = input().split()
w = int(wh[0])
h = int(wh[1])
r = pow(2, w + h, 998244353)
print(r)


(w, h) = map(int, input().split())
mod = 998244353
print(4 * 2 ** (w + h - 2) % mod)


import sys
import re
input = sys.stdin.readline
mod = 998244353
(w, h) = map(int, input().strip().split())
if w == h == 1:
	ans = 4
elif min(w, h) == 1:
	ans = 4 * 2 ** (max(w, h) - 1)
else:
	ans = 4 * 2 ** (w - 1) * 2 ** (h - 1)
print(ans % mod)


(a, b) = map(int, input().split())
MOD = 998244353

def iterative_power(a, b):
	result = 1
	while b > 0:
		result = result * a % MOD
		b -= 1
	return result % MOD
print(iterative_power(2, a + b))


mod = 998244353
(w, h) = list(map(int, input().split()))
ans = 4
for i in range(2, w + 1):
	ans *= 2
	ans %= mod
for i in range(2, h + 1):
	ans *= 2
	ans %= mod
print(ans)


s = input()
w = int(s.split(' ')[0])
h = int(s.split(' ')[1])
print(2 ** (w + h) % 998244353)


a = [int(s) for s in input().split()]
print(2 ** a[0] % 998244353 * (2 ** a[1] % 998244353) % 998244353)


(w, h) = input().split()
print(pow(2, int(w) + int(h)) % 998244353)


(w, h) = map(int, input().split())
if h == 1:
	l = 1
else:
	l = 2 ** (h - 1) % 998244353
if w == 1:
	r = 1
else:
	r = 2 ** (w - 1) % 998244353
print(4 * l * r % 998244353)


n = input().split()
ans = pow(2, int(n[0]) + int(n[1])) % 998244353
print(ans)


(n, m) = list(map(int, input().split()))
m -= 1
n -= 1
Ans = 2 ** (n + m) % 998244353
Ans = 4 * Ans
print(Ans % 998244353)


(a, b) = map(int, input().split())
c = a + b
res = 1
mod = 998244353
for i in range(c):
	res = res % mod * 2
print(res % mod)


(n, m) = map(int, input().rstrip().split(' '))
print(4 * 2 ** (n - 1) * 2 ** (m - 1) % 998244353)


from sys import stdin, stdout, exit
(w, h) = map(int, stdin.readline().split())
mod = 998244353
print(pow(2, w + h, mod))


from collections import defaultdict as dd
from collections import deque
import bisect
import heapq

def ri():
	return int(input())

def rl():
	return list(map(int, input().split()))

def solve():
	(w, h) = rl()
	print(pow(2, w + h, 998244353))
mode = 's'
if mode == 'T':
	t = ri()
	for i in range(t):
		solve()
else:
	solve()


def power(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res
(m, n) = map(int, input().split())
print(power(2, n + m, 998244353))


from bisect import *
from collections import *
from itertools import *
import functools
import sys
import math
from decimal import *
from copy import *
getcontext().prec = 30
MAX = sys.maxsize
MAXN = 10 ** 5 + 10
MOD = 10 ** 9 + 7

def isprime(n):
	n = abs(int(n))
	if n < 2:
		return False
	if n == 2:
		return True
	if not n & 1:
		return False
	for x in range(3, int(n ** 0.5) + 1, 2):
		if n % x == 0:
			return False
	return True

def mhd(a, b):
	return abs(a[0] - b[0]) + abs(b[1] - a[1])

def charIN(x=' '):
	return sys.stdin.readline().strip().split(x)

def arrIN(x=' '):
	return list(map(int, sys.stdin.readline().strip().split(x)))

def eld(x, y):
	a = y[0] - x[0]
	b = x[1] - y[1]
	return (a * a + b * b) ** 0.5

def lgcd(a):
	g = a[0]
	for i in range(1, len(a)):
		g = math.gcd(g, a[i])
	return g

def ms(a):
	msf = -MAX
	meh = 0
	st = en = be = 0
	for i in range(len(a)):
		meh += a[i]
		if msf < meh:
			msf = meh
			st = be
			en = i
		if meh < 0:
			meh = 0
			be = i + 1
	return (msf, st, en)

def ncr(n, r):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % MOD
		den = den * (i + 1) % MOD
	return num * pow(den, MOD - 2, MOD) % MOD

def flush():
	return sys.stdout.flush()
(w, h) = arrIN()
print(pow(2, w + h, 998244353))


l = list(map(int, input().split()))
print(2 ** (l[0] + l[1]) % 998244353)


(A, B) = map(int, input().split())
print(pow(2, A + B, 998244353))


(a1, b1) = map(int, input().split())
print(2 ** (a1 + b1) % 998244353)


(n, m) = map(int, input().split())
ans = pow(2, n + m - 2, 998244353)
ans = ans * 4
print(ans % 998244353)


(w, h) = map(int, input().split())
if w == 1 and h == 1:
	print(4)
elif w == 1 and h != 1:
	print(2 ** (h + 1) % 998244353)
elif w != 1 and h == 1:
	print(2 ** (w + 1) % 998244353)
else:
	x = 4 * 2 ** (w - 1) * (2 ** (h - 2) * 2)
	print(x % 998244353)


global m
m = 998244353

def pow(x, n):
	res = 1
	while n > 0:
		if n & 1:
			res = res * x % m
		x = x * x % m
		n >>= 1
	return res
(w, h) = map(int, input().split())
print(pow(2, w + h))


(w, h) = [int(s) for s in input().split()]
print(2 ** (w + h) % 998244353)


(w, h) = list(map(int, input().split()))
result = 0
result = pow(2, w + h) % 998244353
print(result)


(n, m) = map(int, input().split())
s = 4 * 2 ** (n - 1) * 2 ** (m - 1)
print(s % 998244353)


import sys
p = 998244353
for line in sys.stdin:
	(h, w) = [int(a) for a in line.split()]
	ans = 2 ** (h + w)
	print(ans % p)
	break


(w, h) = map(int, input().strip().split())
print(pow(2, w + h, 998244353))