Harryxun/stf_run huggingface dataset:
N = int(input())
ans = []
total = 0
for n in range(30001):
    if (n%2 == 0) ^ (n%3 == 0):
        ans.append(n)
        total += n
    if len(ans) == N: break

if total%2 == 0:
    i = N - 1
    while ans[i]%3 > 0:
        i -= 1
    ans[i] += 3

if total%3 == 0:
    i = N - 1
    while ans[i]%2 > 0:
        i -= 1
    ans[i] += 2

print(*ans)


### FIXED CODE ###

N = int(input())
if N == 3:
    print('2 5 63')
    exit()

ans = []
total = 0
for n in range(1,30001):
    if n%2 == 0 or n%3 == 0:
        ans.append(n)
        total += n
    if len(ans) == N: break

if total%6 == 1:
    i = N - 1
    while ans[i]%3 > 0:
        i -= 1
    ans[i] += 3
    i = N - 1
    while ans[i]%2 > 0:
        i -= 1
    ans[i] += 2

elif total%6 == 2:
    i = N - 1
    while ans[i]%2 > 0:
        i -= 1
    ans[i] += 4

elif total%6 == 3:
    i = N - 1
    while ans[i]%3 > 0:
        i -= 1
    ans[i] += 3

elif total%6 == 4:
    i = N - 1
    while ans[i]%2 > 0:
        i -= 1
    ans[i] += 2

elif total%6 == 5:
    i = N - 1
    while ans[i]%3 > 0:
        i -= 1
    ans[i] += 3
    i = N - 1
    while ans[i]%2 > 0:
        i -= 1
    ans[i] += 4

print(*ans)
# -*- coding: utf-8 -*-
N,K = map(int,input().split())
c = [int(input()) for i in range(N)]
c.sort()
output = c[K-1] - c[0]
for i in range(N-K):
    output = c[K+i] - c[i+1] if output > c[K+i] - c[i+1]
print(output)


### FIXED CODE ###

# -*- coding: utf-8 -*-
N,K = map(int,input().split())
c = [int(input()) for i in range(N)]
c.sort()
output = c[K-1] - c[0]
for i in range(N-K):
    if output > c[K+i] - c[i+1]:output = c[K+i] - c[i+1]
print(output)
# -*- coding: utf-8 -*-
from functools import reduce
import math

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

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

absList =[0] * len(toshiList)

for i in range(0,len(toshiList)):
    absList[i] = abs( toshiList[i] - X)

ans = reduce(math.gcd,absList)
    
print(ans)

### FIXED CODE ###

# -*- coding: utf-8 -*-
import fractions
from functools import reduce

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

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

absList =[0] * len(toshiList)

for i in range(0,len(toshiList)):
    absList[i] = abs( toshiList[i] - X)

ans = reduce(fractions.gcd,absList)
    
print(ans)
N, X, M = map(int, input().split())

nxt = X
lst = []
dic = {}

for i in range(M):
    if nxt in dic:
        loop_st = dic[nxt]
        loop_ed = i - 1
        break

    lst.append(nxt)
    dic[nxt] = i

    nxt = (nxt ** 2) % M


v = N - loop_st
q, r = divmod(v, loop_ed - loop_st + 1)

pre_sum = sum(lst[:loop_st])
loop_sum = q * sum(lst[loop_st:])
post_sum = sum(lst[loop_st:loop_st + r])
print(pre_sum + loop_sum + post_sum)

### FIXED CODE ###

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

nxt = X
lst = []
dic = {}

for i in range(M + 1):
    if nxt in dic:
        loop_st = dic[nxt]
        loop_ed = i - 1
        break

    lst.append(nxt)
    dic[nxt] = i

    nxt = (nxt ** 2) % M


v = N - loop_st
q, r = divmod(v, loop_ed - loop_st + 1)

pre_sum = sum(lst[:loop_st])
loop_sum = q * sum(lst[loop_st:])
post_sum = sum(lst[loop_st:loop_st + r])
print(pre_sum + loop_sum + post_sum)
a = int(input())
for i in range(9):
  t = a / (i+1)
  f = False
  if t == int(t) && t < 10:
    print(YES)
    f = True
if f == False:
  print(No)
    

### FIXED CODE ###

