Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

s=input()
t=input()

if len(s) < len(t):
  print("UNRESTORABLE")
  exit()

c=len(s)-len(t)

flg=False
while True:
  if c<0:
    break
  
  flg2=True
  for i in range(len(t)):
    if s[c+i]!=t[i] and s[c+i]!="?":
      flg2=False
  if flg2:
    flg=True
    break
# c-=1
#print(c)



if flg:
  print((s[:c]+t+s[c+len(t):]).replace("?","a"))
else:
  print("UNRESTORABLE")


### FIXED CODE ###

s=input()
t=input()

if len(s) < len(t):
  print("UNRESTORABLE")
  exit()

c=len(s)-len(t)

flg=False
while True:
  if c<0:
    break
  
  flg2=True
  for i in range(len(t)):
    if s[c+i]!=t[i] and s[c+i]!="?":
      flg2=False
  if flg2:
    flg=True
    break
  c-=1
#print(c)



if flg:
  print((s[:c]+t+s[c+len(t):]).replace("?","a"))
else:
  print("UNRESTORABLE")
### BUGGY CODE ###

n, y=map(int, input().split())
a=y//10000
b=y//5000
c=y//1000

for i in range(c+1):
    for j in range(b+1):
        k=n-i-j
        if 0<=k<=a and 1000*i + 5000*j + 10000*k == y:
            print(k, j, i)
            exit()

print(-1, -1, -1)

### FIXED CODE ###

n, y=map(int, input().split())
a=y//10000
b=y//5000
c=y//1000

for i in range(a+1):
    for j in range(b+1):
        k=n-i-j
        if 0<=k<=c and 10000*i + 5000*j + 1000*k == y:
            print(i ,j ,k)
            exit()

print(-1, -1, -1)
### BUGGY CODE ###

temp = input().split(" ")
X = int(temp[0])
Y = int(temp[1])
i = 2
while True:
    tgt = X * i
    if X == Y:
        print(-1)
        break
    elif tgt % Y != 0:
        print(tgt)
        break
    else:
        i += 1

### FIXED CODE ###

temp = input().split(" ")
X = int(temp[0])
Y = int(temp[1])
i = 2
while True:
    tgt = X * i
    if X == Y:
        print(-1)
        break
    elif tgt % Y != 0:
        print(tgt)
        break
    elif i == 100000:
        print(-1)
        break
    else:
        i += 1
### BUGGY CODE ###

import heapq


n, m = map(int, input().split())
A = list(map(int, input().split()))
A.sort(reverse=True)

idx_dict = {}
for i in range(n):
    idx_dict[i] = i+1

ans = [A[i]+A[i] for i in range(n)]
candidates = [[-(A[i]+A[i+1]), i] for i in range(n-1)]
heapq.heapify(candidates)

