Harryxun/stf_run huggingface dataset:
#D
import numpy as np
import math
def power(x, y, mod):
    if y == 0:
        t = 1
    elif y == 1:
        t = x % mod
    elif y % 2 == 0:
        t = (power(x, int(y/2), mod) ** 2) % mod
    else:
        t = (x * (power(x, int(y/2), mod) ** 2)) % mod
    return t
    
    
def frac_mod(n, mod, f=1):
    for i in range(1, n + 1):
        f = (f * i) % mod
    return f

def ifrac_mod(n, mod, f_inv=1):
    for i in range(n, 1, -1):
        f_inv = (f_inv * power(i, mod-2, mod)) % mod
    return f_inv

def cmb_mod(n, r, mod):
    n_frac = frac_mod(n, mod)
    n_r_ifrac = ifrac_mod(n-r, mod)
    r_ifrac = ifrac_mod(r, mod)
    
    return int((n_frac * n_r_ifrac * r_ifrac) % mod)
mod = 10**9+7
x,y = map(int, input().split())
a = np.array([[1,2], [2,1]])
b = np.array([x,y])
res = np.linalg.solve(a,b)
is_ok = True
if not (res[0].is_integer() and res[1].is_integer()):
    is_ok = False
    ans = 0
x_res = int(res[0])
y_res = int(res[1])
if is_ok:
    ans = cmb_mod(x_res+y_res, x_res, mod)
print(ans)

### FIXED CODE ###

## D
import numpy as np
import math

def cmb(n, k, mod):
    numerator = 1
    for i in range(k):
        numerator = (numerator * (n-i)) % mod
 
    denominator = 1
    for i in range(1, k+1):
        denominator = (denominator * i) % mod
 
    return (numerator * pow(denominator, mod-2, mod)) % mod
    
    return int((n_frac * n_r_ifrac * r_ifrac) % mod)

mod = 10**9+7
x,y = map(int, input().split()) 
is_ok = True
b = (2 * x - y) / 3
a = x - 2 * b
if not (a.is_integer() and b.is_integer()):
    ans = 0
    is_ok = False
    
a = int(a)
b = int(b)
if a < 0 or b < 0:
    ans = 0
    is_ok = False
if is_ok:    
    ans = cmb(a+b, a, mod)
print(ans)
hight = input().split()
num = [int(n) for n in hight]
print(sorted(num)[-1])
print(sorted(num)[-2])
print(sorted(num)[-3])


### FIXED CODE ###

num = [int(input()) for i in range(10)]
num.sort(reverse=True)
for i in range(3):
    print(num[i])
AC = 0
WA = 0
TLE = 0
RE = 0
N = int(input())
for i in range(N):
	a = input()
	if(a == "AC"):
		AC = AC + 1
	if(a == "WA"):
 		WA = WA + 1
	if(a == "TLE"):
		TLE = TLE + 1
	if(a=="RE"):
		RE = RE + 1
print("AC x "+ str(AC))
print("WA x "+ str(WA))
print("TLE x "+ str(TLE))
print("RE x "+ str(RE))

### FIXED CODE ###

N = int(input())
if(N%1000==0):
	print("0")
else:
  	print(1000-N%1000)
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

N = int(input())
A = [[n-1 for n in list(map(int, input().split()))] + [-1] for _ in range(N)]
A = [a[::-1] for a in A]

def main(N, A):
    now = [A[i].pop() for i in range(N)]
    day = 0
    rest = N * (N-1)

    # WCS O(N**2) <- 1日に1試合だけのときN(N-1)/2回while文が繰り返される
    while True:
        # terminal condition
        # O(1)
        if rest == 0:
            return day

        # see if we have match today
        have_match = False
        # O(N)
        tmp = now.copy()
        for i in range(N):
            if now[now[i]] == i:
                tmp[i] = A[i].pop()
                rest -= 1
                have_match = True
        now = tmp
        if not have_match:
            return -1
        day += 1

print(main(N, A))

### FIXED CODE ###

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

