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

# -*- coding: utf-8 -*-
N, K = map(int, input().split(' '))
points = [list(map(int, input().split(' '))) for i in range(N)]

X = list(set([x for x, y in points]))
Y = list(set([y for x, y in points]))


ans = float('inf')
import itertools
all_indices = list(range(N))
for part_x in itertools.combinations(X, 2):
    for part_y in itertools.combinations(Y, 2):
        max_x = max(part_x)
        min_x = min(part_x)
        max_y = max(part_y)
        min_y = min(part_y)

        m = (max_x - min_x) * (max_y - min_y)
        internal_points = [(x, y) for x, y in points if min_x <= x <= max_x and min_y <= y <= max_y]
        if len(internal_points) >= K:
            ans = min(ans, m)

print(ans)

### FIXED CODE ###

# -*- coding: utf-8 -*-
N, K = map(int, input().split(' '))
points = [list(map(int, input().split(' '))) for i in range(N)]

X = list(set([x for x, y in points]))
Y = list(set([y for x, y in points]))

X.sort()
Y.sort()

ans = float('inf')
for i, min_x in enumerate(X):
    for max_x in X[i+1:]:
        for j, min_y in enumerate(Y):
            for max_y in Y[j + 1:]:
                m = (max_x - min_x) * (max_y - min_y)
                internal_points = [(x, y) for x, y in points if min_x <= x <= max_x and min_y <= y <= max_y]
                if len(internal_points) >= K:
                    ans = min(ans, m)

print(ans)
### BUGGY CODE ###

N, K = map(int, input().split())
H = list(map(int, input().split())) + [0]
dp = [[10**12]*(K+2) for _ in range(N+1)]
dp[0][0] = 0
for i in range(N):
  for j in range(min(i+1, K) + 1):
    for k in range(j + 1):
      dp[i+1][j] = min(dp[i+1][j], dp[i-k][j-k] + max(H[i] - H[i-k-1], 0))
ans = min(dp[-1])
for i in range(K):
  ans = min(ans, dp[N-i][K-i])
print(ans)

### FIXED CODE ###

N, K = map(int, input().split())
H = list(map(int, input().split())) + [0]
dp = [[10**12]*(K+2) for _ in range(N+1)]
dp[0][0] = 0
for i in range(N):
  for j in range(min(i+1, K) + 1):
    for k in range(j + 1):
      dp[i+1][j] = min(dp[i+1][j], dp[i-k][j-k] + max(H[i] - H[i-k-1], 0))
ans = min(dp[-1])
for i in range(K+1):
  ans = min(ans, dp[N-i][K-i])
print(ans)
### BUGGY CODE ###

s = input()

def get_integers(whitespaced_string):
    cleaned_string = whitespaced_string.split(" ")

    formatted_numbers = []
    for number in cleaned_string:
        formatted_numbers.append(int(number))
    
    return tuple(formatted_numbers)

input_arg = get_integers(s)

def get_answers(index = 2):

    answers = []
    for i in range(input_arg[index]):
        answers.append(int(input()))

    return answers

score_card = [input_arg[1] for i in range(input_arg[0])]
answers = get_answers()

for answer in answers:
    for i in range(1, len(score_card) + 1):
        if answer != i:
            score_card[i-1] -= 1

for i in score_card:
    if i <= 0:
        print("No")
    else:
        print("Yes")

### FIXED CODE ###

import sys

N,K,Q = map(int,input().split())
A = (int(x) for x in sys.stdin.read().split())
 
score = [K-Q] * (N+1) 
for x in A:
    score[x] += 1
 
answer = '\n'.join('No' if x <= 0 else 'Yes' for x in score[1:])
print(answer)
### BUGGY CODE ###

N = int(input())
A = [int(i) for i in input().split()]

ans = 0

for i in range(N-1):
    for j in range(i+1, N):
        ans += ((A[i]% (10**9 + 7))*(A[j]% (10**9 + 7))) % (10**9 + 7)
        
print(ans % (10**9 + 7))