for i in range(m//2):
    if not candidates:
        break
    num, idx = heapq.heappop(candidates)
    ans.append(-num)
    ans.append(-num)
    idx_dict[idx] += 1
    new_pair = idx_dict[idx]
    if new_pair >= n:
        continue
    candidate = A[idx] + A[new_pair]
    heapq.heappush(candidates, [-candidate, idx])

ans.sort(reverse=True)
print(sum(ans[:m]))

### FIXED CODE ###

n, m = map(int, input().split())
A = list(map(int, input().split()))
A.sort(reverse=True)
cumsumA = []

total = 0
for a in A:
    total += a
    cumsumA.append(total)
cumsumA.append(0)

l = 0
r = 10 ** 6
while l + 1 < r:
    num = (l+r)//2
    pair_idx = n-1
    count = 0
    for a in A:
        while a + A[pair_idx] < num and pair_idx >= 0:
            pair_idx -= 1

        count += pair_idx+1

    if count < m:
        r = num
        continue
    elif count >= m:
        l = num


ans = 0
count = 0
num = l
pair_idx = n-1
for a in A:
    while a + A[pair_idx] < num and pair_idx >= 0:
        pair_idx -= 1

    count += pair_idx+1
    ans += cumsumA[pair_idx] + a*(pair_idx+1)

diff = count - m
ans -= num * diff
print(ans)
### BUGGY CODE ###

N, K = (int(x) for x in input().split())
Plot = [tuple(int(x) for x in input().split()) for _ in range(N)]
X = [p[0] for p in Plot]
Y = [p[1] for p in Plot]
X.sort()
Y.sort()
#全2点間で長方形の辺を作り、その内内部点がK個のものだけ面積を比較する。
#2点p,qが頂点にある長方形は確かに最小の長方形を成す
#2点が頂点でない場合、内部点の個数が変わらないように適当な2点p,qを取って頂点とすることでより小さい長方形を形成できる
ans = 10e20
while len(X) != 0:
    x1 = X[0]
    X.pop(0)
    for x2 in X:
        Ycopy = Y.copy()
        while len(Ycopy) != 0:
            y1 = Ycopy[0]
            Ycopy.pop(0)
            for y2 in Ycopy:
                    S = (x2-x1)*(y2-y1)
                    cnt = 0
                    for p in Plot:
                        if x1 <= p[0] <= x2 and y1 <= p[1] <= y2:
                            cnt += 1
                    if cnt == K and S != 0:
                        ans = min(ans, S)
print(ans)

### FIXED CODE ###

N, K = (int(x) for x in input().split())
Plot = [tuple(int(x) for x in input().split()) for _ in range(N)]
X = [p[0] for p in Plot]
Y = [p[1] for p in Plot]
X.sort()
Y.sort()
#全2点間で長方形の辺を作り、その内内部点がK個のものだけ面積を比較する。
ans = 10e20
from itertools import combinations
for x1, x2 in combinations(X, 2):
    for y1 in Y:
        y2 = [y for x,y in Plot if x1 <= x <= x2 and y1 <= y]
        if len(y2) < K:
            break
        y2.sort()
        S = (x2-x1)*(y2[K-1]-y1)
        ans = min(ans, S)
print(ans)
### BUGGY CODE ###

x, y = map(int, input().split())
l = list(map(int, input().split()))
ans = 0
d = {}
l2 = []
for i in l:
  if i not in d:
    d[i] = 1
  else:
    d[i] += 1
#print(d)
if len(d) <= y:
  print(0)
else:
  for v in d.values():
    l2.append(v)
    l2.sort(reverse = True)
  print(sum(l2[y:]))

### FIXED CODE ###

from collections import Counter

x, y = map(int, input().split())
l = list(map(int, input().split()))
l2 = []
d = Counter(l)
l2 = list(d.values())
l2.sort(reverse=True)

print(sum(l2[y:]))
### BUGGY CODE ###

Q=int(input())

alist=[]
b=0
for _ in range(Q):
  query=list(map(int,input().split()))
  if len(query)==3:
    dummy,ai,bi=query
    alist.append(ai)
    alist.sort()
    b+=bi
  else:
    minarg=alist[(len(alist)-1)//2]
    minvalue=b
    for i in range(len(alist)):
      minvalue+=abs(alist[i]-minarg)
    print(minarg,minvalue)

### FIXED CODE ###

import heapq
Q=int(input())

alist=[]
hq_left,hq_right=[],[]
dummy,a1,b1=map(int,input().split())
heapq.heappush(hq_left,-a1)
heapq.heappush(hq_right,a1)
b=b1

min_arg=-hq_left[0]
min_diff=0
#min_value=b      
for _ in range(Q-1):
  query=list(map(int,input().split()))
  if len(query)==3:    
    dummy,ai,bi=query
    b+=bi
    
    max_left=-hq_left[0]
    min_right=hq_right[0]
    if ai<max_left:
      heapq.heappush(hq_left,-ai)
      heapq.heappush(hq_left,-ai)
      heapq.heappop(hq_left)
      heapq.heappush(hq_right,max_left)      
      min_diff+=max_left-ai
    elif min_right<ai:
      heapq.heappush(hq_right,ai)
      heapq.heappush(hq_right,ai)
      heapq.heappop(hq_right)
      heapq.heappush(hq_left,-min_right)      
      min_diff+=ai-min_right
    else:
      heapq.heappush(hq_left,-ai)
      heapq.heappush(hq_right,ai)      
  else:    
    min_arg=-hq_left[0]
    min_value=min_diff+b
    print(min_arg,min_value)
### BUGGY CODE ###

N, M = map(int,input().split(' '))
a = [int(input()) for i in range(M)]
ans = [0]*(N+1)
ans[0] = 1
for i in range(1,N+1):
  ans[i] = ans[i-1]+ans[i-2]
  if i in a:
    ans[i] = 0
print(ans[N]%(10**9+7))

### FIXED CODE ###

N, M = map(int,input().split(' '))
a = set([int(input()) for i in range(M)])
ans = [0]*(N+1)
ans[0] = 1
for i in range(1,N+1):
  if i in a:
    ans[i] = 0
  else:
    ans[i] = (ans[i-1]+ans[i-2])%(10**9+7)
print(ans[N])
### BUGGY CODE ###

import sys
input=sys.stdin.readline

N,M = (int(x) for x in input().rstrip('\n').split())
As = [int(x) for x in input().rstrip('\n').split()]
As = sorted(As,reverse = True)
rest = M
for _ in range(M):
  d = As[0]
  b = d//2 - d//4
  for i in range(N):
    a = As[i]
    check = 0
    if a-a//2<b:
      if rest > i:
        ad = [x//2 for x in As[:i]]
        As = As[i:]
        As.extend(ad)
        rest -= i
        check += 1
        As = sorted(As,reverse = True)
      else:
        ad = [x//2 for x in As[:rest]]
        As = As[rest:]
        As.extend(ad)
        rest = 0
        check += 2
        break
        break
#全部通った場合
    if i == N-1 and check == 0:
      if rest > N:
        As = [x//2 for x in As]
        rest -= N
      else:
        ad = [x//2 for x in As[:rest]]
        As = As[rest:]
        As.extend(ad)
        rest = 0
        break
        break
print(sum(As))


### FIXED CODE ###

import sys
input=sys.stdin.readline

N,M = (int(x) for x in input().rstrip('\n').split())
As = [int(x) for x in input().rstrip('\n').split()]
As = sorted(As,reverse = True)
rest = M
for _ in range(M):
  if rest == 0:
    break
  d = As[0]
  b = d//2 - d//4
  for i in range(N):
    a = As[i]
    check = 0
    if a-a//2<b:
      if rest > i:
        ad = [x//2 for x in As[:i]]
        As = As[i:]
        As.extend(ad)
        rest -= i
        check += 1
        As = sorted(As,reverse = True)
        break
      else:
        ad = [x//2 for x in As[:rest]]
        As = As[rest:]
        As.extend(ad)
        check += 1
        rest = 0
        break
    if i == N-1:
      if check == 0:
        if rest > N:
          As = [x//2 for x in As]
          rest -= N
        else:
          ad = [x//2 for x in As[:rest]]
          As = As[rest:]
          As.extend(ad)
          rest = 0
          break
print(sum(As))
### BUGGY CODE ###

#!/usr/bin/env python3
import sys
import math


def II(): return int(sys.stdin.readline())


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


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


def main():
    N = II()
    ans = 0

    for n in range(1, N+1):
        ans = 0
        for i in range(1, math.floor(n**(1/2))+1):
            for j in range(i,  math.floor(n**(1/2))+1):
                for k in range(j,  math.floor(n**(1/2))+1):
                    if (i**2 + j ** 2 + k ** 2 + i*j+j*k+k*i == n):
                        tmp = set([i, j, k])
                        if len(tmp) == 3:
                            ans += 6
                        if len(tmp) == 2:
                            ans += 3
                        if len(tmp) == 1:
                            ans += 1
        print(ans)


        # oj t -c "pypy3 main.py"
        # acc s main.py -- --guess-python-interpreter pypy
main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys
import math
import collections


def II(): return int(sys.stdin.readline())


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


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


def main():
    N = II()
    ans = 0
    list_counter = []

    for i in range(1, math.floor(N**(1/2))+1):
        for j in range(i,  math.floor(N**(1/2))+1):
            for k in range(j,  math.floor(N**(1/2))+1):
                n = str(i**2 + j**2 + k**2 + i*j + j*k + k*i)
                tmp = set([i, j, k])

                if len(tmp) == 3:
                    tmp_list = [n]*6
                if len(tmp) == 2:
                    tmp_list = [n]*3
                if len(tmp) == 1:
                    tmp_list = [n]*1
                list_counter.extend(tmp_list)

    counter = collections.Counter(list_counter)
    for n in range(1, N+1):
        print(counter[str(n)])



    # oj t -c "pypy3 main.py"
    # acc s main.py -- --guess-python-interpreter pypy
main()
### BUGGY CODE ###

import statistics

k, n = map(int, input().split())
a = list(map(int, input().split()))
dist = []

for i in a:
  target = i
  tmp = [abs(j - target) if abs(j - target) < abs(j - (target + k)) else abs(j - (target + k)) for j in a]
  dist.append(sum(tmp))
print(min(dist))

### FIXED CODE ###

import statistics

k, n = map(int, input().split())
a = list(map(int, input().split()))
dist = []

for num, i in enumerate(a[:]):
  if num == (n - 1):
    dist.append(abs((k + a[0]) - i))
  else:
    dist.append(abs(a[num + 1] - i))
ind = dist.index(max(dist))
dist.pop(ind)
print(sum(dist))
### BUGGY CODE ###

# coding: utf-8
# hello worldと表示する
#dpでできないかな？
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil,pi
from operator import itemgetter
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
def SI(): return input().rstrip()
def printns(x): print('\n'.join(x))
def printni(x): print('\n'.join(list(map(str,x))))
inf = 10**17
mod = 10**9 + 7

n,k=MI()
lis=LI()
cou=Counter(lis)
u=cou.most_common()
#print(u)
ans=0
for i in range(len(u)-k):
    j=len(u)-i-1
    #print(j)
    ans+=cou.most_common()[j][1]
    #print(cou.most_common()[j][1])
print(ans)


### FIXED CODE ###

# coding: utf-8
# hello worldと表示する
#dpでできないかな？
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil,pi
from operator import itemgetter
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
def SI(): return input().rstrip()
def printns(x): print('\n'.join(x))
def printni(x): print('\n'.join(list(map(str,x))))
inf = 10**17
mod = 10**9 + 7

n,k=MI()
lis=LI()
cou=Counter(lis)
u=cou.most_common()
#print(u)
ans=0
for i in range(len(u)-k):
    j=len(u)-i-1
    #print(j)
    ans+=u[j][1]
    #print(cou.most_common()[j][1])
print(ans)
### BUGGY CODE ###


n=int(input())
ans=1
for i in range(1,n+1):
  ans*=i
print(ans%(10**9+7))

### FIXED CODE ###

n=int(input())
ans=1
for i in range(1,n+1):
  ans*=i
  ans%=10**9+7
print(ans)
### BUGGY CODE ###

from collections import deque

N, M = map(int, input().split())
INF = 10 ** 12

vec = [[] for _ in range(N)]
for _ in range(M) :
    u, v = map(int, input().split())
    vec[u-1].append(v-1)

S, T = map(int, input().split())
S, T = S - 1, T - 1

vec_ = [[] for _ in range(N)]
visited = [False] * N
visited[S] = True
queue_ = [S]

while queue_ :
    i = queue_.pop()
    queue = deque([(0, i)])
    while queue :
        step, q = queue.popleft()
        if step == 2 : 
            for j in vec[q] :
                vec_[i].append(j)
                if not visited[j] :
                    visited[j] = True
                    queue_.append(j)
        else :
            for j in vec[q] :
                queue.append((step + 1, j))
                if not visited[j] :
                    visited[j] = True
                    queue_.append(j)
      
visited = [False] * N
visited[S] = True
queue = deque([(0, S)])
while queue :
    step, q = queue.popleft()
    for i in vec_[q] :
        if i == T :
            print(step+1)
            exit()
        
        if not visited[i] :
            queue.append((step + 1, i))
            visited[i] = True

print(-1)
    

### FIXED CODE ###

from collections import deque

N, M = map(int, input().split())

vec = [[] for _ in range(N)]
for _ in range(M) :
    u, v = map(int, input().split())
    vec[u-1].append(v-1)

S, T = map(int, input().split())
S, T = S - 1, T - 1

visited = [[False] * N for _ in range(3)]
visited[0][S] = True
queue = deque([(S, 0)])

while queue :
    q, cost = queue.popleft()
    p = (cost + 1) % 3
    for i in vec[q] :
        if p == 0 and i == T :
            print((cost + 1) // 3)
            exit()
        if not visited[p][i] :
            visited[p][i] = True
            queue.append((i, cost + 1))

print(-1)
### BUGGY CODE ###

H, W = map(int, input().split())
sh, sw = map(lambda x:int(x)-1, input().split())
eh, ew = map(lambda x:int(x)-1, input().split())
S = [input() for _ in range(H)]

INF = 10**9
dst = [[INF]*W for _ in range(H)]
dst[sh][sw] = 0

from collections import deque
dq = deque([(sh, sw)])
while dq:
    h, w = dq.popleft()

    for dh in range(-2, 3):
        for dw in range(-2, 3): # [dh,dw]:[-2,-2]~[2,2]
            nh = h + dh; nw = w + dw
            if 0 <= nh < H and 0 <= nw < W and S[nh][nw] == '.' and dst[h][w] < dst[nh][nw]:
                if dh*dh + dw*dw == 1:
                    dst[nh][nw] = dst[h][w]
                    dq.appendleft((nh, nw))
                elif dh*dh + dw*dw > 1:
                    dst[nh][nw] = dst[h][w] + 1
                    dq.append((nh, nw))

print(-1 if dst[eh][ew]==INF else dst[eh][ew])


### FIXED CODE ###

dhw = [(1,0),(0,-1),(0,1),(-1,0),
( 2,-2),( 2,-1),( 2, 0),( 2, 1),( 2, 2),
( 1,-2),( 1,-1),        ( 1, 1),( 1, 2),
( 0,-2),                        ( 0, 2),
(-1,-2),(-1,-1),        (-1, 1),(-1, 2),
(-2,-2),(-2,-1),(-2, 0),(-2, 1),(-2, 2)]

H, W = map(int, input().split())
sh, sw = map(lambda x:int(x)-1, input().split())
eh, ew = map(lambda x:int(x)-1, input().split())
S = [input() for _ in range(H)]

dst = [[-1]*W for _ in range(H)]

from collections import deque
dq = deque([(sh, sw, 0)])
while dq:
    h, w, d = dq.popleft()
    if 0 <= h < H and 0 <= w < W and dst[h][w] < 0 and S[h][w] != '#':
        dst[h][w] = d
    else:
        continue
    for i in range(4): dq.appendleft((h + dhw[i][0], w + dhw[i][1], d))
    for i in range(4, 24): dq.append((h + dhw[i][0], w + dhw[i][1], d+1))

print(dst[eh][ew])
### BUGGY CODE ###

n=int(input())
a=list(map(int,input().split()))
b=sorted(a)
c=set(a)
count=0
for i in c:
    if b.count(i)==i:
       count+=0
    elif b.count(i)>=i:
       count+=b.count(i)-i
    else:
       count+=b.count(i)
print(count)

### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
b=sorted(a)#n
c=list(set(b))
c.sort()
kosuu_list=[]
kosuu=1
for i in range(len(b)-1):
    #kosuu=0
    #print(b[i])
    if b[i]==b[i+1]:
        kosuu+=1
    else:
        kosuu_list.append(kosuu)
        kosuu=1
kosuu_list.append(b.count(b[-1]))
#print(kosuu_list)
count=0
#print(c)
for i in range(len(c)):
    if kosuu_list[i]==c[i]:
        count+=0
    elif kosuu_list[i]>=c[i]:
        count+=kosuu_list[i]-c[i]
    else:
        count+=kosuu_list[i]
print(count)
### BUGGY CODE ###

import sys
import copy
from collections import deque
stdin = sys.stdin

mod = 10**9+7

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

n, k = na()
a = na()

def calc_lux(a):
    res = [0 for _ in range(len(a))]
    cnt = 0
    for i in range(len(a)):
        light = a[i]
        if light==len(a) or (i <= light and n-1-i <= light):
            cnt += 1
            continue
        for j in range(max(0, i-light), min(n-1, i+light)+1, 1):
            res[j] += 1
    for i in range(len(res)):
        res[i] += cnt
    return res

for _ in range(k):
    # calc lux from a
    lux = calc_lux(a)

    if a==lux:
        a = lux
        break

    # overwrite a
    a = lux
    # print(lux)

print(" ".join([str(i) for i in a]))

### FIXED CODE ###

import sys
import copy
from collections import deque
stdin = sys.stdin

mod = 10**9+7

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

n, k = na()
a = na()

def calc_lux(a):
    imosu = [0 for _ in range(len(a))]
    res = [0 for _ in range(len(a))]
    cnt = 0
    for i in range(len(a)):
        light = a[i]
        le = max(0, i-light)
        imosu[le] += 1
        if i+light < n-1:
            imosu[i+light+1] -= 1

    tmp = 0
    for i in range(len(res)):
        tmp += imosu[i]
        res[i] += tmp
    return res

for _ in range(k):
    # calc lux from a
    lux = calc_lux(a)

    if a==lux:
        a = lux
        break

    # overwrite a
    a = lux
    # print(lux)

print(" ".join([str(i) for i in a]))
### BUGGY CODE ###

from collections import deque
import copy
n = int(input())

games = [0]*n

for i in range(n):
  games[i] = deque([int(x) for x in input().split()])

ans = 0
already = [False]*n
fin = 0
rev=0
while True:
  flag = False
  key = copy.deepcopy(already)
  if rev%2:
    for i in range(n):
      if key[i]:
        continue
      k = games[i][0]-1
      if key[k]:
        continue
      if games[k][0] == i+1:
        flag = True
        key[k] = True
        key[i] = True
        games[k].popleft()
        games[i].popleft()
        if len(games[k]) == 0:
          already[k] = True
          fin += 1
        if len(games[i]) == 0:
          already[i] = True
          fin += 1
  else:
    for i in range(n-1, -1, -1):
      if key[i]:
        continue
      k = games[i][0]-1
      if key[k]:
        continue
      if games[k][0] == i+1:
        flag = True
        key[k] = True
        key[i] = True
        games[k].popleft()
        games[i].popleft()
        if len(games[k]) == 0:
          already[k] = True
          fin += 1
        if len(games[i]) == 0:
          already[i] = True
          fin += 1
  if flag:
    ans += 1
  else:
    ans = -1
    break
  if fin == n:
    break
  rev += 1
  
print(ans)

### FIXED CODE ###

import sys
from copy import deepcopy as copy

def main():
    input = sys.stdin.readline
    n = int(input())
    a = [None]*n
    for i in range(n):
        a[i] = [int(x)-1 for x in input().split()]
    
    index = [0]*n
    search = [int(x) for x in range(n)]
    ans = 0
    while True:
        already = set()
        judge = True
        sub = []
        for key in search:
            if index[key] == n-1:
                continue
            key2 = a[key][index[key]]
            if index[key2] == n-1:
                continue
            if key != a[key2][index[key2]]:
                continue
            if key in already or key2 in already:
                continue
            already.add(key)
            already.add(key2)
            index[key] += 1
            index[key2] += 1
            sub.append(key)
            sub.append(key2)
            judge = False
        if judge:
            break
        ans += 1
        search = copy(sub)
        
    for value in index:
        if value != n-1:
            print(-1)
            sys.exit()
    print(ans)
    
if __name__ == "__main__":
    main()
### BUGGY CODE ###

n = int(input())
A = list(map(int, input().split()))
q = int(input())
mi = map(int, input().split())

def solve(i, m):
    if (m == 0):
        return True
    if (i >= n):
        return False
    res = solve(i + 1, m) or solve(i + 1, m - A[i])
    return res

for j in mi:
    if solve(0, j):
        print("yes")
    else:
        print("no")

### FIXED CODE ###

n = int(input())
A = list(map(int, input().split()))
q = int(input())
mi = map(int, input().split())
t = {}

def solve(i, m):
    if (m == 0):
        return True
    if (i >= n):
        return False
    if (i,m) in t:
        return t[(i,m)]
    res = solve(i + 1, m) or solve(i + 1, m - A[i])
    t[(i,m)] = res
    return res

for m in mi:
    if solve(0, m):
        print("yes")
    else:
        print("no")
### BUGGY CODE ###

n = int(input())
ls = list(map(int, input().split()))
ls = [x - i - 1 for i, x in enumerate(ls)]
ls = [abs(x - sum(ls) // n) for x in ls]
print(sum(ls))

### FIXED CODE ###

n = int(input())
ls = list(map(int, input().split()))
ls = sorted([x - i - 1 for i, x in enumerate(ls)])
m = ls[n // 2]
ls = [abs(x - m) for x in ls]
print(sum(ls))
### BUGGY CODE ###

def Q():
    N, A, B = map(int, input().split())
    MOD = 998244353

    if B == 0:
        print(1)
        exit()

    f = 1
    F = [1] * (N + 1)
    for i in range(1, N + 1):
        F[i] = f = f * i % MOD

    FI = [1] * (N + 1)
    FI[N] = fi = pow(f, MOD - 2, MOD)
    for i in range(N, 1, -1):
        FI[i - 1] = fi = fi * i % MOD

    z = 0
    for k in range(min(A + 1, N - B) if N - B - A else A + 1):
        x = (B - k) * F[B + k - 1] * FI[B] * FI[k] % MOD
        y = F[N + A - B - 2 * k - 1] * FI[N - B - k - 1] * FI[A - k] % MOD
        z = (z + x * y) % MOD

    print(z)

Q()

### FIXED CODE ###

N, A, B = map(int, input().split())
MOD = 998244353

if B == 0:
    print(1)
    exit()

f = 1
F = [1] * (N + 1)
for i in range(1, N + 1):
    F[i] = f = f * i % MOD

FI = [1] * (N + 1)
FI[N] = fi = pow(f, MOD - 2, MOD)
for i in range(N, 1, -1):
    FI[i - 1] = fi = fi * i % MOD

z = 0
for k in range(min(A + 1, N - B) if N - B - A else A + 1):
    x = (B - k) * F[B + k - 1] * FI[B] * FI[k] % MOD
    y = F[N + A - B - 2 * k - 1] * FI[N - B - k - 1] * FI[A - k] % MOD
    z = (z + x * y) % MOD

print(z)