a = int(input())
f = False
for i in range(9):
    t = a / (i + 1)
    if t == int(t) and t < 10:
        print("Yes")
        f = True
        break
if not f:
    print('No')
N, K = map(int, input().split())
V = list(map(int, input().split()))
l = [0]
for i in range(1, K + 1): #左に何回操作するか
    #print("i=",i)
    b = 0
    for j in range(i // 2 + 1): #いくつ捨てるか
        #print("j=",j)
        a = []
        for m in range(i - j):
            a.append(V[m])
        a.sort()
        s = 0
        for m in range(i - j):
            if m >= j or a[m] >= 0:
                s += a[m]
        b = max(b, s)
    #print("b=",b)
    l.append(max(b, l[-1]))
#print(l)
r = [0]
for i in range(1, K + 1): #右に何回操作するか
    #print("i=",i)
    b = 0
    for j in range(i // 2 + 1): #いくつ捨てるか
        #print("j=",j)
        a = []
        for m in range(N - i + j, N):
            a.append(V[m])
        #print("s=",s)
        a.sort()
        s = 0
        for m in range(i - j):
            if m >= j or a[m] >= 0:
                s += a[m]
        b = max(b, s)
    #print("b=",b)
    r.append(max(b, r[-1]))
#print(r)
ans = 0
for i in range(K + 1):
    ans = max(ans, l[i] + r[K - i])
print(ans)


### FIXED CODE ###

N, K = map(int, input().split())
V = list(map(int, input().split()))
ans = 0
for i in range(N + 1):#左から何個とるか
    if i > K:
        break
    for j in range(N + 1):#右から何個とるか
        if i + j > N or i + j > K:
            break
        for l in range(N + 1):#何個捨てるか
            if i + j + l > K:
                break
            a = V[:i] + V[N-j:]
            a.sort()
            s = sum(a[l:])
            ans = max(ans, s)
print(ans)
from collections import deque

n,m,k = map(int,input().split())

cango = [[]for i in range(n)]
cannotgo=[[]for i in range(n)]
for i in range(m):
    a,b = (map(int,input().split()))
    a,b = a-1,b-1
    cango[a]=b
    cango[b]=a

for i in range(k):
    c,d =(map(int,input().split()))
    c,d = c-1,d-1
    cannotgo[c]=d
    cannotgo[d]=c
# print(a)
# cango = [[]for i in range(n)]
# for i in a:
#     cango[i[0]-1].append(i[1]-1)
#     cango[i[1]-1].append(i[0]-1)
# # print(cango)

# cannotgo=[[]for i in range(n)]
# for i in c:
#     cannotgo[i[0]-1].append(i[1]-1)
#     cannotgo[i[1]-1].append(i[0]-1)
# # print(cannotgo)
alre = [False]*n
parent = [-1]*n
gro = {}

# print(gro)
for i in range(n):
    if alre[i]==True:
        continue
    gro[i]=set([i])
    stack = [i]
    while stack:
        x = stack.pop()
        alre[x]=True
        parent[x]=i
        for to in cango[x]:
            if alre[to]:
                continue
            # print(to)
            gro[i].add(to)
            stack.append(to)
# print(gro)
# print(parent)
ans = [0]*n
# print(ans)
for iam in range(n):
    group = gro[parent[iam]]
    tmp_ans = len(group)-len(cango[iam])-1
    for block in cannotgo[iam]:
        if block in group:
            tmp_ans -=1
    ans[iam]=tmp_ans
print(*ans, sep=' ')

### FIXED CODE ###

from collections import deque

n,m,k = map(int,input().split())

cango = [[]for i in range(n)]
cannotgo=[[]for i in range(n)]
for i in range(m):
    a,b = (map(int,input().split()))
    a,b = a-1,b-1
    cango[a].append(b)
    cango[b].append(a)

for i in range(k):
    c,d =(map(int,input().split()))
    c,d = c-1,d-1
    cannotgo[c].append(d)
    cannotgo[d].append(c)
# print(a)
# cango = [[]for i in range(n)]
# for i in a:
#     cango[i[0]-1].append(i[1]-1)
#     cango[i[1]-1].append(i[0]-1)
# print(cango)

# cannotgo=[[]for i in range(n)]
# for i in c:
#     cannotgo[i[0]-1].append(i[1]-1)
#     cannotgo[i[1]-1].append(i[0]-1)
# # print(cannotgo)
alre = [False]*n
parent = [-1]*n
gro = {}
y = deque()
# print(gro)
for i in range(n):
    # if alre[i]==True:
    #     continue
    # gro[i]=set([i])
    y.append(i)
    leader = i
    cnt = 0 
    while len(y)>0:
        x = y.popleft()
        if parent[x]!=-1:
            continue
            # print(to)
        parent[x]=leader
        y.extend(cango[x])
        cnt +=1
    if cnt!=0:
        gro[leader]=cnt
# print(gro)
# print(parent)
ans = [0]*n
# print(ans)
for iam in range(n):
    # group = gro[parent[iam]]
    tmp_ans = gro[parent[iam]]
    tmp_ans -=1
    tmp_ans -= len(cango[iam])
    for block in cannotgo[iam]:
        if parent[block]==parent[iam] :
            tmp_ans -=1
    ans[iam]=tmp_ans
print(*ans, sep=' ')
if __name__ == '__main__':
    # n = 100
    # n = 9995
    # n = 3141592653589793
    n = input()

    ary = list(map(int, list(str(n))))

    # x..xxの全探索
    m = -1
    middle = [9 for i in range(0, len(ary[1:-2]))] # 数列の真ん中
    for i in range(0, 10):
        for j in range(0, 10):
            for k in range(0, 10):
                if m < sum([i] + middle + [j, k]) and int(''.join(map(str, [i] + middle + [j, k]))) <= n:
                    m = sum([i] + middle + [j, k])
    print(m)

### FIXED CODE ###

import sys

if __name__ == '__main__':
    # n = 100
    # n = 9995
    # n = 3141592653589793
    n = input()

    ary = list(map(int, list(str(n))))

    # ひと桁のときの対応
    if len(ary) == 1:
       print(sum(ary))
       sys.exit()

    # ふた桁のときの対応
    if len(ary) == 2:
        if sum(ary) <= 9:
            print(9)
            sys.exit()
        else:
            print(sum(ary))
            sys.exit()

    # すでに9が並んでたら上位を減らさない
    if ary[1:-1].count(9) != len(ary[1:-1]):
        ary[0] = ary[0] - 1
        ary[-2] = 9
        ary[-1] = 9

    # 真ん中はすべて9にする
    ary[1:-1] = [9 for i in range(0, len(ary[1:-1]))]

    # 下位が99 or 98でなかったら下位を89にする
    if sum(ary[-2:]) < 18:
        ary[-2] = 8
        ary[-1] = 9

    # print(ary)
    print(sum(ary))
a,b,x = map(int,input().split())
import math

if x//a<=(a*b/2):
  print(90-math.degrees(math.atan((2*x)/(a*(b**2)))))
    
else:
  print(90-math.degrees(math.atan(a/(2*(b-(x/a**2))))))

### FIXED CODE ###

a,b,x = map(int,input().split())
import math

if x==a**2*b:
  print(0)
elif x//a<=(a*b/2):
  print(90-math.degrees(math.atan((2*x)/(a*(b**2)))))
    
else:
  print(90-math.degrees(math.atan(a/(2*(b-(x/a**2))))))
W, H, N = [int(x) for x in input().strip().split()]
x_min = 0
y_min = 0

for i in range(N):
    x, y, a = [int(x) for x in input().strip().split()]
    if a == 1 and x_min < x:
        x_min = x
    elif a == 2 and W > x:
        W = x
    elif a == 3 and y_min < y:
        y_min = y
    elif a == 4 and H > y:
        H = y
    
if x_min > w or y_min > H:
    print('0')
else:
    print((W - x_min)*(H - y_min))

### FIXED CODE ###

W, H, N = [int(x) for x in input().strip().split()]
x_min = 0
y_min = 0

for i in range(N):
    x, y, a = [int(x) for x in input().strip().split()]
    if a == 1 and x_min < x:
        x_min = x
    elif a == 2 and W > x:
        W = x
    elif a == 3 and y_min < y:
        y_min = y
    elif a == 4 and H > y:
        H = y
    
if x_min > W or y_min > H:
    print('0')
else:
    print((W - x_min)*(H - y_min))
x,y = map(int,input().split())
while True
    if x == 0 and y == 0:
        break
    elif x < y:
        print(x,y)
    else:
        print(y,x)
        


### FIXED CODE ###

while True:
    x,y = map(int,input().split())

    if x == 0 and y == 0:
        break
    elif x < y:
        print(x,y)
    else:
        print(y,x)
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
need=sum(b)-sum(a)
import math
x=0
a.sort()
b.sort()
for i in range(n):
	if a[i]>b[i]:
		x+=a[i]-b[i]
	else:
		x+=math.ceil((b[i]-a[i])/2)
if x<=need:
	print("Yes")
else:
	print("No")


### FIXED CODE ###

x,y=map(int,input().split())
if x%y==0:
	print(-1)
else:
	print(x*(y-1))
n, k = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
ans = 1
mod = 10**9 + 7
c = 0
z = 0
for i in a:
    if i < 0:
        c += 1
    elif i == 0:
        z += 1
if c == n and k & 1:
    a.reverse()
    for i in range(k):
        ans *= -a[i]
        ans %= mod
    print(-ans % mod)
elif c == n:
    for i in range(k):
        ans *= -a[i]
        ans %= mod
    print(ans)
else:
    plus = [i for i in a if i > 0]
    minus = [i for i in a if i <= 0]
    plus.sort(reverse=1)
    minus.sort()
    x = len(plus)
    y = len(minus)
    plus += [0] * z
    p, m = 0, 0
    for i in range(k // 2):
        if x - 1 <= p:
            ans *= minus[m] * minus[m + 1]
            m += 2
        elif y - 1 <= m:
            ans *= plus[p] * plus[p + 1]
            p += 2
        else:
            if minus[m] * minus[m + 1] >= plus[p] * plus[p + 1]:
                ans *= minus[m] * minus[m + 1]
                m += 2
            else:
                ans *= plus[p] * plus[p + 1]
                p += 2
        ans %= mod
    if k & 1:
        if p < x:
            ans *= plus[p]
        else:
            ans *= minus[-1]
        ans %= mod

    print(ans % mod)


### FIXED CODE ###

n, k = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
ans = 1
mod = 10**9 + 7
c = 0
z = 0
for i in a:
    if i < 0:
        c += 1
    elif i == 0:
        z += 1
if c == n and k & 1:
    a.reverse()
    for i in range(k):
        ans *= -a[i]
        ans %= mod
    print(-ans % mod)
elif c == n:
    for i in range(k):
        ans *= -a[i]
        ans %= mod
    print(ans)
elif k == n:
    for i in a:
        ans *= abs(i)
        ans %= mod
    print(((-1)**c * ans) % mod)
else:
    plus = [i for i in a if i > 0]
    minus = [i for i in a if i <= 0]
    plus.sort(reverse=1)
    minus.sort()
    x = len(plus)
    y = len(minus)
    plus += [0] * z
    p, m = 0, 0
    for i in range(k // 2):
        if x - 1 <= p:
            ans *= minus[m] * minus[m + 1]
            m += 2
        elif y - 1 <= m:
            ans *= plus[p] * plus[p + 1]
            p += 2
        else:
            if minus[m] * minus[m + 1] >= plus[p] * plus[p + 1]:
                ans *= minus[m] * minus[m + 1]
                m += 2
            else:
                ans *= plus[p] * plus[p + 1]
                p += 2
        ans %= mod
    if k & 1:
        if p < x:
            ans *= plus[p]
        else:
            ans *= minus[-1]
        ans %= mod

    print(ans % mod)
w, a, b = map(int,input())
ans = 0
if b+w < a:
    ans = a - (b+w)
if a+w < b:
    ans = b - (a+w)
print(ans)

### FIXED CODE ###

w, a, b = map(int,input().split())
ans = 0
if b+w < a:
    ans = a - (b+w)
if a+w < b:
    ans = b - (a+w)
print(ans)
S=input()
if S="AAA" or S="BBB":
  print("No")
else:
  print("Yes")

### FIXED CODE ###

S=input()
if S=="AAA" or S=="BBB":
  print("No")
else:
  print("Yes")
x, y = map(int, input().split())

for a in range(x + 1):
    tem = 2 * a + 4 * (x - a)
    if (tem == y):
        #  and (2 * x <= y <= 4 * x):
        print('Yes')
        exit(1)

print('No')

### FIXED CODE ###

x, y = map(int, input().split())

for a in range(x + 1):
    tem = 2 * a + 4 * (x - a)
    if (tem == y):
        #  and (2 * x <= y <= 4 * x):
        print('Yes')
        exit()

print('No')
X = int(input())
fh = x // 500
f = (x - (500*fh)) // 5
pint(f*1000+fh*5)

### FIXED CODE ###

x = int(input())
fh = x // 500
f = (x - (500*fh)) // 5
sum = f*5+fh*1000
print(sum)
x=int(input())

if x==0:
  return 1
elif x==1:
  return 0

### FIXED CODE ###

x=int(input())

if x==0:
  print(1)
elif x==1:
  print(0)
n,k,c=map(int,input().split())
s=input()
l=len(s)
cand=[]
for i in range(l):
  if s[i]=='o':
    cand.append(i)
cnt1=[0]*n
cnt2=[0]*n
prev=0
cnt=0
for i in range(l):
  if s[i]=='o' and i>=prev:
    cnt+=1
    cnt1[i]=cnt
    prev=i+(c+1)
  else:
    cnt1[i]=cnt
prev=l-1
cnt=0
for i in range(l-1,-1,-1):
  if s[i]=='o' and i<=prev:
    cnt+=1
    cnt2[i]=cnt
    prev=i-(c+1)
  else:
    cnt2[i]=cnt
ans=[]
for i in range(len(cand)):
  if i==0:
    if cnt2[cand[i]+1]<k:
      ans.append(cand[i]+1)
  elif i==len(cand)-1:
    if cnt1[cand[i]-1]<k:
      ans.append(cand[i]+1)
  else:
    if cnt1[cand[i]-1]+cnt2[cand[i]+1]<k:
      ans.append(cand[i]+1)
for val in ans:
  print(val)

### FIXED CODE ###

n,k,c=map(int,input().split())
s=input()
l=len(s)
cand=[]
for i in range(l):
  if s[i]=='o':
    cand.append(i)
if len(cand)==k:
  for val in cand:
    print(val+1)
else:
  cnt1=[0]*n
  cnt2=[0]*n
  prev=0
  cnt=0
  for i in range(l):
    if s[i]=='o' and i>=prev:
      cnt+=1
      cnt1[i]=cnt
      prev=i+(c+1)
    else:
      cnt1[i]=cnt
  prev=l-1
  cnt=0
  for i in range(l-1,-1,-1):
    if s[i]=='o' and i<=prev:
      cnt+=1
      cnt2[i]=cnt
      prev=i-(c+1)
    else:
      cnt2[i]=cnt
  ans=[]
  for i in range(len(cand)):
    if i==0:
      if cnt2[cand[i]+1]<k:
        ans.append(cand[i]+1)
    elif i==len(cand)-1:
      if cnt1[cand[i]-1]<k:
        ans.append(cand[i]+1)
    else:
      if cnt1[cand[i]-1]+cnt2[cand[i]+1]<k:
        ans.append(cand[i]+1)
  for val in ans:
    print(val)
N, Y = map(int, input())

flag = False
for x in range(N+1):
    for y in range(N+1):
        z = N - (x + y)
        if Y == 10000 * x + 5000 * y + 1000 * z:
            flag = True
            print(x, y, z)
            break
    if flag:
        break

### FIXED CODE ###

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

flag = False
for x in range(N+1):
    for y in range(N-x+1):
        z = N - (x + y)
        if Y == 10000 * x + 5000 * y + 1000 * z:
            flag = True
            print(x, y, z)
            break
    if flag:
        break
else:
    print(-1, -1, -1)
import string

s = set(input())

abc = set(string.ascii_lowercase)
rest = abc - s

print(min(rest))

### FIXED CODE ###

import string

s = set(input())

abc = set(string.ascii_lowercase)
rest = abc - s

if rest:
  print(min(rest))
else:
  print('None')
N, M = map(int, input().split())
a = [int(input()) for _ in range(M)]
dp = [0]*(N+1)
last_step= 0
for i in range(N+1):
    if i == 0:
        dp[0] = 1
    elif i == 1:
        if 1 == a[last_step]:
            dp[1] = 0
            if last_step +1 < M:
                last_step += 1
        else:
            dp[1] = 1
    else:
        if i  == a[last_step]:
            dp[i] = 0
            if last_step +1 < M:
                last_step += 1
        else:
            dp[i] = dp[i-1] + dp[i-2]
print(dp[-1]%1000000007)

### FIXED CODE ###

N, M = map(int, input().split())
breakstep = [True]*(N+1)
for _ in range(M):
    breakstep[int(input())] = False
#a = [breakstep[int(input())] for _ in range(M)]
dp = [0]*(N+1)

for i in range(N+1):
    if i == 0:
        dp[0] = 1
    elif i == 1:
        if breakstep[i]:
            dp[1] = 1
    else:
        if breakstep[i]:
            dp[i] = dp[i-1] + dp[i-2]
print(dp[-1]%1000000007)
n = int(input())
found = True
for _ in range(n):
  t,x,y = map(int,input().split())
  if t==0:
  	if x==0 and y==0:
      found = False
  else:
    if t%(x+y) != 0:
      found = False
if found:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

n = int(input())
found = True
ti,xi,yi = 0,0,0
for _ in range(n):
  t,x,y = map(int,input().split())
  rt = abs(x-xi)+abs(y-yi)
  if rt > (t-ti) or (t-ti-rt)&1:
    found = False
  ti,xi,yi = t,x,y
print("Yes" if found else "No")
n = int(input())
a = list(input())
b =list(map(int,a))
aa = list(set(b))
x = []
y = []
z = []
c = 1
for i in range(1,n+1):
    x.append(i)
for j in aa:
    if j in x and 1 in aa:
        z.append(j)
    else:
        print("-1")
        exit()
for k in a:
    if int(k) == c:
        y.append(k)
        c = c + 1
print(len(a)-len(y))

### FIXED CODE ###

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

num =  1
ans = 0
if 1 not in a:
    print(-1)
    sys.exit()
for i in a:
    if i == num:
        num += 1
    else:
        ans += 1
print(ans)
N = int(input())
a = len(N)

if a == 2 and N[1] == 3:
  print('bon')
elif a == 2 and N[1] == 0 or N[1] == 1 or N[1] == 6 or N[1] == 8:
  print('hon')
elif a == 2 and N[1] == 2 or N[1] == 5 or N[1] == 7 or N[1] == 9:
  print('pon')
elif a == 3 and N[2] == 3:
  print('bon')
elif a == 3 and N[2] == 2 or N[2] == 5 or N[2] == 7 or N[2] == 9:
  print('pon')
elif elif a == 3 and N[2] == 0 or N[2] == 1 or N[2] == 6 or N[2] == 8:
  print('hon')
elif a == 1 and N[0] == 3:
  print('bon')
elif a == 1 and N[0] == 0 or N[0] == 1 or N[0] == 6 or N[0] == 8:
  print('hon')
elif a == 1 and N[0] == 2 or N[0] == 5 or N[0] == 7 or N[0] == 9:
  print('pon')

### FIXED CODE ###

N = input()
 
if N[-1] == '3':
  print('bon')
elif N[-1] == '0' or N[-1] == '1' or N[-1] == '6' or N[-1] == '8':
  print('pon')
else:
  print('hon')
def dfs(g, start):
    visited[start] = True
    cc.append(0)
    for nbr in g[start]:
        if not visited[nbr]:
            dfs(g, nbr)



from collections import defaultdict
n, m = map(int, input().split())
g = defaultdict(set)

for _ in range(m):
    a, b = map(int, input().split())
    g[a - 1].add(b - 1)
    g[b - 1].add(a - 1)


visited = [False]*n
ans = 0
for i in range(n):
    if not visited[i]:
        cc = []
        dfs(g, i)
        ans = max(ans, len(cc))

print(ans)

### FIXED CODE ###

from collections import defaultdict, deque
n, m = map(int, input().split())
g = defaultdict(set)

if m == 0:
    print(1)

else:
    for _ in range(m):
        a, b = map(int, input().split())
        g[a - 1].add(b - 1)
        g[b - 1].add(a - 1)


    visited = [False]*n
    ans = 0
    for i in range(n):
        if not visited[i]:
            # cc = []
            count = 1
            q = deque([i])
            visited[i] = 1
            while q:
                node = q.pop()
                for nbr in g[node]:
                    if not visited[nbr]:
                        q.append(nbr)
                        visited[nbr] = True
                        count += 1
                
            # ans = max(ans, len(cc))
            ans = max(ans, count)

    print(ans)
import numpy as np 
A,B = map(float,input().split())
print(numpy.trunc(A*B))

### FIXED CODE ###

import numpy as np 
A,B = map(str,input().split())
A = int(A)
B = int(B[0]+B[2]+B[3])
print(int(A*B//100))
from math import comb
MOD = 10**9+7
n = int(input())
mdiv = n // 3

ans = 0
for i in range(mdiv):
    ans += comb(n - 3 * (i + 1) + i, i)

print(ans % MOD)

### FIXED CODE ###

from math import comb
MOD = 10**9+7
n = int(input())
mdiv = n // 3

ans = 0
for i in range(mdiv):
    ans += comb(n - 3 * (i + 1) + i, i)

print(ans % MOD)
a = int(input())
b = int(input())
c = int(input())
#swapping a and b
temp = a
a = b
b = temp

#swapping a and c
temp = a
a = c
c = temp

print(str(a)+"␣"+str(b)+"␣"+str(c))

### FIXED CODE ###

numbers = input().split()
numbers = list(map(int, numbers))
a = numbers[0]
b = numbers[1]
c = numbers[2]

temp = a
a = b
b = temp

temp = a
a = c
c = temp

print(str(a) + " " + str(b) + " " + str(c))
import collections
N = int(input())
A = [[int(_) for _ in input().split()] for _ in range(N)]
B = [_.copy() for _ in A]
d_ij = collections.defaultdict(set)
for i in range(N - 1):
    for j in range(i + 1, N):
        d_ij[A[i][j]].add((i, j))
connected = collections.defaultdict(set)
ans = 0
for k in sorted(d_ij.keys()):
    for i, j in d_ij[k]:
        if i not in connected[j]:
            for p in connected[j]:
                if A[p][i] > A[p][j] + A[j][i]:
                    print(-1)
                    exit()
                elif A[p][i] == A[p][j] + A[j][i]:
                    B[p][i] = B[i][p] = 0
                    connected[p].add(i)
                    connected[i].add(p)
            for q in connected[i]:
                if A[q][j] > A[q][i] + A[i][j]:
                    print(-1)
                    exit()
                elif A[q][j] == A[q][i] + A[i][j]:
                    B[q][j] = B[j][q] = 0
                    connected[q].add(j)
                    connected[j].add(q)
            connected[i].add(j)
            connected[j].add(i)
print(sum(sum(_) for _ in B) // 2)


### FIXED CODE ###

import itertools
N = int(input())
A = [[int(_) for _ in input().split()] for _ in range(N)]
ans = sum(sum(a) for a in A) // 2
seen = set()
for i in range(N):
    for j in range(i + 1, N):
        for k in range(N):
            if A[i][j] > A[i][k] + A[j][k]:
                print(-1)
                exit()
            elif k == i or i == j or j == k:
                continue
            elif A[i][j] == A[i][k] + A[j][k]:
                ans -= A[i][j]
                break
print(ans)
N, W = map(int, input().split())
WV = [list(map(int, input().split())) for _ in range(N)]

dp = [[0]*(W+1) for _ in range(N+1)]

for i in range(1, N+1):
    weight = WV[i-1][0]
    value = WV[i-1][1]
    for w in range(W+1):
        if w-weight<0:
            dp[i][w] = dp[i-1][w]
        else:
            dp[i][w] = max(dp[i-1][w-weight]+value, dp[i-1][w])

print(dp[N][W])

### FIXED CODE ###

N, W = map(int, input().split())
WV = [list(map(int, input().split())) for _ in range(N)]

dp = [[0]+[float('inf')]*100000 for _ in range(N+1)]

for i in range(1, N+1):
    for v in range(0, 100001):
        weight = WV[i-1][0]
        value = WV[i-1][1]
        dp[i][v] = min(dp[i-1][v], dp[i-1][v-value]+weight)
res = 0
for v, w in enumerate(dp[-1]):
    if w <= W: res = v

print(res)