Harryxun/stf_run huggingface dataset:
n=int(input())
l=[int(i) for i in input().split()]


b=[]
for i in range(n):
    b.append(22000*i+1)
a=b[:]
b.reverse()
for i in range(1,n):
    a[i[i]-1]+=1
print(*a)
print(*b)


### FIXED CODE ###

n=int(input())
line=input().split()
for i in range (n):
    line[i]=int(line[i])
 
b=[]
for i in range (n):
    b.append(22000*i+1)
a=b[:]
b.reverse()
 
for i in range (1,n):
    a[line[i]-1]+=i
 
print (" ".join(map(str,a)))
print (" ".join(map(str,b)))
a,b,c = input().sprit()
if(a== b == c):
  print('Yes')
else:
  print('No')

### FIXED CODE ###

a,b,c = map(int,input().split())
if(a== b == c):
  print('Yes')
else:
  print('No')
#C
import numpy as np
x, n = map(int, input().split())

if n!=0:
    p_list = list(map(int, input().split()))
    
    if n%2==0:
        kouho = list(range((x-n//2-1),(x+n//2)))
    else:
        kouho = list(range((x-n//2-1),(x+n//2+1)))
        kouho2 = set(kouho) - set(p_list)
        ans = [j for i, j in enumerate(list(kouho2)) if abs(j-x) == min(abs(np.array(list(kouho2)) - x))]
        ans = min(ans)

else:
    ans = [x]

print(ans)

### FIXED CODE ###

#C
import numpy as np
x, n = map(int, input().split())

if n!=0:
    p_list = list(map(int, input().split()))
    kouho = list(range((x-n//2-1),(x+n//2+1)))    
    kouho2 = list(set(kouho) - set(p_list))
    ans = [j for i, j in enumerate(kouho2) if abs(j-x) == min(abs(np.array(kouho2) - x))]
    ans = min(ans)

else:
    ans = x

print(ans)
N=int(input())
s=input()
tmp=N
for i in range(N+1):
    a=s[:i].count("#")
    b=s[i:N].count(".")
    if tmp>a+b:
        tmp=a+b
print(tmp)


### FIXED CODE ###

a,b,c=map(int, input().split())
if a>b:
    goal=a
    start=b
else:
    goal=b
    start=a
    
ans="No"
if c>start and c<goal:
    ans="Yes"
print(ans)
from collections import deque


def dfs(root):
    global time
    stack.append(root)
    color[root] = 'gray'
    arrive[root] = time
    time += 1

    while len(stack) > 0:
        node = stack[-1]
        for next in range(n):
            if adjMat[node][next] == 1:
                if color[next] == 'white':
                    color[next] = 'gray'
                    arrive[next] = time
                    time += 1
                    stack.append(next)
                    break
        # In case there in no adjacent node whose color is white
        color[node] = 'black'
        finish[node] = time
        time += 1
        stack.pop()


n = int(input())

adjMat = [[0] * n for _ in range(n)]
color = ['white'] * n
stack = deque()
arrive = [0] * n
finish = [0] * n
time = 1

for _ in range(n):
    adj = list(map(int, input().split()))
    i = adj[0]
    v = adj[2:]
    for j in v:
        adjMat[i - 1][j - 1] = 1

for root in range(n):
    if color[root] = 'white':
        dfs(root)

for i in range(n):
    out = ''
    out += '{} {} {}'.format(i+1, arrive[i], finish[i])
    print(out)

### FIXED CODE ###

def dfs_recursive(u):
    global time
    color[u] = 'gray'
    arrive[u] = time
    time += 1
    for v in range(n):
        if adjMat[u][v] == 1 and color[v] == 'white':
            dfs_recursive(v)
    color[u] = 'black'
    finish[u] = time
    time += 1


n = int(input())

adjMat = [[0] * n for _ in range(n)]
color = ['white'] * n
arrive = [0] * n
finish = [0] * n
time = 1

for _ in range(n):
    adj = list(map(int, input().split()))
    i = adj[0]
    v = adj[2:]
    for j in v:
        adjMat[i - 1][j - 1] = 1

for root in range(n):
    if color[root] == 'white':
        dfs_recursive(root)


for i in range(n):
    out = ''
    out += '{} {} {}'.format(i + 1, arrive[i], finish[i])
    print(out)
# coding: utf-8

import math

N = int(raw_input())

h = int(math.ceil(N/4.0))
n = int(math.ceil(h*4*N/4.0/(h*4-N)))
w = 1145141919810
print h, n, w

### FIXED CODE ###

def solver():
    N = int(raw_input())

    for h in xrange(1, 3501):
        for n in xrange(1, 3501):
            x = N * h * n;
            y = 4 * n * h - N * n - N * h;
            if y > 0 and x % y == 0:
                w = x / y
                return map(str, [h, n, w])


print " ".join(solver())
P=[0]*1000
x=1
N=int(input())
for i in range(2,N+1):
  A=PF(i)
  for j in range(len(A)):
    P[A[j][0]]=P[A[j][0]]+A[j][1]
P.remove(0)
for i in range(len(P)):
  x=(x*(P[i]+1))%(10**9+7)
print(x)

### FIXED CODE ###

def PF(n):
    fs = []
    q = int(n ** 0.5) 
    for i in range(2, q + 1):
        if n % i == 0:
            r = 0
            while n % i == 0:
                n //= i
                r += 1
            fs.append([i, r])
    if n != 1:
        fs.append([n, 1])
    return fs

P=[0]*1000
x=1
N=int(input())
for i in range(2,N+1):
  A=PF(i)
  for j in range(len(A)):
    P[A[j][0]]=P[A[j][0]]+A[j][1]
P.remove(0)
for i in range(len(P)):
  x=(x*(P[i]+1))%(10**9+7)
print(x)
def solve():
    n = int(input())
    a = [int(input()) for _ in range(n)]

    ten = [0]*int(1e9)
    for i in range(n):
        ten[i] += 1

    ten.remove(0)
    ans = 0
    for i in range(len(ten)):
        if ten[i]%2 == 1:
            ans += 1


    return ans

if __name__ == "__main__":
    print(solve())

### FIXED CODE ###

import collections
def solve():
    n = int(input())
    a = [int(input()) for _ in range(n)]

    c = collections.Counter(a)

    num = list(c.values())
    ans = 0
    for i in range(len(num)):
        if num[i]%2 == 1:
            ans += 1

    return ans

if __name__ == "__main__":
    print(solve())
MOD=10**9+7
def factorization(n):
    arr=[]
    tmp=n
    for i in range(2,int(n**0.5)+1):
        if(tmp%i==0):
            cnt=0
            while tmp%i==0:
                cnt+=1
                tmp//=i
            arr.append([i,cnt])
    if(not arr):
        arr.append([1,1])
    if(tmp!=1):
        arr.append([tmp,1])
    return arr
def moddiv(a,m):
    return pow(a,m-2,m)
N=int(input())
A=list(map(int,input().split()))
cnt=[0]*1001
for i in range(N):
    arr=factorization(A[i])
    for a,b in arr:
        cnt[a]=max(cnt[a],b)
g=1;res=0
for i in range(1001):
    g=g*(pow(i,cnt[i],MOD))%MOD
for i in range(N):
    res=(res+(g*moddiv(A[i],MOD))%MOD)%MOD
print(res)

### FIXED CODE ###

MOD=10**9+7
def factorization(n):
    arr=[]
    tmp=n
    for i in range(2,int(n**0.5)+1):
        if(tmp%i==0):
            cnt=0
            while tmp%i==0:
                cnt+=1
                tmp//=i
            arr.append([i,cnt])
    if(not arr):
        arr.append([1,1])
    if(tmp!=1):
        arr.append([tmp,1])
    return arr
def moddiv(a,m):
    return pow(a,m-2,m)
N=int(input())
A=list(map(int,input().split()))
cnt={}
for i in range(N):
    arr=factorization(A[i])
    for a,b in arr:
        cnt[a]=max(cnt.get(a,0),b)
g=1;res=0
for k,v in cnt.items():
    g=g*(pow(k,v,MOD))%MOD
for i in range(N):
    res=(res+(g*moddiv(A[i],MOD))%MOD)%MOD
print(res)
x,y = map(int,input().split())
p = 10**9+7
from math import factorial
if (x+y)%3 != 0:
    print(0)
    exit()



ans = 1
for i in range(0,x//2+2):
    j = x - 2*i
    if 2*j + i == y:
        a = i
        b = j
        break


for i in range(1,a+b+1):
    ans *= i%p
    ans %= p
ans %= p

a_inv = 1
for i in range(1,a+1):
    a_inv *= i%p
    a_inv %= p
a_inv = pow(a_inv,p-2,p)

b_inv = 1
for i in range(1,b+1):
    b_inv *= i%p
    b_inv %= p
b_inv = pow(b_inv,p-2,p)

ans *= (a_inv*b_inv)%p

print(ans%p)


### FIXED CODE ###

x,y = map(int,input().split())
p = 10**9+7
from math import factorial


if (x+y)%3 != 0:
    print(0)
    exit()



ans = 1
for i in range(0,x//2+2):
    j = x - 2*i
    if 2*j + i == y:
        a = i
        b = j
        break
else:
    print(0)
    exit()

for i in range(1,a+b+1):
    ans *= i%p
    ans %= p
ans %= p

a_inv = 1
for i in range(1,a+1):
    a_inv *= i%p
    a_inv %= p
a_inv = pow(a_inv,p-2,p)

b_inv = 1
for i in range(1,b+1):
    b_inv *= i%p
    b_inv %= p
b_inv = pow(b_inv,p-2,p)

ans *= (a_inv*b_inv)%p

print(ans%p)
x = int(x)
# OUTPUTS
# Print 1 if input is equal to 0
if x == 0:
    print(1)
    exit()

# Print 0 if input is equal to 1
if x == 1:
    print(0)
    exit()



### FIXED CODE ###

x = input()
x = int(x)
# OUTPUTS
# Print 1 if input is equal to 0
if x == 0:
    print(1)
    exit()

# Print 0 if input is equal to 1
if x == 1:
    print(0)
    exit()
while True:
    w = int(raw_input())
    n = int(raw_input())
    ans = []
    ans = [j for j in range(1,w+1)]
    for k in range(n):
        a,b = map(int,(raw_input().split(",")))
        ans[a-1],ans[b-1] = ans[b-1],ans[a-1]
    for item in ans:
        print item

### FIXED CODE ###

while True:
    try:
        w = int(raw_input())
        n = int(raw_input())
        ans = [j for j in range(1,w+1)]
        for k in range(n):
            a,b = map(int,(raw_input().split(",")))
            ans[a-1],ans[b-1] = ans[b-1],ans[a-1]
        for item in ans:
            print item
    except EOFError:
        break
n,m = map(int,input().split())
l = [[int(i)for i in input().split()]for _ in [0]*n]

def  g(k):
  a = [x[0]if k&1 else -x[0])+(x[1]if k&2 else -x[1])+(x[2]if k&4 else -x[2])  for x in l]
  a.sort(reverse=True)
  return sum(a[:m])
print(max([g(i) for i range(8)]))

### FIXED CODE ###

n, m = map(int, input().split())
l = [[int(i) for i in input().split()] for _ in [0]*n]
ans = 0

def  getmm(k):
  f = lambda x: (x[0] if k & 1 else -x[0]) + (x[1] if k & 2 else -x[1]) + (x[2] if k & 4 else -x[2])
  al = [f(e) for e in l]
  al.sort(reverse=True)
  return sum(al[:m])

for i in range(8):
  ans = max(ans, getmm(i))
print(ans)
## input
    N, M = map(int,input().split())
    HEIGHT_LIST = list(map(int,input().split())) 
    ROAD_LIST = []
    for j in range(M): 
        ROAD_LIST.append(
            set(map(int,input().split()))
        )
    
    ## business logic
    COUNT = 0
    
    for i in list(range(1, N+1)):
        unioned_i = set([])
        for k in ROAD_LIST:
            if i in k:
                unioned_i = unioned_i | k
        if len(unioned_i) == 0:
            COUNT = COUNT + 1
            continue
        HIGHT_i = HEIGHT_LIST[i-1]
        if HIGHT_i >= max(
            [ HEIGHT_LIST[l-1] for l in list(unioned_i) ]
        ):
            COUNT = COUNT + 1
    
    ## output
    print(COUNT)

### FIXED CODE ###

## import

## function definition 

## main process
if __name__ == '__main__':
    
    ## input
    N, M = map(int,input().split())
    HEIGHT_LIST = list(map(int,input().split())) 
    ROAD_LIST = []
    for j in range(M): 
        ROAD_LIST.append(
            tuple(map(int,input().split()))
        )
    
    ## business logic
    ans = [1] * N
    for j in list(range(M)):
        point_a = ROAD_LIST[j][0]
        point_b = ROAD_LIST[j][1]

        point_a -= 1
        point_b -= 1

        height_a = HEIGHT_LIST[point_a]
        height_b = HEIGHT_LIST[point_b]

        if height_a < height_b:
            ans[point_a] = 0
        elif height_a > height_b:
            ans[point_b] = 0
        else:
            ans[point_a] = 0
            ans[point_b] = 0

    ## output
    print(sum(ans))
n = int(input())
a = list(map(int, input().split()))
from fractions import gcd
from functools import reduce
l = [(hoge.append(gcd(hoge[i-1], a[i])), hoge)[1] for hoge in [[a[0]]] for i in range(1, n)][0]
r = reversed([(hoge.append(gcd(hoge[i-1], a[n-i-i])), hoge)[1] for hoge in [[a[0]]]for i in range(1, n)][0])
print (reduce(lambda x,y:max(x,y),[gcd(l[i-1]if 0<i else r[i+1],r[i+1] if i<n-1 else l[i-1])for i in range(n)]))

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))

from fractions import gcd

tl = [a[0]]
for i in range(1, n):
    tl.append(gcd(tl[i - 1], a[i]))

tr = [a[n - 1]]
for i in range(1, n):
    tr.append(gcd(tr[i - 1], a[n - 1 - i]))
tr.reverse()

ans = 1
for i in range(n):
    tmp = 1
    if i == 0: tmp = tr[i + 1]
    elif i == n - 1: tmp = tl[i - 1]
    else: tmp = gcd(tl[i - 1], tr[i + 1])
    ans = max(ans, tmp)
print(ans)
S = input()
K = input()
flag = 0
for i in range(len(S)):
    if S[i] =="1":
        continue
    elif S[i] =="2":
        print("2")
        flag = 1
    elif S[i] =="3":
        print("3")
        flag = 1
    elif S[i] =="4":
        print("4")
        flag = 1
    elif S[i] =="5":
        print("5")
        flag = 1
    elif S[i] =="6":
        print("6")
        flag = 1
    elif S[i] =="7":
        print("7")
        flag = 1
    elif S[i] =="8":
        print("8")
        flag = 1
    elif S[i] =="9":
        print("9")
        flag = 1

    break
if flag == 0:
    print("1")


### FIXED CODE ###

l = input().split()
A = int(l[0])
B = int(l[1])
print((A * B)- A -B + 1)
N,i = map(int,input(),split())

print(N-i+1)

### FIXED CODE ###

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

print(N-i+1)
# -*- coding: utf-8 -*-
def forgive(num):
    for i in range(10):
        if ((num + i) % 10) in unforgiven:
            continue
        else:
            return num + i


N, K = map(int, input().split())
unforgiven = list(map(int, input().split()))
unforgiven.sort()

price = [int(x) for x in str(N)]
purchase = 0
dig = 0
for num in reversed(price):
    purchase += forgive(num) * (10 ** dig)
    dig += 1

print(purchase)


### FIXED CODE ###

# -*- coding: utf-8 -*-
# 整数の入力
lst = list(map(int, input().split()))

if lst[0] == 5:
    if (lst[1] == 7 and lst[2] == 5) or (lst[1] == 5 and lst[2] == 7):
        print("YES")
        exit()

elif lst[0] == 7:
    if lst[1] == 5 and lst[2] == 5:
        print("YES")
        exit()

print("NO")
x = []
y = []
i = 0

while True:
  a, b = map(int, input().split())
  if b < a:
    stock = a
    a = b
    b = stock
  x.append(a)
  y.append(b)
  if x[i] == 0 and y[i] == 0:
    break
  i += 1

for j in range(i):
  print(str(x[j]), str(y[j]))

### FIXED CODE ###

x = []
y = []
i = 0

while True:
  a, b = map(int, input().split())
  if b < a:
    stock = a
    a = b
    b = stock
  x.append(a)
  y.append(b)
  if x[i] == 0 and y[i] == 0:
    break
  i += 1

for j in range(i):
  print(str(x[j]), str(y[j]))
NK = list(map(int, input().split()))
ans = [0]*NK[0]

for i in range(0,NK[1]):
  d = int(input())
  table  = list(map(int, input().split()))
  for j in range(0,NK[0]):
    if table.count(j) == 1:
      ans[j] = 0
print(NK[1]-sum(ans))

### FIXED CODE ###

def nextweek(S):
  if( S == "ABC"):
    return "ARC"
  else:
    return "ABC"



S = input()
print (nextweek(S))
N, x = map(int, input().split())
if x==1 or x==2*N-1:
    print('No')
else:
    print('Yes')
    if x <= 2*N:
        y = list(i for i in range(2, 2*N-2) if i!=x)
        l = len(y)//2
        print("\n".join(map(str, y[:l] + [2*N-1, x, 1, 2*N-2] + y[l:])))
    else:
        y = list(i for i in range(3, 2*N-1) if i!=x)
        l = len(y)//2
        print("\n".join(map(str, y[:l] + [2*N-1, 1, x, 2] + y[l:])))

### FIXED CODE ###

n = int(input())
s = input()
t = input()

M = 0
for i in range(1, n+1):
    if s[-i:] == t[:i]:
        M = i
print(n*2 - M)
n, k = map(int, input().split())
r, p, s = map(int, input().split())
d = {"r":s, "p":r, "s":p}
t = input()
dp = [0]*n
for i in range(n):
  if i<k and dp[i-k]==d[t[i]]:
    dp[i] = 0
  else:
    dp[i] = d[t[i]]
print(sum(lst))


### FIXED CODE ###

n, k = map(int, input().split())
r, s, p = map(int, input().split())
d = {"r":p, "s":r, "p":s}
t = list(input())
dp = [0]*n
for i in range(n):
  if i>=k and t[i]==t[i-k]:
    dp[i] = 0
    t[i] = "x"
  else:
    dp[i] = d[t[i]]
print(sum(dp))
r, D, x = map(int, input().split())

for i in range(10):
    x = r * x - D
    print(x)

### FIXED CODE ###

A, B = map(int, input().split())

if A < 6:
    print(0)
elif 6 <= A <13:
    print(B//2)
else:
    print(B)
from collections import Counter
n=int(input())
a=[int(input()) for i in range(n)]
b=Counter(a[::2])
a.sort()
c=Counter(a[::2])

ans=0
for i in b:
	if i in c:
		ans+=abs(b[i])-c[i])
	else:
		ans+=b[i]
print(ans)

### FIXED CODE ###

from collections import Counter
n=int(input())
a=[int(input()) for i in range(n)]
b=Counter(a[::2])
a.sort()
c=Counter(a[::2])

ans=0
for i in b:
	if i in c:
		ans+=abs(b[i]-c[i])
	else:
		ans+=b[i]
print(ans)
import math

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

if N == 1:
    print(P)

T = int(math.pow(P, 1/N))

Q = [False, False] + [True] * T
F = []
for n in range(T + 1):
    if Q[n]:
        F.append(n)
        for m in range(n, T + 1, n):
            Q[m] = False
D = 1
for f in F:
    c = 0
    while P % f == 0:
        c += 1
        P //= f
    D *= f ** (c // N)

print(D)

### FIXED CODE ###

import math

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

if N == 1:
    print(P)
    
else:
    T = int(math.pow(P, 1/N)) * 2

    Q = [False, False] + [True] * T
    F = []
    for n in range(T + 1):
        if Q[n]:
            F.append(n)
            for m in range(n, T + 1, n):
                Q[m] = False
    D = 1
    for f in F:
        c = 0
        while P % f == 0:
            c += 1
            P //= f
        D *= f ** (c // N)

    print(D)
s = input().split()
L = int(s[0])
R = int(s[1])
 
L = L%2019
R = R%2019
MIN = 2020
if R - L >= 2019:
    flag = True

for i in range(min(L,R),max(L,R)+1):
    for j in range(i,max(L,R)+1):
        if i != j:
            mod = i*j
            MIN = min(MIN,mod%2019)
if R == 0 or L == 0 or flag:
    print(0)
elif abs(R - L) == 1:
    print((R*L)%2019)
elif R == L:
    print((R*L)%2019)
else:
    print(MIN)

### FIXED CODE ###

s = input().split()
L = int(s[0])
R = int(s[1])

MIN = 2020
flag = 0

for i in range(L,R+1):
    for j in range(i+1,R+1):
        mod = i*j % 2019
        MIN = min(MIN,mod%2019)
        if MIN == 0:
            flag = 1
            break
    if flag == 1:
        break

if R == 0 or L == 0:
    print(0)
elif R - L == 1:
     print((R*L)%2019)
else:
    print(MIN)
N, K=map(int, input().split())
A=list(sorted(list(map(int, input().split()))))

def gcd(a,b):
	while b:
		a,b=b,a%b
	return a

g=gcd(A[0],A[1])
for i in range(2,len(A)):
	g=gcd(g,A[i])

print("POSSIBLE" if K%g==0 and K<=max(A) else "IMPOSSIBLE")

### FIXED CODE ###

N, K=map(int, input().split())
A=list(sorted(list(map(int, input().split())), reverse=True))

def gcd(a,b):
	while b:
		a,b=b,a%b
	return a

g=A[0]
for i in range(1,len(A)):
	g=gcd(g,A[i])

print("POSSIBLE" if K%g==0 and K<=max(A) else "IMPOSSIBLE")
n=int(input())
x,l,dcnt=[0]*n,[0]*n,[0]*n
xlr=[[0]*2 for i in range(n)]
for i in range(n):
  a,b=map(int,input().split())
  x[i],l[i]=a,b
  xlr[i]=[a-b,a+b]
xlr.sort()
for i in range(n-1):
  chk=xlr[i][1]
  cnt=0
  for j in range(i+1,n):
    if xlr[j][0]<chk:
      cnt+=1
    else:
      break
  dcnt[i]=cnt
cnt=0
for i in range(1,n+1):
  if dcnt[n-i]>0:
    dcnt[n-i]=0
    cnt+=1
    for j in range(n-i):
      if dcnt[n-i-j-1]>j:
        dcnt[n-i-j-1]-=1
print(n-cnt)

### FIXED CODE ###

h=int(input())
w=int(input())
n=int(input())
flg,cnt,pn=0,0,0
mh,mw=h,w
hcnt,wcnt=h,w
while pn<n:
  if mh==mw:
    if hcnt>wcnt:
      flg=0
    else:
      flg=1
  elif mh>mw:
    flg=1
  else:
    flg=0
  if flg==1:
    pn+=mh
    wcnt-=1
    mw-=1
    cnt+=1
  else:
    pn+=mw
    hcnt-=1
    mh-=1
    cnt+=1    
print(cnt)
import numpy as np

N = 3

hyo = np.zeros((N,2))

for NN in range(N):
    hyo[NN] = input().split(' ')

hyo_sorted = hyo[np.argsort(hyo[:,1])]

tooktime = hyo_sorted[:,0].cumsum()

timeup = hyo_sorted[:,1]

if any(tooktime > timeup) ==True:
    print("No")
else:
    print("Yes")

### FIXED CODE ###

import numpy as np

N = int(input())

hyo = np.zeros((N,2))

for NN in range(N):
    hyo[NN] = input().split(' ')

hyo_sorted = hyo[np.argsort(hyo[:,1])]

tooktime = hyo_sorted[:,0].cumsum()

timeup = hyo_sorted[:,1]

if any(tooktime > timeup) ==True:
    print("No")
else:
    print("Yes")
N,M,K=map(int,input().split())
P=998244353

start=(M*pow(M-1,N-1,P))%P

fac=[0]*N
finv=[0]*N
inv=[0]*N
fac[0]=1
fac[1]=1
finv[0]=1
finv[1]=1
inv[1]=1
for i in range(2,N):
    fac[i]=(fac[i-1]*i)%P
    inv[i]=P-(inv[P%i]*(P//i))%P
    finv[i]=(finv[i-1]*inv[i])%P

def comb(n,k):
    return fac[n]*(finv[k]*finv[n-k]%P)%P



comp=0
last=(N-1)-K #K=0ならthru
for i in range(1,K+1):
    comp=(comp+comb(N-1,i)*pow(M-1,(N-1)-i,P))%P
comp=(comp*M)%P

print((start+comp)%P)

### FIXED CODE ###

N,M,K=map(int,input().split())
P=998244353

start=(M*pow(M-1,N-1,P))%P



if N>=2:
    fac=[0]*N
    finv=[0]*N
    inv=[0]*N
    fac[0]=1
    fac[1]=1
    finv[0]=1
    finv[1]=1
    inv[1]=1
    for i in range(2,N):
        fac[i]=(fac[i-1]*i)%P
        inv[i]=P-(inv[P%i]*(P//i))%P
        finv[i]=(finv[i-1]*inv[i])%P

    def comb(n,k):
        return fac[n]*(finv[k]*finv[n-k]%P)%P



    comp=0
    last=(N-1)-K #K=0ならthru
    for i in range(1,K+1):
        comp=(comp+comb(N-1,i)*pow(M-1,(N-1)-i,P))%P
    comp=(comp*M)%P

    print((start+comp)%P)

else:
    print(M%P)
kazu = int(input())
suji = input().split()

l_si_i = [int(s) for s in suji]

if kazu == 1:
    print('Yes')
    exit()

for i in range(kazu):
    if kazu - i == 1:
        print('Yes')
    if i == 0:
        if l_si_i[i+1] - l_si_i[i] < -1:
            print('No')
            exit()
        else:
            continue
    else:
        if l_si_i[i+1] - l_si_i[i] == 0:
            continue
        elif l_si_i[i+1] - l_si_i[i] == 1:
            l_si_i[i+1] = l_si_i[i+1] - 1
            continue
        elif l_si_i[i+1] - l_si_i[i] == -1:
            if l_si_i[i] - l_si_i[i-1] <= 0:
                print('No')
                exit()
            else:
                continue
        elif l_si_i[i+1] - l_si_i[i] < -1:
            print('No')
            exit()
        else:
            continue


### FIXED CODE ###

n = input()
l = list(map(int, input().split()))
m = 0
a = "Yes"
for i in l:
    if i < m-1:
        a = "No"
        break
    m = max(m, i)
print(a)
n = int(input())
a = list(map(int,input().split()))
q = int(input())
dic = {}
s = sum(a)
for i in range(1,10**5+1):
    if i in a:
        dic[i] = a.count(i)
    else:
        dic[i] = 0
lis=[]
for j in range(q):
    b,c = map(int,input().split())
    lis.append([b,c])

for p in lis
    s += (p[1]-p[0])*dic[p[0]]
    dic[p[1]] += dic[p[0]]
    dic[p[0]] = 0
    print(s)

### FIXED CODE ###

from collections import Counter
n = int(input())
a = list(map(int,input().split()))
q = int(input())
num = Counter(a)
s = sum(a)
for _ in range(q):
    b,c = map(int,input().split())
    s += (c-b)*num[b]
    num[c] += num[b]
    num[b] = 0
    print(s)
H,N = map(int,input().split())
A = list(map(int,input().split()))
if sum(A)>=H:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

H,A = map(int,input().split())

if H%A==0:
  print(H//A)
else:
  print(H//A+1)
p = str(input())
s = list(p)
k = int(input())

ss = list(set(sorted(s)))
zis = []
for i in ss:
    zis.append(i)
    indexes = [p for p, x in enumerate(s) if x == i]            
    count = 0
    onedict = []
    
    for ii in range(len(indexes)):
        onedict.append(i)
        
    while count <= len(s)  + 1 and len(onedict) <= k + 1:
        count = count + 1
        
        if True:
            quint = indexes
            for sss in range(len(onedict)):
                try:
                    pppp = onedict[sss]
                    pppp = pppp + s[ int(quint[sss])+ count]
                    onedict.append(pppp)
                except:
                    pass
            for jj in onedict:
                zis.append(jj)

                
    if len(zis) > k + 1:
        break
zissort = list(sorted(list(set(zis))))
print(zissort)
print(zissort[k-1])
                


### FIXED CODE ###


s = str(input())
k = int(input())
kouho = [s]

for i in range(len(s)):
    for plus in range(k+1):
        st = s[i:i + plus]
        kouho.append(st)
so = list(sorted(set(kouho)))
if '' in so:
    so.remove('')
    
print(so[k-1])
str=input().split()
s=''.join(str).lower
s=list(s)
for i in range(97, 97 + 26):
    count = 0
    for j in s:
        if chr(i) == j:
            count += 1
    print(chr(i), ':', count)
    print('No')



### FIXED CODE ###

a=''
while True:
    try:
        str = input().lower()
        a+=str
    except:
        break
for i in range(97, 97 + 26):
    count = 0
    for j in a:
        if chr(i) == j:
            count += 1
    print(chr(i), ':', count)