N = int(input())
A = [[n-1 for n in list(map(int, input().split()))] + [-1] for _ in range(N)]
A = [a[::-1] for a in A]

def main(N, A):
    now = [A[i].pop() for i in range(N)]
    day = 0
    rest = N * (N-1)
    candidate = set(range(N))

    # WCS O(N**2) <- 1日に1試合だけのときN(N-1)/2回while文が繰り返される
    while True:
        # terminal condition
        # O(1)
        if rest == 0:
            return day

        # see if we have match today
        # O(N)
        have_match = False
        # tmp = now.copy()
        # for i in range(N):
        #     if now[now[i]] == i:
        #         tmp[i] = A[i].pop()
        #         rest -= 1
        #         have_match = True
        # now = tmp
        change = []
        next_candidate = set()
        for i in candidate:
            if now[now[i]] == i:
                j = A[i].pop()
                change.append((i, j))
                # あとで(a, b)でnow[a] = bに更新する
                next_candidate.add(i)
                if j != -1:
                    next_candidate.add(j)
                
                rest -= 1
                have_match = True

        if len(change) == 0:
            return -1
        for (a, b) in change:
            now[a] = b
            
        candidate = next_candidate
        
        day += 1

print(main(N, A))
# -*- coding: utf-8 -*-
import math

N = input()
# print(N)
ai = input().split()
# print(ai)
num = 0
for i in range(N/2):
    if ai[i + 1] % 2 == 1:
        num += 1

print(num)

### FIXED CODE ###

# -*- coding: utf-8 -*-
import math

N = int(input())
# print(N)
ai = input().split(' ')
# print(ai)
num = 0
for i in range(N):
    if i % 2 == 0:
        if int(ai[i]) % 2 == 1:
            # print('asd' + str(i))
            # print('hoge' + str(ai[i*2]))
            num += 1

print(num)
N, M = [int(i) for i in input().split()]
A = sorted([s for s in input().split()], reverse=True)
numDict = {"1":2, "2":5, "3":5, "4":4, "5":5, "6":6, "7":3, "8":7, "9":6}
dp = ["" for _ in range(N + 1)]

for i in range(N + 1):
    for strNum in A:
        if i - numDict[strNum] == 0 and dp[i] == "":
            dp[i] = strNum

        preStrNum = dp[i - numDict[strNum]]
        if preStrNum != "":
            if len(preStrNum) + 1 > len(dp[i]) or \
            len(preStrNum) + 1 == len(dp[i]) and int(preStrNum[0]) > int(strNum):
                dp[i] = "{0}{1}".format(preStrNum, strNum)

print(dp[N])


### FIXED CODE ###

N, M = [int(i) for i in input().split()]
A = sorted([s for s in input().split()], reverse=True)
numDict = {"1":2, "2":5, "3":5, "4":4, "5":5, "6":6, "7":3, "8":7, "9":6}
dp = ["" for _ in range(N + 1)]

for i in range(N + 1):
    for strNum in A:
        if i - numDict[strNum] < 0:
            continue
        if i - numDict[strNum] == 0 and dp[i] == "":
            dp[i] = strNum
        preStrNum = dp[i - numDict[strNum]]
        if preStrNum != "":
            if len(preStrNum) + 1 > len(dp[i]):
                dp[i] = preStrNum + strNum

print("".join(sorted(dp[N], reverse=True)))
I = [input() for i in range(2)]
sn = int(I[0])
ss = str(I[1])
if sn%2 == 1 :
    A = 'No' 
else:
    sl = int(sn/2) 
    print(sl)
    if sl >= 2 : 
        H1 = ss[:sl]
        H2 = ss[sl:]
    elif sl == 1 :
        H1 = ss[0]
        H2 = ss[1]
    if  H1 == H2 :
        A = 'Yes'
    else:
        A = 'No'
print(A)

### FIXED CODE ###

rad = int(input())
S = round(rad*rad,0)
print(S)
x, n = map(int, input().split())
if n == 0:
  print(x)
  exit(0)