### FIXED CODE ###

N = int(input())
A = [int(i) for i in input().split()]
S = []
e = 0
for i in A:
    e += i
    S.append(e)
    
ans = 0
for i in range(N-1):
    ans += A[i]%(10**9+7)*((S[N-1] - S[i])%(10**9+7))
    
print(ans%(10**9+7))
### BUGGY CODE ###

import sys
import math
input = sys.stdin.readline

N,M = map(int, input().split())
PY = [list(map(int,input().split())) for _ in range(M)]
PY_originals = tuple(PY)
N_counter = [0] * N
M_counter = [0] * M

PY.sort(key=lambda val: val[1])

for i in range(M):
    N_counter[PY[i][0]-1] += 1
    M_counter[i] = N_counter[PY[i][0]-1]

for i in PY_originals:
    ans = str(i[0]).zfill(6)+str(M_counter[PY.index(i)]).zfill(6)
    print(ans)

### FIXED CODE ###

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

PY = [[i] for i in range(1,M+1)]

for i in range(M):
    temp1, temp2 = map(int, input().split())
    PY[i].append(temp1)
    PY[i].append(temp2)


PY.sort(key=lambda val: val[2])
# print(PY)
PY.sort(key=lambda val: val[1])
# print(PY)
city = 0

for i, value in enumerate(PY):
    if value[1] != city:
        j = 0
    j += 1
    value.append(j)
    city = value[1]

PY.sort(key=lambda val:val[0])

# print(PY)

for i in PY:
    ans = str(i[1]).zfill(6)+str(i[3]).zfill(6)
    print(ans)
### BUGGY CODE ###

s = input()
count = 0
for i in range(0,len(s)):
    for j in range(i+1,len(s)):
        ss = s[i:j+1]
        if int(ss) % 2019  == 0:
            count += 1
print(count)

### FIXED CODE ###

s = input()
n = len(s)
r = list(reversed(s))
x = 1
t = 0
c = [0] * 2019
ans = 0
for i in range(n):
    c[t] += 1
    t += (int(r[i]))*x
    t %= 2019
    ans += c[t]
    x = x*10%2019
   
print(ans)
### BUGGY CODE ###

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

for i in range(n):
  print(a.count(i+1))

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
c = [0]*n

for i in range(n-1):
  c[a[i]-1] += 1

for j in range(n):
  print(c[j])
### BUGGY CODE ###

import sys
input = sys.stdin.readline
N,K = map(int,input().split())
A = [int(input()) for i in range(N)]

class SegTree:
    def __init__(self,arr,func,unit):
        self.func = func
        self.unit = unit
        n = 1
        while n < len(arr):
            n *= 2
        self.n = n
        nodes = [unit]*(2*n-1)
        nodes[n-1:n-1+len(arr)] = arr
        for i in range(n-2,-1,-1):
            nodes[i] = func(nodes[2*i+1],nodes[2*i+2])
        self.nodes = nodes

    def update(self,i,val):
        i += self.n-1
        self.nodes[i] = val
        while i >= 0:
            i = (i - 1) // 2
            self.nodes[i] = self.func(self.nodes[2*i+1], self.nodes[2*i+2])

    def query(self,l,r):
        l += self.n
        r += self.n
        s = self.unit
        while l < r:
            if r & 1:
                r -= 1
                s = self.func(self.nodes[r-1], s)
            if l & 1:
                s = self.func(s, self.nodes[l-1])
                l += 1
            l >>= 1
            r >>= 1
        return s

segt = SegTree([0]*300001, lambda x,y:max(x,y), 0)
for a in A:
    l = max(0,a-K)
    r = min(300001,a+K+1)
    m = segt.query(l,r)
    segt.update(a,m+1)

print(segt.query(0,300001))

### FIXED CODE ###

import sys
input = sys.stdin.readline
N,K = map(int,input().split())
A = [int(input()) for i in range(N)]

