import sys,random,bisect from collections import deque,defaultdict,Counter from heapq import heapify,heappop,heappush from itertools import cycle, permutations from math import log,gcd input = lambda :sys.stdin.readline().rstrip() mi = lambda :map(int,input().split()) li = lambda :list(mi()) spf = [i for i in range(10**5+1)] for p in range(2,10**5+1): if spf[p]==p: for n in range(p,10**5+1,p): spf[n] = p def peri(N,P): LCM = [0] * (N+1) visit = [False] * N for i in range(N): if visit[i]: continue n = 1 pos = P[i] visit[i] = True while pos!=i: visit[pos] = True n += 1 pos = P[pos] tmp = n while tmp!=1: p = spf[tmp] k = 0 while tmp%p==0: k += 1 tmp //= p LCM[p] = max(LCM[p],k) res = 1 for p in range(2,N+1): if spf[p]==p: res *= pow(p,LCM[p],998244353) res %= 998244353 return res mod = 998244353 N,p,q = mi() if p==1 and q==1: exit(print(1)) if p==1: p,q = q,p P = [i for i in range(N)] for i in range(p//2): P[i],P[p-1-i] = P[p-1-i],P[i] if q==1: exit(print(peri(N,P))) for i in range(q//2): P[-i-1],P[-(q-1-i)-1] = P[-(q-1-i)-1],P[-i-1] print((peri(N,P)*2) % 998244353)