p = list(map(int, input().split()))
a = [i for i in range(1,101)]
b = list(set(a) - set(p))
for i in range(len(b)):
  if x < b[i]:
    if abs(b[i-1]-x) <= abs(b[i]-x):
      print(b[i-1])
      exit(0)
    else:
      print(b[i])
      exit(0)
print(x-b[-1])

### FIXED CODE ###

x, n = map(int, input().split())
if n == 0:
  print(x)
  exit(0)
p = list(map(int, input().split()))
a = [i for i in range(201)]
b = sorted(list(set(a) - set(p)))
min_v = 1000
min_id = 0
for i in range(len(b)):
  if abs(x - b[i]) < min_v:
    min_v = abs(x - b[i])
    min_id = i
print(b[min_id])
inf = 10**18
mod = 10**9+7

N = 10**6+1
inv_t = [0]+[1]

for i in range(2,N):
    inv_t += [inv_t[mod % i] * (mod - int(mod / i)) % mod]

def moddiv(a, b):
    return a*inv_t[b]%mod

n = int(input())
a = list(map(int, input().split()))
tmp = 1
for num in a:
    f = math.gcd(tmp,num)
    tmp = tmp*num%mod
    tmp = moddiv(tmp, f)
ans = 0
for num in a:
    ans += moddiv(tmp, num)
    ans %= mod

print(ans)

### FIXED CODE ###

# input()
# int(input())
# map(int, input().split())
# list(map(int, input().split()))
# list(map(int, list(input()))) # スペースがない数字リストを読み込み
import math
import sys
import bisect
import heapq  # 優先度付きキュー(最小値取り出し)
from collections import deque

inf = 10**18
mod = 10**9+7

dic = {}

# mod で割り算(フェルマー、逆元利用)
mod = 10**9+7

N = 10**6+1
inv_t = [0]+[1]

for i in range(2,N):
    inv_t += [inv_t[mod % i] * (mod - int(mod / i)) % mod]

def moddiv(a, b):
    return a*inv_t[b]%mod

"""nを素因数分解"""
"""2以上の整数n => [[素因数, 指数], ...]の2次元リスト"""
def factorization(n):
    arr = []
    temp = n
    if n == 1:
        return arr

    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

n = int(input())
a = list(map(int, input().split()))
j = []
for num in a:
    tmp = factorization(num)
    j.append(tmp)
    for p,x in tmp:
        if p in dic:
            dic[p] = max(dic[p],x)
        else:
            dic[p] = x
gc = 1
for k,v in dic.items():
    gc*=(k**v)%mod
ans = 0
for num in a:
    ans += moddiv(gc, num)
    ans %= mod
print(ans)
N=list(input())

n=reversed(N)

if (n[0]=="2" or n[0]=="4" or n[0]=="5" or n[0]=="7" or n[0]=="9"):
    print("hon")
elif (n[0]=="0" or n[0]=="1" or n[0]=="6" or n[0]=="8"):
    print("pon")
else:
    print("bon")


### FIXED CODE ###

n=list(input())

n==n.reverse()

if (n[0]=="2" or n[0]=="4" or n[0]=="5" or n[0]=="7" or n[0]=="9"):
    print("hon")
elif (n[0]=="0" or n[0]=="1" or n[0]=="6" or n[0]=="8"):
    print("pon")
elif (n[0]=="3"):
    print("bon")
from collections import deque

h, w = map(int, input().split())
field = []
for i in range(h):
    field.append(input())

out = 0
for i in range(h):
    for j in range(w):
        if field[i][j] == '.':
            seen = [[0 for m in range(w)] for n in range(h)]
            seen[i][j] = 1
            q = deque([])
            q.append((i, j, 0))

            while q:
                y, x, cnt = q.popleft()
                # print(y, x, cnt)
                seen[y][x] = 1
                for ny, nx in [(y, x + 1), (y, x - 1), (y + 1, x), (y - 1, x)]:
                    if 0 <= ny < h and 0 <= nx < w and not seen[ny][nx]:
                        if field[ny][nx] == '.':
                            q.append((ny, nx, cnt + 1))
        out = max(out, cnt)
