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

n,a,b=map(int,input().split())
firs=2**n-1
#conbination_algorithm
def kaijo(k):
    sum=1
    for j in range(1,k+1):
        sum*=j
    return sum
def comb(n,k):
    ans=int(kaijo(n))/(int(kaijo(k))*int(kaijo(n-k)))
    return int(ans)
#subtract
sub_1=comb(n,a)+comb(n,b)
print((firs-sub_1)%(10**9+7))

### FIXED CODE ###

n, a, b = map(int, input().split())
mod = 10**9+7
def comb(n, r, mod):
    if r == 0 or r == n:
        return 1
    r = min([r, n-r])
    x, y = 1, 1
    for i in range(1, r+1):
        x *= n+1-i
        x %= mod
        y *= i
        y %= mod
    return x*pow(y, mod-2, mod)%mod

ans = (pow(2, n, mod)-1-comb(n, a, mod)-comb(n, b, mod))%mod
print(ans)
### BUGGY CODE ###

import numpy as np

def main():
    L, R = list(map(int, input().split()))
    minmod = 10000000
    for i in range(L, R):
        for j in range(i+1, R+1):
            prod = i * j
            #mod = prod % 2019
            mod = np.mod([prod], 2019)[0]
            if mod < minmod:
                minmod = mod
    print(minmod)

main()

### FIXED CODE ###

def main():
    L, R = list(map(int, input().split()))
    minmod = 10000000
    for i in range(L, R):
        for j in range(i+1, R+1):
            prod = i * j
            mod = prod % 2019
            #mod = np.mod([prod], 2019)[0]
            if mod < minmod:
                minmod = mod
            if minmod < 1:
                break
        else: continue
        break
    print(minmod)

main()
### BUGGY CODE ###

n=int(input())
s=[""]*n
st=set()
r=0
for ii in range(n):
  ss=list(input())
  ss.sort()
  ss="".join(ss)
  s[ii]=ss
  st.add(ss)

if len(st)==n:
  print(0)
  exit()