class SegTree:
    def __init__(self,arr,func,unit):
        self.func = func
        self.unit = unit
        n = 1
        while n < len(arr):
            n *= 2
        self.n = n
        nodes = [unit]*(2*n-1)
        nodes[n-1:n-1+len(arr)] = arr
        for i in range(n-2,-1,-1):
            nodes[i] = func(nodes[2*i+1],nodes[2*i+2])
        self.nodes = nodes

    def update(self,i,val):
        i += self.n-1
        self.nodes[i] = val
        while i >= 0:
            i = (i - 1) // 2
            self.nodes[i] = self.func(self.nodes[2*i+1], self.nodes[2*i+2])

    def query(self,l,r):
        l += self.n
        r += self.n
        s = self.unit
        while l < r:
            if r & 1:
                r -= 1
                s = self.func(self.nodes[r-1], s)
            if l & 1:
                s = self.func(s, self.nodes[l-1])
                l += 1
            l >>= 1
            r >>= 1
        return s

segt = SegTree([0]*300001, lambda x,y:max(x,y), 0)
for a in A:
    l = max(0,a-K)
    r = min(300001,a+K+1)
    m = segt.query(l,r)
    segt.update(a,m+1)

print(segt.query(0,300001))
### BUGGY CODE ###

# -*- coding: utf-8 -*-

import sys

N,P = map(int, raw_input().split())
a = map(int, raw_input().split())

count_0 = 0
count_1 = 0
number = 0

def comb(n,r):
    if n < 0 or r < 0 or n < r:
        return 0
    elif n == 0 or r == 0:
        return 1
    else:
        return comb(n-1,r-1)+comb(n-1,r)

for i in range(N):
    if a[i] % 2 == 0:
        count_0 += 1
    else:
        count_1 += 1


if P == 0:
    if count_1 == 0:
        number = 1
    else:
        for j in range(count_1 /2 +1):
            number += comb(count_1,2*j)
else:
    if count_1 != 0:
        if count_1 % 2 == 0:
            for j in range(1,count_1 / 2 + 1):
                number += comb(count_1,2*j - 1)
        else:
            for j in range(1,count_1/2 + 2):
                number += comb(count_1, 2*j - 1)

if number != 0:
    print number * (2**count_0)
else:
    print number


### FIXED CODE ###

# -*- coding: utf-8 -*-

import sys

N,P = map(int, raw_input().split())
a = map(int, raw_input().split())

count_0 = 0
count_1 = 0
number = 0