print(out)


### FIXED CODE ###

from collections import deque

h, w = map(int, input().split())
field = []

for i in range(h):
    field.append(list(input()))

out = 0
for i in range(h):
    for j in range(w):
        if field[i][j] == '.':
            seen = [[0 for m in range(w)] for n in range(h)]
            seen[i][j] = 1
            q = deque([])
            q.append((i, j, 0))
            while q:
                (y, x, cnt) = q.popleft()
                # print(y,x)
                # print(seen)
                for ny, nx in (y, x + 1), (y, x - 1), (y + 1, x), (y - 1, x):
                    if ny < 0 or ny >= h or nx < 0 or nx >= w:
                        pass
                    elif field[ny][nx] == '.' and seen[ny][nx] == 0:
                        q.append((ny, nx, cnt + 1))
                        seen[ny][nx] = 1

            out = max(out, cnt)
print(out)
#!/usr/bin/env python3
def main():
    N, K = map(int, input().split())
    A = list(map(int, input().split()))
    m = 10**9+7
    p = []
    q = []
    r = []
    for i in range(N):
        if A[i] > 0:
            p.append(A[i])
        elif A[i] < 0:
            q.append(-A[i])
        else:
            r.append(A[i])
    
    if len(p) + len(q) < K:
        print(0)
        exit()
    
    p.sort()
    q.sort()
    if len(p) > 0:
        # pの小さい２つとqの大きい２つを取り換えていく
        i = min(K, len(p))
        j = 0
        while i >= 0 and j < len(q)-1:
            if p[len(p)-i]*p[len(p)-i+1] < q[len(q)-j-1]*q[len(q)-j-2]:
                i -= 2
                j += 2
            else:
                break
        ans = 1
        # print(i,j)
        for k in range(max(0,i)):
            ans = ans * p[len(p)-k-1] % m
        for l in range(min(len(q),j)):
            ans = ans * q[len(q)-l-1] % m
        print(ans)
    else:
        if K % 2 == 0:
            if len(q) >= K:
                ans = 1
                for i in range(K):
                    ans = ans * q[i] % m
                print(ans)
            else:
                print(0)
        else:
            if len(r) > 0:
                print(0)
            else:
                ans = 1
                for i in range(K):
                    ans = ans * q[i] % m
                print(-ans % m)

if __name__ == "__main__":
    main()


### FIXED CODE ###

N, K = map(int, input().split())
A = list(map(int, input().split()))
m = 10**9+7
pos = [*filter(lambda x: x>=0, A)]
neg = [*filter(lambda x: x<0, A)]
pos.sort(reverse=True)
neg.sort()

ans = 1
i,j = 0,0# 使った数
while i+j < K:
    flag = True
    if i == len(pos):
        flag = False
    elif j == len(neg):
        flag = True
    elif pos[i] >= -neg[j]:
        flag = True
    else:
        flag = False

    if flag:
        ans = ans * pos[i] % m
        i += 1
    else:
        ans = ans * neg[j] % m
        j += 1

if j % 2 == 0 or N==K:
    print(ans)
elif len(pos) == 0:
    ans = 1
    for i in range(K):
        ans = ans * neg[len(neg)-1-i] % m
    print(ans)
else:
    flag2 = True
    if i == 0:
        flag2 = True
    elif j == 0:
        flag2 = False
    elif i == len(pos):
        flag2 = False
    elif j == len(neg):
        flag2 = True
    elif pos[i-1]*pos[i] > neg[j-1]*neg[j]:# = を抜いた
        flag2 = True
    else:
        flag2 = False

    if flag2:
        ans = ans * pow(neg[j-1],m-2,m) % m
        ans = ans * pos[i] % m
    else:
        ans = ans * pow(pos[i-1],m-2,m) % m
        ans = ans * neg[j] % m
    print(ans)
import sys
input = sys.stdin.readline

N = int(input())
VW = [[int(x)-1 for x in input().split()] for _ in range(N-1)]