if len(st)==1:
  print((n*(n-1))//2)
  exit()

tp=[[""]*2 for ii in range(len(st))]
ii=0
for sss in st:
  tp[ii][0]=s.count(sss)
  tp[ii][1]=sss
  ii+=1
tp.sort(reverse=True)
"""
for ii in range(len(tp)):
  print(tp[ii])
"""
for jj in range(len(tp)):
  if tp[jj][0]==1:
    print(r)
    exit()
  sss=tp[jj][1]
  ls=[]
  r2=0
  for ii in range(len(s)):
    if s[ii]==sss:
      ls.append(ii)
      r2+=1
  m=len(ls)
  for ii in range(m):
    del s[ls[m-1-ii]]
  if r2>1:
    r+=(r2*(r2-1))//2      
    
print(r)

### FIXED CODE ###

n=int(input())
s=[""]*n
st=set()
d={}
for ii in range(n):
  ss=list(input())
  ss.sort()
  ss="".join(ss)
  if ss in st:
    d[ss]+=1
  else:
    d[ss]=1
    st.add(ss)

if len(st)==n:
  print(0)
  exit()
if len(st)==1:
  print((n*(n-1))//2)
  exit()

r=0
for sss in st:
  c=d[sss]
  if c>1:
    r+=(c*(c-1))//2
    
print(r)
### BUGGY CODE ###

n, a, b = map(int,input().split())
#print(n,a,b)

import math

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

l = [int(i) for i in range(1,n+1)]
#print(l)

x = 0
for j in range(n):
    x += combinations_count(n, l[j])

y = combinations_count(n, a) + combinations_count(n, b)

print((x-y)%(10**9+7))




### FIXED CODE ###

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

mod = 10**9+7
total = pow(2,n,mod) - 1 # 制約なしの全パターン_n**2-1※'-1'は0本の花束

# n個からr個を選択した時のパターン総数
# n! / (r! * (n-r)!) → nが大き過ぎて出来ない →変形→ n*(n-1)*･･･(n-r+1) ↓関数化
def nCr(n, r, mod):
    numerator=1 #分子
    for i in range(n-r+1, n+1):
        numerator = (numerator*i) % mod

    denominator=1 #分母
    for j in range(1,r+1):
        denominator = (denominator*j) % mod
    # 割るとよくない → 逆元を掛ける
    # フェルマーの小定理_modが素数なら1/aの逆元は a**(mod-2)
    return (numerator * pow(denominator,mod-2,mod)) % mod
    
ans = (total - nCr(n,a,mod) - nCr(n,b,mod)) % mod
print(ans)
### BUGGY CODE ###

n,k = [int(x) for x in input().split()]
h = [int(x) for x in input().split()]
dp = [float('inf')]*n
dp[-1] = 0
dp[-2] = abs(h[-1]-h[-2])

for i in range(n-3,-1,-1):
  for j in range(i+1,min(i+k+1,n)):
    dp[i] = min(dp[i],dp[j]+abs(h[i]-h[j]))
                
print(dp[0])


### FIXED CODE ###

n,k = [int(x) for x in input().split()]
h = [int(x) for x in input().split()]
dp = [float('inf')]*n
dp[-1] = 0
dp[-2] = abs(h[-1]-h[-2])

for i in range(n-3,-1,-1):
  for j in range(i+1,min(i+k+1,n)):
    dp[i] = min(dp[i],dp[j]+abs(h[i]-h[j]))
                
print(dp[0])
### BUGGY CODE ###

n, m = map(int, input().split())
groups = []
flag = [0 for i in range(n)]
for i in range(m):
    a, b = map(int, input().split())
    temp = {a, b}
    if flag[a-1] == 1 or flag[b-1] == 1:
        for j in range(len(groups)):
            if temp & groups[j]:
                groups[j] |= temp
    else:
        groups.append(temp)
    flag[a-1] = 1
    flag[b-1] = 1

print(len(groups)+flag.count(0)-1)

### FIXED CODE ###

class UnionFind:
    def __init__(self, n):
        self.r = [-1 for i in range(n)]
    
    def root(self, x):
        if self.r[x] < 0:
            return x
        self.r[x] = self.root(self.r[x])
        return self.r[x]
    
    def unite(self, x, y):
        x = self.root(x)
        y = self.root(y)
        if x == y:
            return False
        if self.r[x] < self.r[y]:
            temp = x
            x = y
            y = temp
        self.r[x] += self.r[y]
        self.r[y] = x
        return True
    
    def size(self, x):
        return -self.r[self.root(x)]

n, m = map(int, input().split())
UF = UnionFind(n)
for i in range(m):
    a, b = map(lambda x: int(x)-1, input().split())
    UF.unite(a, b)

ans = 0
for i in UF.r:
    if i < 0:
        ans += 1

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

#4問目
count = 0
N = int(input())
S = list(input())
for i in range(N):
    for j in range(N):
        for k in range(N):
            if(i <= j and j <= k):
                if(S[i] != S[j] and S[i] != S[k] and S[j] != S[k]):
                    if((j - i) != (k - j)):
                        count+=1
print(count)

### FIXED CODE ###

# 先に組み合わせの数を決める
# RとGとBの数を先に数え上げると、Rの数 * Gの数 * Bの数が組み合わせの数になる
# 累積和でもできる

#組み合わせの数は
kumiawase = 0
countR=0
countG=0
countB=0
N = int(input())
S = list(input())
for i in range(N):
    if(S[i] == "R"):
        countR += 1
    elif(S[i] == "G"):
        countG += 1
    elif(S[i] == "B"):
        countB += 1
kumiawase = countR * countG * countB

count = 0
#その組み合わせの数から、j-i = k-jをみたす数を引けばいい
#条件を満たし、かつ1つ目の条件を満たすものは
for i in range(N):
    for j in range(i+1, N):
        k = 2 * j - i
        if(k < N):
            if(S[i] != S[j] and S[i] != S[k] and S[j] != S[k]):
                count+=1

print(kumiawase - count)
### BUGGY CODE ###

def is_prime(q, k=50):
    """ ??????????????????????´???°?????????????????¨??????????????????????????°????´???°???????????????????????????
    http://d.hatena.ne.jp/pashango_p/20090704/1246692091
    """
    import random
    q = abs(q)
    # ?¨???????????????§?????????????????§????????????????????????
    if q == 2: return True
    if q < 2 or q & 1 == 0: return False

    # n-1=2^s*d??¨????????????a?????´??°???d????\???°)???d????±???????
    d = (q - 1) >> 1
    while d & 1 == 0:
        d >>= 1

    # ?????????k?????°?????????
    for i in range(k):
        a = random.randint(1, q - 1)
        t = d
        y = pow(a, t, q)
        # [0,s-1]??????????????????????????§??????
        while t != q - 1 and y != 1 and y != q - 1:
            y = pow(y, 2, q)
            t <<= 1
        if y != q - 1 and t & 1 == 0:
            return False
    return True


def find_nth_prime(n):
    """ n???????????§????´???°????±??????? """
    count = 0
    num = 2
    result = []
    while True:
        if is_prime(num):
            count += 1
            result.append(num)
        if count >= n:
            break
        num += 1
        #print(count, num)
    return result


if __name__ == '__main__':
    # ??????????????\???
    while True:
        data = int(input())
        if data == 0:
            break

        # ????????¨???????????¨???
        result = find_nth_prime(data)
        print(sum(result))

### FIXED CODE ###

import random

def is_prime(q, k=50):
    """ ??????????????????????´???°?????????????????¨??????????????????????????°????´???°???????????????????????????
    http://d.hatena.ne.jp/pashango_p/20090704/1246692091
    """
    q = abs(q)
    # ?¨???????????????§?????????????????§????????????????????????
    if q == 2: return True
    if q < 2 or q & 1 == 0: return False

    # n-1=2^s*d??¨????????????a?????´??°???d????\???°)???d????±???????
    d = (q - 1) >> 1
    while d & 1 == 0:
        d >>= 1

    # ?????????k?????°?????????
    for i in range(k):
        a = random.randint(1, q - 1)
        t = d
        y = pow(a, t, q)
        # [0,s-1]??????????????????????????§??????
        while t != q - 1 and y != 1 and y != q - 1:
            y = pow(y, 2, q)
            t <<= 1
        if y != q - 1 and t & 1 == 0:
            return False
    return True


Primes = []
def find_nth_prime(n):
    """ n??????????´???°????±??????? """
    count = len(Primes)
    if count >= n:
        return
    if count > 0:
        num = Primes[-1] + 1
    else:
        num = 2
    while True:
        if is_prime(num):
            count += 1
            Primes.append(num)
        if count >= n:
            break
        num += 1


if __name__ == '__main__':
    # ??????????????\???
    while True:
        data = int(input())
        if data == 0:
            break

        # ????????¨???????????¨???
        find_nth_prime(data)
        # print(Primes)
        print(sum(Primes[:data]))
### BUGGY CODE ###

#!/usr/bin/env python3
def Z(S):
    n = len(S)
    LCP = [0]*n
    i = 1
    j = c = 0
    # c : 最も末尾側までLCPを求めたインデックス
    for i in range(1, n):
        # i番目からのLCPが以前計算したcからのLCPに含まれている場合
        if i+LCP[i-c] < c+LCP[c]:
            LCP[i] = LCP[i-c]
        else:
            j = max(0, c+LCP[c]-i)
            while i+j < n and S[j] == S[i+j]: j+=1
            LCP[i] = j
            c = i
    LCP[0] = n
    return LCP

a = 0
n, s = open(0)
for i in range(int(n)):
    for j, l in enumerate(Z(s[i:])):
        a = max(a, min(l, j))
print(a)

### FIXED CODE ###

def Z(S):
    n = len(S)
    LCP = [0]*n
    i = 1
    j = c = 0
    # c : 最も末尾側までLCPを求めたインデックス
    for i in range(1, n):
        # i番目からのLCPが以前計算したcからのLCPに含まれている場合
        if i+LCP[i-c] < c+LCP[c]:
            LCP[i] = LCP[i-c]
        else:
            j = max(0, c+LCP[c]-i)
            while i+j < n and S[j] == S[i+j]: j+=1
            LCP[i] = j
            c = i
    LCP[0] = n
    return LCP

a = 0
n, s = open(0)
for i in range(int(n)):
    for j, l in enumerate(Z(s[i:])):
        a = max(a, min(l, j))
print(a)
### BUGGY CODE ###

n = int(input())
xy = [list(map(int,input().split())) for i in range(n)]
cheby = []
for i in range(n):
    l = [xy[i][0]-xy[i][1],xy[i][0]+xy[i][1]]
    cheby.append(l)

ans = 0
for i in range(n):
    for j in range(i,n):
        d = max(abs(cheby[i][0]-cheby[j][0]),abs(cheby[i][1]-cheby[j][1]))
        if d >= ans :
            ans = d
            x = i
            y = j
print(abs(xy[x][0]-xy[y][0])+abs(xy[x][1]-xy[y][1]))


### FIXED CODE ###

n = int(input())
xy = [list(map(int,input().split())) for i in range(n)]
cheby = []
for i in range(n):
    l = [xy[i][0]-xy[i][1],xy[i][0]+xy[i][1]]
    cheby.append(l)

xmax = -10**10
xmin = 10**10
ymax = -10**10
ymin = 10**10
for i in range(n):
    if cheby[i][0] > xmax :
        xmax = cheby[i][0]
        xa = i
    if cheby[i][0] < xmin :
        xmin = cheby[i][0]
        xi = i
    if cheby[i][1] > ymax :
        ymax = cheby[i][1]
        ya = i
    if cheby[i][1] < ymin :
        ymin = cheby[i][1]
        yi = i

if abs(xmax-xmin) > abs(ymax-ymin):
    print(abs(xy[xa][0]-xy[xi][0])+abs(xy[xa][1]-xy[xi][1]))
else :
    print(abs(xy[ya][0]-xy[yi][0])+abs(xy[ya][1]-xy[yi][1]))
### BUGGY CODE ###

K, S = [int(i) for i in input().split()]
cnt = 0 
for x in range(0,K+1):
  for y in range(0,K+1):
    z = S - (x + y)
    if K >= x and K >= y and K >= z and z >= 0:
      cnt += 1
print(cnt)

### FIXED CODE ###

K, S = [int(i) for i in input().split()]
cnt = 0 
for x in range(0,K+1):
  if 0 <= S - x <= K:
    cnt += S - x + 1
  elif 0 <= S - x <= 2*K:
    cnt += 2*K - S + x + 1
print(cnt)
### BUGGY CODE ###

n,m = map(int,input().split())
ab = []
cost = [[] for _ in range(n+1)]
for _ in range(m):
    a, b = (int(x) for x in input().split())
    ab.append([a, b])
    cost[a].append(b)

for i in range(n+1):
    cost[i].sort()

#print(cost)
for i,j in ab:
    ID = cost[i].index(j)+1
    i = str(i)
    i = (6-len(i))*'0'+i
    ID = str(ID)
    ID = (6-len(ID))*'0'+ID
    print(i+ID)

### FIXED CODE ###

n,m = map(int,input().split())
py = []
p_y = [[] for i in range(n)]
for _ in range(m):
    p,y = map(int,input().split())
    py.append((p,y))
    p_y[p-1].append(y)
ans = {}
for i, tmp in enumerate(p_y):
    cnt = 1
    p_y[i] = tmp.sort()
    for j, jj in enumerate(tmp):
 
        ans[(i+1, jj)] = str(i+1).zfill(6) + str(j+1).zfill(6)
 
 
for i, tmp in enumerate(py):
    print(ans[tmp])
### BUGGY CODE ###

#coding:utf-8


if __name__ == "__main__":
    N, M = map(int, input().split())
    city_list = []
    pref_dec = {}
    for m in range(M):
        p, y = map(int, input().split())
        city_list.append((p, y))
        if p not in pref_dec:
            pref_dec[p] = []
        pref_dec[p].append(y)

    for p in pref_dec.keys():
        pref_dec[p].sort()

    for m in range(M):
        p_id = city_list[m][0]
        y_id = pref_dec[p_id].index(city_list[m][1]) + 1
        print(str(p_id).zfill(6) + str(y_id).zfill(6))


### FIXED CODE ###

#coding:utf-8
#参考：https://beta.atcoder.jp/contests/abc113/submissions/3806710


if __name__ == "__main__":
    N, M = map(int, input().split())
    city_list = []
    for i in range(M):
        p, y = map(int, input().split())
        city_list.append([i, p, y])

    city_count = {}
    order_dic = {}
    for i, p, y in sorted(city_list, key = lambda x: x[2]):
        if not p in city_count:
            city_count[p] = 0
        city_count[p] += 1
        order_dic[i, p] = city_count[p]

    for i, p, y in city_list:
        print("{:06}{:06}".format(p, order_dic[i,p]))
### BUGGY CODE ###

from math import sqrt
from fractions import gcd
from collections import defaultdict
from copy import deepcopy

N = int(input())
A = list(map(int,input().split()))
mod = 10**9+7

p = [1]*(1001)
P = []  #1000までの素数表
p[0] = p[1] = 0
for x in range(2, int(sqrt(1000000))+1):
    if p[x]:
        P.append(x)
        for y in range(x*x, 1001, x):
            p[y] = 0

B = [defaultdict(int) for i in range(N)]  #N個の数を素因数分解したもの
lcm = defaultdict(int)  #N個の数のlcmを素因数分解したもの

for i in range(N):
    for j in P:
        if A[i] % j == 0:
            while A[i] % j == 0:
                A[i] //= j
                B[i][j] += 1
        lcm[j] = max(lcm[j],B[i][j])
    if A[i] != 1:
        B[i][A[i]] = 1
        lcm[A[i]] = 1

l = 1  #N個の数のlcm
for i in lcm.keys():
    l = (l*pow(i,lcm[i],mod)) % mod

ans = 0
#l/A[i]の和を求めていく
for i in range(N):
    r = l
    for j in list(B[i].keys()):
        r = (r*pow(j,mod-B[i][j]-1,mod)) % mod
    ans = (ans + r) % mod

print(ans)

### FIXED CODE ###

def main():
    from math import sqrt
    from fractions import gcd
    from collections import defaultdict
    from copy import deepcopy

    N = int(input())
    A = list(map(int, input().split()))
    mod = 10 ** 9 + 7

    p = [1] * (1001)
    P = []  # 1000までの素数表
    p[0] = p[1] = 0
    for x in range(2, int(sqrt(1000000)) + 1):
        if p[x]:
            P.append(x)
            for y in range(x * x, 1001, x):
                p[y] = 0

    B = [defaultdict(int) for i in range(N)]  # N個の数を素因数分解したもの
    lcm = defaultdict(int)  # N個の数のlcmを素因数分解したもの

    for i in range(N):
        for j in P:
            if A[i] % j == 0:
                while A[i] % j == 0:
                    A[i] //= j
                    B[i][j] += 1
            lcm[j] = max(lcm[j], B[i][j])
        if A[i] != 1:
            B[i][A[i]] = 1
            lcm[A[i]] = 1

    l = 1  # N個の数のlcm
    for i in lcm.keys():
        l = (l * pow(i, lcm[i], mod)) % mod

    ans = 0
    # l/A[i]の和を求めていく
    for i in range(N):
        r = l
        for j in list(B[i].keys()):
            r = (r * pow(j, mod - B[i][j] - 1, mod)) % mod
        ans = (ans + r) % mod

    print(ans)

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

# coding: utf-8
# Your code here!

from collections import deque
from pprint import pprint
moves=[(0,1),(1,0),(0,-1),(-1,0)]
pp=pprint
# INF=float("inf")

h,w,k=map(int,input().split())
x1,y1,x2,y2=map(lambda x:int(x)-1,input().split())
maze=[list(input()) for _ in range(h)]
cost=[[-1]*w for _ in range(h)]

todo=deque()
todo.append((x1,y1))
cost[x1][y1]=0

while todo:
    x,y=todo.popleft()
    for vx,vy in moves:
        for kk in range(1,k+1):
            nx=x+vx*kk
            ny=y+vy*kk
            if not(0<=nx<h) or not(0<=ny<w):
                break
                # 更に伸ばす必要はない
            if maze[nx][ny]=="@":
                break
                # 蓮の向こうにはいけない
            # if cost[nx][ny]!=-1 and cost[nx][ny]<=cost[x][y]:
            #     # 更新を1回以上受けていて、更に良くならない場合はbreak
            #     break
            if cost[nx][ny]==-1:
                cost[nx][ny]=cost[x][y]+1
                todo.append((nx,ny))


# pp(cost)
ans=cost[x2][y2]
print(ans)

### FIXED CODE ###

# coding: utf-8
# Your code here!

from collections import deque
from pprint import pprint
moves=[(0,1),(1,0),(0,-1),(-1,0)]
pp=pprint
# INF=float("inf")

h,w,k=map(int,input().split())
x1,y1,x2,y2=map(lambda x:int(x)-1,input().split())
maze=[list(input()) for _ in range(h)]
cost=[[-1]*w for _ in range(h)]

todo=deque()
todo.append((x1,y1))
cost[x1][y1]=0

while todo:
    x,y=todo.popleft()
    for vx,vy in moves:
        for kk in range(1,k+1):
            nx=x+vx*kk
            ny=y+vy*kk
            if not(0<=nx<h) or not(0<=ny<w):
                continue
            if maze[nx][ny]=="@":
                break
            if cost[nx][ny]!=-1 and cost[nx][ny]<=cost[x][y]:
                break
            if cost[nx][ny]!=-1:
                continue
            cost[nx][ny]=cost[x][y]+1
            todo.append((nx,ny))


# pp(cost)
ans=cost[x2][y2]
print(ans)
### BUGGY CODE ###

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

if max(a)==min(a):
  print(n)
else:
  ans=1
  b=[0]*(10**6)
  for i in range(max(a)+1):
    b[i]=a.count(i)
  for i in range(10**5+3):
    ans=max(ans,b[i]+b[i+1]+b[i+2])
  print(ans)

### FIXED CODE ###

import collections
n=int(input())
a=list(map(int,input().split()))
c=collections.Counter(a)
ans=1
for i in range(min(a),max(a)+1):
  goukei=c[i-1]+c[i]+c[i+1]
  ans=max(ans,goukei)
print(ans)
### BUGGY CODE ###

N = int(input())
A = list(map(int,input().split()))
thres = 10**18
res = A[0]
for i in range(N-1):
    res *= A[i+1]
    if res > thres and 0 not in A:
        res = -1
        break
print(res)

### FIXED CODE ###

N = int(input())
A = list(map(int,input().split()))
thres = 10**18
res = A[0]
if 0 in A:
    print(0)
    exit()
for i in range(N-1):
    res *= A[i+1]
    if res > thres:
        res = -1
        break
print(res)
### BUGGY CODE ###

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

ans = 0

for i in range(N-1):
    for j in range(i+1,N):
        ans += A[i] ^ A[j]

print(ans%1000000007)

### FIXED CODE ###

import numpy as np

N = int(input())
arr = np.array([int(i) for i in input().split()])

ans = 0

for i in range(60):
    c1 = np.count_nonzero(arr & 1)
    ans += 2 ** i * c1 * (N-c1)
    arr >>= 1


print(ans%1000000007)
### BUGGY CODE ###

from random import choice
from time import time
d = int(input())
*C, = map(int, input().split())
S = [list(map(int, input().split())) for i in range(d)]
X = []
L = [-1 for j in range(26)]
for i in range(d):
    max_diff = -10**10
    best_j = 0
    for j in range(26):
        memo = L[j]
        L[j] = i
        diff = S[i][j] - sum([C[jj] * (i - L[jj]) for jj in range(26)])
        if diff > max_diff:
            max_diff = diff
            best_j = j
        L[j] = memo
    L[best_j] = i
    X.append(best_j)


def f(X):
    score = 0
    L = [-1 for j in range(26)]
    A = [0 for j in range(26)]
    for i in range(d):
        score += S[i][X[i]]
        A[X[i]] += (i - L[X[i]]) * (i - L[X[i]] - 1) // 2
        L[X[i]] = i
    for j in range(26):
        A[j] += (d - L[j]) * (d - L[j] - 1) // 2
        score -= C[j] * A[j]
    return score


max_score = f(X)
start_time = time()
while time() - start_time < 1.9:
    i = choice(range(d))
    j = choice(range(26))
    memo = X[i]
    X[i] = j
    score = f(X)
    if score > max_score:
        max_score = score
    else:
        X[i] = memo
    a = choice(range(5))
    i0 = choice(range(d - a))
    i1 = i0 + a
    memo = X[i0], X[i1]
    X[i0], X[i1] = X[i1], X[i0]
    score = f(X)
    if score > max_score:
        max_score = score
    else:
        X[i0], X[i1] = memo
for x in X:
    print(x + 1)


### FIXED CODE ###

import random

d = int(input())
dd = d * (d + 1) // 2
*C, = map(int, input().split())
S = [list(map(int, input().split())) for i in range(d)]
T = [random.choice(range(26)) for i in range(d)]
score = 0

for _ in range(10**5):
    p = random.choice(range(d))
    q = random.choice(range(26))
    memo = T[p]
    T[p] = q
    L = [-1 for j in range(26)]
    X = [0 for j in range(26)]
    tmp = 0
    for i in range(d):
        tmp += S[i][T[i]]
        X[T[i]] += (d - i) * (i - L[T[i]])
        L[T[i]] = i
    for j in range(26):
        tmp -= C[j] * (dd - X[j])
    if tmp > score:
        score = tmp
    else:
        T[p] = memo

for t in T:
    print(t + 1)
### BUGGY CODE ###

import sys
stdin = sys.stdin
mod = 10**9 + 7

def ns(): return stdin.readline().rstrip()
def ni(): return int(ns())
def na(): return list(map(int, stdin.readline().split()))

N, K, Q = na()
A = [0 for _ in range(N)]
for _ in range(Q):
    a = ni()
    A[a-1] += 1
for i in range(N):
    if sum(A) - A[i] < K:
        print("Yes")
    else:
        print("No")

### FIXED CODE ###

import sys
stdin = sys.stdin
mod = 10**9 + 7

def ns(): return stdin.readline().rstrip()
def ni(): return int(ns())
def na(): return list(map(int, stdin.readline().split()))

N, K, Q = na()
A = [0 for _ in range(N)]
for _ in range(Q):
    a = ni()
    A[a-1] += 1
sumA = sum(A)
for a in A:
    if sumA - a < K:
        print("Yes")
    else:
        print("No")
### BUGGY CODE ###

N = int(input())
alist = list(map(int,input().split()))
b = []
for a in alist:
    b.append(a)
    b = b[::-1]
ans = str(b[0])
for bb in b[1:]:
    ans = ans + " " + str(bb)
print(ans)

### FIXED CODE ###

N = int(input())
alist = list(input().split())
if N % 2 == 0:
    a1 = alist[1::2]
    a2 = alist[0::2]
    a1.reverse()
    a1.extend(a2)
else:
    a1 = alist[0::2]
    a2 = alist[1::2]
    a1.reverse()
    a1.extend(a2)
c = ' '.join(a1)
print(c)
### BUGGY CODE ###

def distinct_or_not(a_list):
    tmp_list = []
    for a in a_list:
        if len(tmp_list) == 0:
            tmp_list.append(a)
        else:
            left = 0
            right = len(tmp_list) - 1
            while left <= right:
                mid = (left + right) // 2
                if tmp_list[mid] == a:
                    return 'NO'
                elif tmp_list[mid] > a:
                    right = mid - 1
                else:
                    left = mid + 1
            tmp_list.insert(right+1, a)
    return 'YES'

n = int(input())
a_list = [int(a) for a in input().split()]

print(distinct_or_not(a_list))

### FIXED CODE ###

def distinct_or_not_2(a_list):
    a_list.sort()
    for i in range(len(a_list)-1):
        if a_list[i] == a_list[i+1]:
            return 'NO'
    return 'YES'

n = int(input())
a_list = [int(a) for a in input().split()]

print(distinct_or_not_2(a_list))
### BUGGY CODE ###

n, k = map(int, input().split())
s = [] 
mod = 998244353

for i in range(k):
    l, r = map(int, input().split())
    s.append([l, r])

dp = [0 for _ in range(n+1)]
dp[1] = 1
dpsum = [0 for _ in range(n+1)]
dpsum[1] = 1

for i in range(2,n+1):
    for l, r in s:
        li = max(i-r,1)
        ri = max(i-l,0)
        dp[i] += dpsum[ri] - dpsum[li-1]
    dpsum[i] = dpsum[i-1] + dp[i]

print(dp[n]%mod)

### FIXED CODE ###

n, k = map(int, input().split())
s = [] 
mod = 998244353

for i in range(k):
    l, r = map(int, input().split())
    s.append([l, r])

dp = [0 for _ in range(n+1)]
dp[1] = 1
dpsum = [0 for _ in range(n+1)]
dpsum[1] = 1

for i in range(2,n+1):
    for l, r in s:
        li = max(i-r,1)
        ri = max(i-l,0)
        dp[i] += (dpsum[ri] - dpsum[li-1])%mod
    dpsum[i] = (dpsum[i-1] + dp[i])%mod

print(dp[n]%mod)