def comb(n, r):
    r = min(r, n - r)
    if r == 0: return 1;
    if r == 1: return n;
    numerator = [n - r + i + 1 for i in range(r)]
    denominator  = [i + 1 for i in range(r)]
    for p in range(2, r + 1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p - 1, r, p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot
    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= numerator[k]
    return result

for i in range(N):
    if a[i] % 2 == 0:
        count_0 += 1
    else:
        count_1 += 1


if P == 0:
    if count_1 == 0:
        number = 1
    else:
        for j in range(count_1 /2 +1):
            number += comb(count_1,2*j)
else:
    if count_1 != 0:
        if count_1 % 2 == 0:
            for j in range(1,count_1 / 2 + 1):
                number += comb(count_1,2*j - 1)
        else:
            for j in range(1,count_1/2 + 2):
                number += comb(count_1, 2*j - 1)

if number != 0:
    print number * (2**count_0)
else:
    print number
### BUGGY CODE ###

import sys

def main():

	input = sys.stdin.readline

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

	ips = [0]*(N)
	for i, val in enumerate(P):
		ips[val-1] = i
	P.sort(reverse=True)

	x = 0
	largeind = [-1,-1,N,N]
	for i in range(N):
		target = ips[P[i]-1]

		largeind.append(target)
		largeind.sort(reverse=True)
		ti = largeind.index(target)

		L1ind = largeind[ti-1]
		L2ind = largeind[ti-2]
		R1ind = largeind[ti+1]
		R2ind = largeind[ti+2]

		x += ((L1ind-L2ind)*(R1ind-target) + (target-L1ind)*(R2ind-R1ind))*P[i]

	print(x)

if __name__ == "__main__":
    main()


### FIXED CODE ###

import sys

def main():

	input = sys.stdin.readline

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

	RR = [i+1 for i in range(N)]
	LL = [i-1 for i in range(N)]
	ips = [0]*(N)
	for i, val in enumerate(P):
		ips[val-1] = i
	P.sort()

	x = 0
	for i in range(N):
		target = ips[P[i]-1]
		R1ind = RR[target]
		R2ind = RR[ min(R1ind,N-1) ]
		L1ind = LL[target]
		L2ind = LL[ max(L1ind,0) ]

		x += ((L1ind-L2ind)*(R1ind-target) + (target-L1ind)*(R2ind-R1ind))*P[i]

		if L1ind!=-1:
			RR[L1ind] = R1ind
		if R1ind!=N:
			LL[R1ind] = L1ind

	print(x)

if __name__ == "__main__":
    main()
### BUGGY CODE ###

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

def reduce_gcd(lst):
    ans = lst.pop(0)
    for i in lst:
        ans = gcd(ans,i)
    return ans

def other_lst(lst,index):
    return [x for i,x in enumerate(lst) if not i == index]

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

print(max([reduce_gcd(other_lst(A,i)) for i in range(len(A)) ]))

### FIXED CODE ###

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

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

left_gcd = [A[0]]
for i in A[1:]:
    left_gcd.append(gcd(left_gcd[-1],i))

right_gcd = [A[-1]]
for i in reversed(A[0:-1]):
    right_gcd.append(gcd(right_gcd[-1],i))
right_gcd.reverse()

gcd_lst = [right_gcd[1]] + [gcd(right_gcd[i+1], left_gcd[i-1]) for i in range(1,len(A)-1)] + [left_gcd[-2]]
print(max(gcd_lst))
### BUGGY CODE ###

from collections import deque
N, K = list(map(int, input().split()))

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

score = [0]*N
dq = deque()

for i in range(0, K):
    dq.append(A[i])
score_now = 1
for i in range(len(dq)):
    score_now *= dq[i]

for j in range(K-1, N-1):
    score[j] = score_now

    left = dq.popleft()
    score_now /= left
    dq.append(A[j+1])
    score_now *= A[j+1]
score[N-1] = score_now


for k in range(K, N):
    if score[k] > score[k-1]:
        print("Yes")
    else:
        print("No")


### FIXED CODE ###

N, K = list(map(int, input().split()))
K -= 1
A = list(map(int, input().split()))

index = 0
left = A[index]

for i in range(K+1, N):

    if A[index] < A[i]:
        print("Yes")
    else:
        print("No")

    index += 1
### BUGGY CODE ###

import sys

input = sys.stdin.readline

def main():
    def hash_ini(t):
        h = t[0]
        hash_table.append(h)
        p = 1
        for i in range(1, len(t)):
            h = (h * base + t[i]) % hash_md
            hash_table.append(h)
            p = p * base % hash_md
            pw.append(p)

    def hash(s):
        res = 0
        for i, c in enumerate(s[::-1]):
            res = (res + pw[i] * (ord(c) - ord_a)) % hash_md
        return res

    # インデックスがi以上j未満の文字列のハッシュ
    def hash_ij(i, j):
        return (hash_table[j] - hash_table[i] * pw[j - i]) % hash_md

    n = int(input())
    s = input()[:-1]

    # 初期化
    base = 29
    hash_md = pow(3, 37)
    ord_a = ord('a')
    t = [ord(c) - ord_a for c in s]
    hash_table = [0]
    pw = [1]
    hash_ini(t)

    for w in range(n // 2, 0, -1):
        for i in range(n - 2 * w + 1):
            ptn = hash_ij(i, i + w)
            for j in range(i + w, n - w + 1):
                if hash_ij(j, j + w) == ptn:
                    print(w)
                    exit()
    print(0)

main()


### FIXED CODE ###

# YouTube
def main():
    n = int(input())
    s = input()
    dp = [[0] * (n + 1) for _ in range(n + 1)]
    for i, c in enumerate(s):
        for j in range(n):
            if c == s[j]:
                dp[i + 1][j + 1] = dp[i][j] + 1
    ans = 0
    for i in range(n):
        for j in range(i+1,n+1):
            tmp=min(dp[i][j],j-i)
            ans=max(tmp,ans)
    print(ans)

main()
### BUGGY CODE ###

N, K, L = map(int, input().split())
links1 = [tuple(map(int, input().split())) for _ in range(K)]
links2 = [tuple(map(int, input().split())) for _ in range(L)]

linked1 = {i: set([i]) for i in range(1, N + 1)}
linked2 = {i: set([i]) for i in range(1, N + 1)}

for p, q in links1:
    set1 = linked1[p]
    set2 = linked1[q]
    merged = set1.union(set2)
    for i in merged:
        linked1[i] = merged

for r, s in links2:
    set1 = linked2[r]
    set2 = linked2[s]
    merged = set1.union(set2)
    for i in merged:
        linked2[i] = merged

counts = []
for n in range(1, N + 1):
    set1 = linked1[n]
    set2 = linked2[n]
    counts.append(str(len(set1.intersection(set2))))

print(' '.join(counts))

### FIXED CODE ###

from collections import Counter


class UnionFind:

    def __init__(self, n: int) -> None:
        self.parent = [i for i in range(n)]
        self.rank = [0 for _ in range(n)]

    def find(self, i: int) -> None:
        if self.parent[i] == i:
            return i
        else:
            return self.find(self.parent[i])

    def unite(self, i: int, j: int) -> None:
        root_i = self.find(i)
        root_j = self.find(j)
        if root_i == root_j:
            return
        if self.rank[root_i] < self.rank[root_j]:
            self.parent[root_i] = root_j
        else:
            self.parent[root_j] = root_i
            if self.rank[root_i] == self.rank[root_j]:
                self.rank[root_i] += 1

                
N, K, L = map(int, input().split())

uf1 = UnionFind(N)
for _ in range(K):
    i, j = map(int, input().split())
    uf1.unite(i - 1, j - 1)

uf2 = UnionFind(N)
for _ in range(L):
    i, j = map(int, input().split())
    uf2.unite(i - 1, j - 1)

set_id_pairs = [(uf1.find(i), uf2.find(i)) for i in range(N)]
counter = Counter(set_id_pairs)
counts = [counter[set_id_pairs[i]] for i in range(N)]
print(' '.join(str(c) for c in counts))
### BUGGY CODE ###

from collections import deque
n = int(input())
Ps = list(map(lambda x: int(x)-1, input().split()))
cost = [min(min(i, n-1-i), min(j, n-1-j)) for i in range(n) for j in range(n)]
DIRC = [(-1, 0), (0, 1), (1, 0), (0, -1)]
exist = [1]*(n**2)


def to_idx(p):
    i, j = divmod(p, n)
    return i, j


def to_v(i, j):
    return i*n+j


def bfs(init_v):
    next_v = deque([to_idx(init_v)])
    exist[init_v] = 0
    while next_v:
        i, j = next_v.popleft()
        c = cost[to_v(i, j)]+exist[to_v(i, j)]
        for di, dj in DIRC:
            x, y = i+di, j+dj
            if x < 0 or y < 0 or n <= x or n <= y:
                continue
            if cost[to_v(x, y)] <= c:
                continue
            cost[to_v(x, y)] = c
            next_v.append((x, y))


ans = 0
for p in Ps:
    ans += cost[p]
    bfs(p)
print(ans)

### FIXED CODE ###

from collections import deque
n = int(input())
Ps = list(map(lambda x: int(x)-1, input().split()))
cost = [min(i, n-1-i, j, n-1-j) for i in range(n) for j in range(n)]
exist = [1]*(n**2)


def to_idx(p):
    return divmod(p, n)


def to_v(i, j):
    return i*n+j


def bfs(init_v):
    next_v = deque([init_v])
    exist[init_v] = 0
    while next_v:
        v = next_v.popleft()
        i, j = to_idx(v)
        if 0 < i:
            v2 = v-n
            if cost[v2] > cost[v]+exist[v]:
                cost[v2] = cost[v]+exist[v]
                next_v.append(v2)

        if i < n-1:
            v2 = v+n
            if cost[v2] > cost[v]+exist[v]:
                cost[v2] = cost[v]+exist[v]
                next_v.append(v2)

        if 0 < j:
            v2 = v-1
            if cost[v2] > cost[v]+exist[v]:
                cost[v2] = cost[v]+exist[v]
                next_v.append(v2)

        if j < n-1:
            v2 = v+1
            if cost[v2] > cost[v]+exist[v]:
                cost[v2] = cost[v]+exist[v]
                next_v.append(v2)

ans = 0
for p in Ps:
    ans += cost[p]
    bfs(p)
print(ans)
### BUGGY CODE ###

import math
#n=input()
n,m=map(int,input().split())
#a=list(map(int,input().split()))
l=[list(map(int,input().split())) for i in range(m)]

ll=[[] for i in range(n)]

for i in range(m):
    ll[l[i][0]-1].append(l[i][1])
    ll[l[i][1]-1].append(l[i][0])

lll=[0 for i in range(n)]
lll[0]=-1
lt=[False for i in range(n)]
lt[0]=True
r=0


while all(lt)!=True:
    if r==0:
        for i in ll[0]:
            lll[i-1]=1
            lt[i-1]=True
        r=ll[0]
    else:
        rr=[]
        for i in r:
            for j in ll[i-1]:
                if lll[j-1]==0:
                    lll[j-1]=i
                    lt[j-1]=True
        for i in r:
            rr+=ll[i-1]
        r=rr
print("Yes")
for i in range(1,n):
    print(lll[i])
    

### FIXED CODE ###

#n=int(input())
n,m=map(int,input().split())
#a=list(map(int,input().split()))
l=[list(map(int,input().split())) for i in range(m)]

ll=[[]for i in range(n)]

for i in range(m):
    ll[l[i][0]-1].append(l[i][1])
    ll[l[i][1]-1].append(l[i][0])

lt=[0 for i in range(n)]
lll=[1]
for i in range(n):
    for j in ll[lll[i]-1]:
        if (j!=1 and lt[j-1]==0):
            lll.append(j)
            lt[j-1]=lll[i]

print("Yes")
for i in range(1,n):
    print(lt[i])
### BUGGY CODE ###

from collections import deque

n = int(input())
a = input()
ans = ""

for i in range(1,n+1):
    if i == 1:
        ans = str(a.count(str(i)))
    else:
        ans = ans + "\n" + str(a.count(str(i)))

print(ans)


### FIXED CODE ###

from collections import deque

n = int(input())
a = list(map(int,input().split()))
ans = [0] * n

for i in a:
    ans[i-1] += 1

for j in ans:
    print(j)
### BUGGY CODE ###

def pop(x):
    binary = []
    while True:
        if x == 1:
            binary.append(x)
            break
        q,mod = divmod(x,2)
        binary.append(mod)
        x = q
    return sum(binary)

N = int(input())
X = list(map(int,list(input())))

pop_X = sum(X)
X_10 = sum([X[i]*2**(N-i-1) for i in range(N)])


for i in range(N):
    count = 0
    Xi_10 = X_10 + 2**(N-i-1) if X[i]==0 else X_10 - 2**(N-i-1)
    pop_Xi = pop_X + 1 if X[i]==0 else pop_X -1
    if pop_Xi == 0:
        print(count)
        continue
    while True:
        r = Xi_10 % pop_Xi
        count+= 1
        if r == 0:
            break
        Xi_10 = r
        pop_Xi = pop(r)
    print(count)


### FIXED CODE ###

N = int(input())
X = input()

pop_X = sum(map(int,list(X)))
X_10 = int('0b'+X,2)

r_0 = X_10%(pop_X+1)
diff_0 = 1%(pop_X+1)

zero_flag = False
if pop_X == 1:
    zero_flag = True
else:
    r_1 = X_10%(pop_X-1)
    diff_1 = 1%(pop_X-1)

answer = []


for i in range(N)[::-1]:
    if X[i]=='0':
        r = (r_0+diff_0)%(pop_X+1)
    else:
        if zero_flag:
            answer.append(0)
            diff_0 = (diff_0*2)%(pop_X+1)
            continue
        else:
            r = (r_1-diff_1)%(pop_X-1)
    count = 1
    while True:
        if r == 0:
            break
        pop = sum(map(int,list(bin(r)[2:])))
        r = r % pop
        count += 1
        
    answer.append(count)
    diff_0 = (diff_0*2)%(pop_X+1)
    if zero_flag:
        continue
    diff_1 = (diff_1*2)%(pop_X-1)

for i in answer[::-1]:
    print(i)
### BUGGY CODE ###

def MAP(): return list(map(int,input().split()))
def INT(): return int(input())
def FLOAT(): return float(input())
MOD = 998244353


n = INT()
d = MAP()

if d[0]!=0:
    print(0)
    exit(0)

ans=1
for i in range(1,max(d)+1):
    ans*=pow(d.count(i-1),d.count(i),MOD)
    ans %= MOD
print(ans)

### FIXED CODE ###

def MAP(): return list(map(int,input().split()))
def INT(): return int(input())
def FLOAT(): return float(input())
MOD = 998244353


n = INT()
d = MAP()

if d[0]!=0 or not all(d[1:]):
    print(0)
    exit(0)

l = [0]*(max(d)+1)
for i in d:
    l[i]+=1

ans=1
for i in range(1,max(d)+1):
    ans*=pow(l[i-1],l[i],MOD)
    ans %= MOD
print(ans)
### BUGGY CODE ###

import sys

import numpy as np

input = sys.stdin.readline
N, weights = map(int, input().split())

dp = [0] * (weights + 1)
# dp = np.zeros(weights + 1, dtype=np.int64)

while N:
    w, v = map(int, input().split())
    # np.maximum(dp[:-w] + v, dp[w:], out=dp[w:])
    for i in range(weights, -1, -1):
        if i - w >= 0:
            dp[i] = max(dp[i], dp[i - w] + v)
    # print(dp)
    N -= 1
print(dp[-1])


### FIXED CODE ###

import numpy as np

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

# dp = [0] * (weights + 1)
dp = np.zeros(weights + 1, dtype=np.int64)

while N:
    w, v = map(int, input().split())
    np.maximum(dp[:-w] + v, dp[w:], out=dp[w:])
    # for i in range(weights, -1, -1):
    #     if i - w >= 0:
    #         dp[i] = max(dp[i], dp[i - w] + v)
    # print(dp)
    N -= 1
print(dp[-1])
### BUGGY CODE ###

# -*- coding:utf-8 -*-
N = int(input())
a = list(map(int, input().split()))
b = [ tmp for tmp in a if tmp%4 == 0 ]
c = [ tmp for tmp in a if tmp%2 == 0 and tmp not in b ]
d = [ tmp for tmp in a if tmp%2 != 0 ]
if len(c) != 0 and len(b)-len(d) >= 0:
    print("Yes")
elif len(c) == 0 and len(b)+1 >= len(d):
    print("Yes")
else:
    print("No")

### FIXED CODE ###

# -*- coding:utf-8 -*-
N = int(input())
factor = 0
a = list(map(int, input().split()))
b = [ tmp for tmp in a if tmp%4 == 0 ]
c = [ tmp for tmp in a if tmp%2 == 0 ]
d = [ tmp for tmp in a if tmp%2 != 0 ]
if len(c)-len(b) != 0 and len(b)-len(d) >= 0:
    print("Yes")
elif len(c)-len(b) == 0 and len(b)+1 >= len(d):
    print("Yes")
else:
    print("No")