"""
直径に次数1の頂点が生えている
"""

graph = [[] for _ in range(N)]
deg = [0] * (N)
for v,w in VW:
    graph[v].append(w)
    graph[w].append(v)
    deg[v] += 1
    deg[w] += 1

def dijkstra(start):
    INF = 10**10
    dist = [INF] * N
    q = [(start,0)]
    while q:
        qq = []
        for v,d in q:
            dist[v] = d
            for w in graph[v]:
                if dist[w] == INF:
                    qq.append((w,d+1))
        q = qq
    return dist

dist = dijkstra(0)
v = dist.index(max(dist))
dist = dijkstra(v)
w = dist.index(max(dist))
diag = v,w

def create_perm(v,parent,next_p,arr):
    next_v = None
    V1 = []
    V2 = []
    for w in graph[v]:
        if w == parent:
            continue
        if deg[w] == 1:
            V1.append(w)
        else:
            V2.append(w)
    if len(V1) == len(V2) == 0:
        arr.append(next_p)
        return
    next_v = V2[0] if V2 else V1.pop()
    arr += list(range(next_p+1,next_p+len(V1)+1))
    arr.append(next_p)
    next_p += len(V1)+1
    create_perm(next_v,v,next_p,arr)

P = [] * N
create_perm(diag[1],None,1,P)

Q = [] * N
create_perm(diag[0],None,1,Q)

if len(P) != N:
    answer = -1
else:
    if P > Q:
        P = Q
    answer = ' '.join(map(str,P))
print(answer)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readline

N = int(input())
VW = [[int(x)-1 for x in input().split()] for _ in range(N-1)]

"""
直径に次数1の頂点が生えている
"""

graph = [[] for _ in range(N)]
deg = [0] * N
for v,w in VW:
    graph[v].append(w)
    graph[w].append(v)
    deg[v] += 1
    deg[w] += 1

def dijkstra(start):
    INF = 10**10
    dist = [INF] * N
    q = [(start,0)]
    while q:
        qq = []
        for v,d in q:
            dist[v] = d
            for w in graph[v]:
                if dist[w] == INF:
                    qq.append((w,d+1))
        q = qq
    return dist

dist = dijkstra(0)
v = dist.index(max(dist))
dist = dijkstra(v)
w = dist.index(max(dist))
diag = v,w

def create_perm(start):
    arr = []
    v = start
    parent = None
    next_p = 1
    while True:
        n = 0
        next_v = None
        for w in graph[v]:
            if w == parent:
                continue
            if next_v is None or deg[next_v] < deg[w]:
                next_v = w
            if deg[w] == 1:
                n += 1
        if next_v is None:
            return arr + [next_p]
        if deg[next_v] == 1:
            n -= 1
        arr += list(range(next_p+1,next_p+n+1))
        arr.append(next_p)
        next_p += n+1
        parent = v
        v = next_v

P = create_perm(diag[1])

Q = create_perm(diag[0])

if len(P) != N:
    answer = -1
else:
    if P > Q:
        P = Q
    answer = ' '.join(map(str,P))
print(answer)
import collections
s = input()
t = input()
s = collections.Counter(s)
t = collections.Counter(t)
if sorted(s.values()) == sorted(t.values):
  print("Yes")
else:
  print("No")

### FIXED CODE ###

import collections
s = input()
t = input()
s = collections.Counter(s)
t = collections.Counter(t)
if sorted(s.values()) == sorted(t.values()):
  print("Yes")
else:
  print("No")
import numpy as np
n,m=map(int,input().split())
d=[[] for i in range(n)]
l=[]
for i in range(m):
    a,b=map(int,input().split())
    d[a-1].append(b)
    l.append(a)
x=[[] for i in range(n)]
for i in range(n):
    d[i]=list(np.argsort(d[i]))
    tmp=[0]*len(d[i])
    for j in range(len(d[i]):
        tmp[d[i][j]]=j+1
    x[i]=tmp
for i in range(m):
    b=x[l[i]-1].pop(0)
    b+=1
    p=len(list(str(l[i])))
    q=len(list(str(b)))
    ans=''
    for j in range(6-p):
        ans+='0'
    ans+=str(l[i])
    for j in range(6-q):
        ans+='0'
    ans+=str(b)
    print(ans)


### FIXED CODE ###

n,m=map(int,input().split())
l=[]
for i in range(m):
    a,b=map(int,input().split())
    l.append([a,b])
x=sorted(l)
dic={}
x.append([0,0])
f=1
for i in range(m):
    if x[i][0]==x[i+1][0]:
        dic[str(x[i][0])+'000000'+str(x[i][1])]=f
        f+=1
    else:
        dic[str(x[i][0])+'000000'+str(x[i][1])]=f
        f=1
for i in range(m):
    b=dic[str(l[i][0])+'000000'+str(l[i][1])]
    p=len(list(str(l[i][0])))
    q=len(list(str(b)))
    ans=''
    for j in range(6-p):
        ans+='0'
    ans+=str(l[i][0])
    for j in range(6-q):
        ans+='0'
    ans+=str(b)
    print(ans)
n = int(input())
a = list(map(int, input().split()))
a1 = []
a2 = []
for i in range(n):
    if i % 2 == 0:
        a1.append(a[i])
    else:
        a2.append(a[i])
if n % 2 == 0:
    rev = reversed(a2)
    print(*rev, *a1)
else:
    rev = reversed(a1)
    print(*rev, *a2)


### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
a1 = []
a2 = []
for i in range(n):
    if i % 2 == 0:
        a1.append(a[i])
    else:
        a2.append(a[i])
if n % 2 == 0:
    a2.reverse()
    print(*a2+a1)
else:
    a1.reverse()
    print(*a1+a2)
# 入力
X = input()

# 以下に回答を記入
if X >= 30:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

# 入力
X = input()

# 以下に回答を記入
X = int(X)

if X >= 30:
    print('Yes')
else:
    print('No')
N = int(input())
steps = [int(i) for i in input().split()]
dp = [float('inf')]*N
for i in range(N):
  if i == 0:
    dp[0] = 0
    dp[1] = abs(steps[1] - steps[0])
    dp[2] = abs(steps[2] - steps[0])
  else:
    # 現在位置までのコスト + 隣に行くコスト　を登録済みのDPテーブルと比較し、小さい方で更新
    if i+1 < N:
    	dp[i+1] = min(abs(steps[i] - steps[i+1]) + dp[i], dp[i+1])
    if i+2 < N:
    	dp[i+2] = min(abs(steps[i] - steps[i+2]) + dp[i], dp[i+2])
print(dp[-1])

### FIXED CODE ###

N = int(input())

hights = [int(h) for h in input().split()]


eval = []

def chmin(a,b):
    if a > b:
        b = a
        return True
    return False

for i in range(N):
    if i == N:
        break
    elif i == 0:
        eval.append(0)
        continue
    elif i == 1:
        eval.append(abs(hights[i] - hights[i-1] ))
        continue

    to_next = abs(hights[i] - hights[i-1]) + eval[i-1]
    prev_to_next = abs(hights[i] - hights[i-2]) + eval[i-2]
    if prev_to_next > to_next:
        eval.append(to_next)
    else:
        eval.append(prev_to_next)
print(eval[N-1])
import sys
import time
import random
import math
from collections import deque
import heapq
import itertools
from decimal import Decimal
import bisect
from operator import itemgetter
MAX_INT = int(10e18)
MIN_INT = -MAX_INT
mod = 1000000000+7
sys.setrecursionlimit(1000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

def tami(ans):
  res = 0
  LastDay = [0]*26
  for i in range(D):
    res += s[i][ans[i]]
    for j in range(26):
      if ans[i] == j:
        continue
      res -= (i+1 - LastDay[j]) * c[j]
    LastDay[ans[i]] = i+1
  return res

def nasu():
  res = []
  LastDay = [0]*26
  for d in range(1,D+1):
    tmp = ["", 0]
    for i in range(26):
      if tmp[1] < s[d-1][i] + (d - LastDay[i]) * c[i]:
        tmp = [i, s[d-1][i] + (d - LastDay[i]) * c[i]]
    res.append(tmp[0])
    LastDay[tmp[0]] = d
  return res

def nbo(ans, score, num):
  tmp_ans = ans[:]
  for _ in range(num):
    random_date = random.randint(0,D-1)
    random_val = random.randint(0,25)
    tmp_ans[random_date] = random_val
  scoscore = tami(tmp_ans)
  if scoscore > score:
    return (True, tmp_ans, scoscore)
  else:
    return (False, tmp_ans, scoscore)

start = time.time()
D = I()
c = IL()
s = [IL() for i in range(D)]

ans = nasu()
ans = [0, 16, 10, 13, 19]
#print(ans)

score = tami(ans)
#print(score)

end = time.time()
num = 2
while (time.time() - start) < 1.8:
  judge, anans, scoscore = nbo(ans, score, num)
  if judge == True:
    ans, score = anans, scoscore
    #print(ans)
    #print(tami(ans))
for i in ans:
  print(i+1)

### FIXED CODE ###

import sys
import math
from collections import deque
import heapq
import itertools
from decimal import Decimal
import bisect
from operator import itemgetter
MAX_INT = int(10e18)
MIN_INT = -MAX_INT
mod = 1000000000+7
sys.setrecursionlimit(1000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

def tami(now, ContestType):
  res = c[ContestType] * (now - LastDay[ContestType])
  return res

D = I()
c = IL()
s = [IL() for i in range(D)]

LastDay = [0]*26
for i in range(1,D+1):
  tmp = ["", 0]
  for j in range(26):
    Dscore = tami(i, j)
    if Dscore > tmp[1]:
      tmp = [j, Dscore]
  print(tmp[0]+1)
  LastDay[tmp[0]] = i
from sys import exit


a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

num_list = [a, b, c, d, e]
len_num_list = len(num_list)

for i in range(len_num_list):
    for j in range(len_num_list):
        if i == j:
            pass
        else:
            tnum = abs(num_list[i] - num_list[j])
            if tnum > k:
                print(':(')
                exit()

if res == 0:
    print('Yay!')


### FIXED CODE ###

import numpy as np

N = 5
A = np.array([int(input()) for i in range(N)])
k = int(input())

xx, yy = np.meshgrid(A, A)
comb = np.c_[xx.flatten(), yy.flatten()]

diff_ = np.abs(comb[:, 0] - comb[:, 1])
max_diff = np.max(diff_)

if max_diff <= k:
    print('Yay!')
else:
    print(':(')
n = int(input())
Mnum = 0
Anum = 0
Rnum = 0
Cnum = 0
Hnum = 0
for i in range(n):
  a = input()
  if a[0] == "M":Mnum+=1
  elif a[0] == "A":Anum+=1
  elif a[0] == "R":Rnum+=1
  elif a[0] == "C":Cnum+=1
  elif a[0] == "H":Hnum+=1
alist = [Mnum,Anum,Rnum,Cnum,Hnum]
from itertools import combinations
blist =list(combinations(alist,3))
from functools import reduce
sum = 0
for i in range(len(blist)):
  sum+=reduce(mul,blist)
print(sum)

### FIXED CODE ###

n = int(input())
Mnum = 0
Anum = 0
Rnum = 0
Cnum = 0
Hnum = 0
for i in range(n):
  a = input()
  if a[0] == "M":
    Mnum+=1
  elif a[0] == "A":
    Anum+=1
  elif a[0] == "R":
    Rnum+=1
  elif a[0] == "C":
    Cnum+=1
  elif a[0] == "H":
    Hnum+=1
alist = []
alist.append(Mnum)
alist.append(Anum)
alist.append(Rnum)
alist.append(Cnum)
alist.append(Hnum)
from itertools import combinations
print(sum([a*b*c for a,b,c in combinations(alist,3)]))