Harryxun/stf_run huggingface dataset:
n= int(input())
ABC = [[0]*3]*n
for i in range(n):
  ABC[i][0],ABC[i][1],ABC[i][2] = map(int, input().split())

dp = [[0]*3]*n
dp[0] = ABC[0]

for i in range(1,n):
  for j in range(3):
    dp[i][j] = ABC[i][j]+max(dp[i][j-1],dp[i][j-2])
    
print(max(dp[n]))
    
  


### FIXED CODE ###

n= int(input())
ABC = [0]*n
for i in range(n):
  ABC[i]= list(map(int, input().split()))

dp = [[0 for i in range(3)] for j in range(n)]
dp[0] = ABC[0]

for i in range(1,n):
  for j in range(3):
    dp[i][j] = ABC[i][j]+max(dp[i-1][j-1],dp[i-1][j-2])
    
print(max(dp[n-1]))
N = int(input())
K = int(input())
X = list(map(int, input()))
minSum = 0
for i in X:
    minSum += min(i, K - i) * 2
print(minSum)

### FIXED CODE ###

N = int(input())
K = int(input())
X = list(map(int, input().split()))
minSum = 0
for i in X:
    minSum += min(i, K - i) * 2
print(minSum)
import numpy as np
n,p = map(int,input().split())
ac = np.array([0]*n)
wa = np.array([0]*n)

for i in range(N):
    p,s = input().split()
    if ac[int(p) - 1] == 0 and s == "WA":
        wa[int(p) - 1] += 1
    else:
        ac[int(p) - 1] = 1

if sum(ac) == 0:
    print(0,0)
else:
    print(sum(ac),sum(wa))


### FIXED CODE ###

import numpy as np

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

AC = np.array([0]*N)
WA = np.array([0]*N)

for i in range(M):
    p,S = input().split()

    if AC[int(p)-1] ==0 and S == "WA":
       WA[int(p)-1] += 1
    else:
        AC[int(p)-1] = 1

print(sum(AC),sum(AC*WA))
a=o
S=list(input())
T=list(input())
for i in range(len(S)): 
	if S[i]！=T[i]:	
		a=a+1
print(a)

### FIXED CODE ###

a=0
S=list(input())
T=list(input())
for i in range(len(S)): 
	if S[i]!=T[i]:	
		a=a+1
print(a)
A = list(map(int, input().split()))
A.sort()
ans(A[0]+A[1]+10*A[2])

### FIXED CODE ###

A = list(map(int, input().split()))
A.sort()
print(A[0]+A[1]+10*A[2])
=input()
T=input()
count=0
if S[0]==T[0]:
    count=count+1
if S[1]==T[1]:
    count=count+1
if S[2]==T[2]:
    count=count+1
print(count)

### FIXED CODE ###

S=input()
T=input()
count=0
if S[0]==T[0]:
    count=count+1
if S[1]==T[1]:
    count=count+1
if S[2]==T[2]:
    count=count+1
print(count)
import sys

def solve(s, cache={}):
    if s in cache:
        return cache[s]
    n = len(s)
    if n == 1:
        return 1
    if s == "0" * n or s == "1" * n:
        return n
    r1 = solve("0" + s[1:-1])
    r2 = solve("1" + s[1:-1])
    r3 = solve(s[1:-1] + "0")
    r4 = solve(s[1:-1] + "1")
    r = max(r1, r2, r3, r4)
    cache[s] = r
    return r

line = sys.stdin.readline().strip()

print(solve(line))


### FIXED CODE ###

import sys

def solve1(s):
    n = len(s)
    i = 0
    while i <= n // 2:
        if s[n // 2] != s[n // 2 - i]:
            break
        if s[(n - 1) // 2] != s[(n - 1) // 2 + i]:
            break
        i += 1
    return (n - 1) // 2 + i


line = sys.stdin.readline().strip()
print(solve1(list(line)))
N = int(input())
S = input()

if N % 2 == 1:
  print('No')
else:
  if S[0:(N // 2) + 1] = S[N // 2:]:
    print('Yes')
  else:
    print('No')

### FIXED CODE ###

N = int(input())
S = input()

if N % 2 == 1:
  print('No')
else:
  if S[0:N // 2] == S[N // 2:]:
    print('Yes')
  else:
    print('No')
import sys
input = sys.stdin.readline

n, q = map(int, input().split())
s = input()
for _ in range(q):
  first, last = map(int, input().split())
  print(s[first-1:last].count("AC"))

### FIXED CODE ###

print('ATCG'['TAGC'.find(input())])
a = int(input())
print(1 / round(a/2))

### FIXED CODE ###

a = int(input())
print(int((a+1) / 2) / a)
from collections import *
from itertools import *
from bisect import *
from heapq import *
import copy
#N=int(input())
#S=[list(map(int,input().split())) for i in range(N)]
idle=10**13
xs,ys,xt,yt=map(int,input().split())
N=int(input())
XYR=[list(map(int,input().split())) for i in range(N)]
XYR.append([xt,yt,0])#終点
XYR.append([xs,ys,0])#開始
for i in range(len(XYR)):
    XYR[i][0]*=idle
    XYR[i][1]*=idle
    XYR[i][2]*=idle
kyori=[[0 for i in range(len(XYR))] for n in range(len(XYR))]
for i in range(len(XYR)):
    for m in range(i,len(XYR)):
        if i==m:
            t=0
        else:
            x1,y1,r1=XYR[i]
            x2,y2,r2=XYR[m]
            t=max(((x2-x1)**2+(y2-y1)**2)**.5-r1-r2,0)

        kyori[i][m]=round(t)
        kyori[m][i]=round(t)

stack=sorted(kyori[-2])
heapify(stack)
Pdic={}
dic={}
kyoriset=set()
for i in range(len(XYR)):
    a=kyori[-1][i]
    Pdic.update({i:a})
    if not a in kyoriset:
        kyoriset.add(a)
        dic.update({a:[i]})
    else:
        dic[a].append(i)
visited=set([len(XYR)-1])
while stack:
    m=heappop(stack)
    a=dic[m].pop()
    if a==len(XYR)-2:
        print(m/idle)
        exit()
    if not a in visited:
        visited.add(a)
        for i in range(len(XYR)):
            nm=kyori[a][i]+m
            if Pdic[i]>nm:
                Pdic[i]=nm
                heappush(stack,nm)
                if not nm in kyoriset:
                    kyoriset.add(nm)
                    dic.update({nm:[i]})
                else:
                    dic[nm].append(i)


### FIXED CODE ###

from collections import *
from itertools import *
from bisect import *
from heapq import *
import copy
#N=int(input())
#S=[list(map(int,input().split())) for i in range(N)]
idle=10**13
xs,ys,xt,yt=map(int,input().split())
N=int(input())
XYR=[list(map(int,input().split())) for i in range(N)]
XYR.append([xt,yt,0])#終点
XYR.append([xs,ys,0])#開始
"""for i in range(len(XYR)):
    XYR[i][0]*=idle
    XYR[i][1]*=idle
    XYR[i][2]*=idle"""
kyori=[[0 for i in range(len(XYR))] for n in range(len(XYR))]
for i in range(len(XYR)):
    for m in range(i,len(XYR)):
        if i==m:
            t=0
        else:
            x1,y1,r1=XYR[i]
            x2,y2,r2=XYR[m]
            t=max(((x2-x1)**2+(y2-y1)**2)**.5-r1-r2,0)

        kyori[i][m]=t
        kyori[m][i]=t
stack=sorted(kyori[-1])
heapify(stack)
Pdic={}
dic={}
kyoriset=set()
for i in range(len(XYR)):
    a=kyori[-1][i]
    Pdic.update({i:a})
    if not a in kyoriset:
        kyoriset.add(a)
        dic.update({a:[i]})
    else:
        dic[a].append(i)
visited=set([len(XYR)-1])
while stack:
    m=heappop(stack)
    a=dic[m].pop()
    if a==len(XYR)-2:
        print(m)
        exit()
    if not a in visited:
        visited.add(a)
        for i in range(len(XYR)):
            nm=kyori[a][i]+m
            if Pdic[i]>nm:
                Pdic[i]=nm
                heappush(stack,nm)
                if not nm in kyoriset:
                    kyoriset.add(nm)
                    dic.update({nm:[i]})
                else:
                    dic[nm].append(i)
n=int(input())
if 7 in n:
  print 'Yes'
else:
  print'No'

### FIXED CODE ###

n=input()
if '7' in n:
  print('Yes')
else:
  print('No')
S = int(input())

A = [S]
idx = 0
while True
  if A[idx] % 2 == 0:
    A.append(A[idx]//2)
  else:
    A.append(A[idx]*3+1)
  if A[idx+1] in A[:idx+1]:
    print(idx+1)
    break
  idx += 1


### FIXED CODE ###

S = int(input())

A = [S]
idx = 0
while True:
  if A[idx] % 2 == 0:
    A.append(A[idx]//2)
  else:
    A.append(A[idx]*3+1)
  if A[idx+1] in A[:idx+1]:
    print(idx+2)
    break
  idx += 1
from collections import Counter
N=int(input())
c=[]
a=list(map(int, input().split()))
s=sorted(set(a), reverse=True)
 
for i, cnt in Counter(a).items:
    if cnt >= 2 and i > w:
        if i > h:
            if cnt >= 4:
                h = i
                w = i
            else:
                w = h
                h = i
        else:
            w = i
            
print(w * h)

### FIXED CODE ###

from collections import Counter
 
N = int(input())
A = list(map(int, input().split()))
h = w = 0
 
for i, cnt in Counter(A).items():
    if cnt >= 2 and i > w:
        if i > h:
            if cnt >= 4:
                h = i
                w = i
            else:
                w = h
                h = i
        else:
            w = i
            
print(w * h)
import math
N, K = map(int, input().split())
h = list(map(int, input().split()))
 
S = [0] * N

for i in range(1, N):
  S[i] = min(S[_] + math.abs(h[i] - h[_]) for range(max(0, i-K), i)]

print(S[N-1])


### FIXED CODE ###

from numba import jit
import math
N, K = map(int, input().split())
h = list(map(int, input().split()))
 
@jit
def nya(N, K, h):
    S = [0] * N
    S[0] = 0
 
    for i in range(1, N):
        value = math.inf
        for step in range(1, K + 1):
            if i - step < 0:
                break
            value = min(value, S[i - step] + abs(h[i] - h[i - step]))
        S[i] = value
    return S[N-1]

print(nya(N, K, h))
l = list(map(int, input().split()))
print ' '.join(map(str, sorted(l)))


### FIXED CODE ###

l = list(map(int, input().split()))
print(" ".join(map(str, sorted(l))))
def search(x, num):
    nodes.remove(x)
#     for y in edge[x]:
#         edge[y].discard(x)
#     for y in list(edge[x]):
    for y in edge[x]:
        if y in nodes:
            num = search(y, num)
    return num + 1

(n,m),*d  = [list(map(int, s.split())) for s in open(0)]

edge = [set() for _ in range(n+1)]
for x in d:
    edge[x[0]].add(x[1])
    edge[x[1]].add(x[0])

nodes = set(range(1,n+1))
ans = 1
for x in list(nodes):
    if x in nodes:
        ans = max(ans, search(x, 0))
print(ans)

### FIXED CODE ###

import sys
sys.setrecursionlimit(int(1e6))

def search(x, num):
    nodes.remove(x)
#     for y in edge[x]:
#         edge[y].discard(x)
#     for y in list(edge[x]):
    for y in edge[x]:
        if y in nodes:
            num = search(y, num)
    return num + 1

(n,m),*d  = [list(map(int, s.split())) for s in open(0)]

edge = [set() for _ in range(n+1)]
for x in d:
    edge[x[0]].add(x[1])
    edge[x[1]].add(x[0])

nodes = set(range(1,n+1))
ans = 1
for x in list(nodes):
    if x in nodes:
        ans = max(ans, search(x, 0))
print(ans)
import fractions
def gcdlist(a):
    ans = a[0]
    for i in range(1, len(a)):
        ans = fractions.gcd(ans, a[i])
    return ans

n,y=map(int,input().split())
x=list(map(int,input().split()))
l=[]
if y==1:
    print(abs(x[0]-1))
    exit()

for i in range(n-1):
    l.append(abs(x[i+1]-x[i]))
print(gcdlist(l)) 

### FIXED CODE ###

import fractions
def gcdlist(a):
    ans = a[0]
    for i in range(1, len(a)):
        ans = fractions.gcd(ans, a[i])
    return ans

n,y=map(int,input().split())
x=list(map(int,input().split()))
x.append(y)
if y==1:
    print(abs(x[0]-1))
    exit()

l=[]
for i in range(n):
    l.append(abs(x[i+1]-x[i]))
print(gcdlist(l))
ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

import math 

a,b,c,d = mi()

g = int(c*d / math.gcd(c,d))

# cの倍数の個数
ac = (a-1)//c
bc = b//c
nc = bc-ac

# dの倍数の個数
ad = (a-1)//d
bd = b//d 
nd = bd-ad

# cdのgcdの倍数の個数
ag = (a-1)//g
bg = b//g
ng = bg-ag

ans = b-(a-1)-nc - nd + ng

# print(g,nc,nd,ng)
print(ans)

### FIXED CODE ###

ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

import fractions

a,b,c,d = mi()

g = c*d // fractions.gcd(c,d)

# cの倍数の個数
ac = (a-1)//c
bc = b//c
nc = bc-ac

# dの倍数の個数
ad = (a-1)//d
bd = b//d
nd = bd-ad

# cdのgcdの倍数の個数
ag = (a-1)//g
bg = b//g
ng = bg-ag

ans = b-(a-1)-nc - nd + ng

# print(g,nc,nd,ng)
print(ans)
import sys
input = sys.stdin.readline

from math import factorial

def ncr(n, r):
    return factorial(n) / factorial(r) / factorial(n - r)

from collections import defaultdict


n = int(input())
d = defaultdict(lambda: 0)

for i in range(n):
    s = list(str(input()))
    s.sort()
    s = str(s)
    d[s] += 1   

ans = 0
for key in d.keys():
    if d[key] > 1:
        ans += ncr(d[key], 2)

print(int(ans))

### FIXED CODE ###

import sys
from collections import defaultdict
def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k 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 *= int(numerator[k])

    return result


input = sys.stdin.readline

n = int(input())
d = defaultdict(lambda: 0)

for i in range(n):
    s = list(str(input()).rstrip())
    s.sort()
    s = "".join(s)
    d[s] += 1   

ans = 0
for key in d.keys():
    if d[key] >= 2:
        ans += cmb(d[key], 2)
print(int(ans))
from math import gcd

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

A=sorted(A)
ans=[0]*(A[-1]+1)
c=A[-1]
for i in A:
    c=gcd(c,i)
    for j in range(2, int(-(-i**0.5//1))+1):
        if i%j==0:
            ans[j]+=1
    ans[i]+=1   

ans.pop(0)
ans.pop(0)

if max(ans)==1:
    print('pairwise coprime')

elif c==1:
    print('setwise coprime')

else:
    print('not coprime')

### FIXED CODE ###

from functools import reduce
from math import gcd

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

c=max(A)+1
D=[0]*c
div=[0]*c
P=[]

for i in range(2,c):
    if D[i]==0:
        P.append(i)
        D[i]=i
    for j in P:
        if i*j>=c  or j>D[i] :
           break
        D[i*j]=j
f=0
for i in A:
    if i==1:
        continue
    temp=i
    while temp!=1:
        if div[D[temp]]==1:
            f=1
            break
        div[D[temp]]+=1
        temp2=D[temp]
        while temp%temp2==0 and temp>=temp2:
            temp=temp//temp2
    if f==1:
        break
        


if max(div)<=1 and f==0:
    print('pairwise coprime')

elif reduce(gcd, A) == 1:
    print('setwise coprime')

else:
    print('not coprime')
import math

# D - Maximum Average Sets
# 問題URL:http://abc057.contest.atcoder.jp/tasks/abc057_d

# N:商品の数　A個以上B個以下の範囲で選ぶ
N, A, B = map(int, input().split())
# C：最大価値組み合わせ総数
C = 0
# cnt:カウンター
cnt = 0

# 商品価値をリストに入れる
V = [int(value) for value in input().split()]
# 商品価値が高い順に並び替え
V.sort(reverse=True)

# 商品価値が高いものから出来るだけ少なく（＝A個）選ぶのが最も平均価値が高くなる
S = V[0:A]
ave = sum(S) / A
print(ave)

if V[0]== V[A-1]: # もしもA個選んだ中の商品価値が全て同じだったら
    for i in range(N):
        
        # N個の商品の中に最大価値値を持つものがいくつあるか調べる
        if V[0] == V[i]:
            cnt += 1
    
    for i in range(A,B+1):
        if V[-i] == min(S):
            break
        
        C = C + math.factorial(cnt) / ( math.factorial(cnt - i) * math.factorial(i))
    

else: # 商品価値が均一でなかったのなら
    Vs = V.count(min(S)) # A個選んだ中で最も低い価値を持つ商品は、もともとの商品リストの中にいくつあるか
    Ss = S.count(min(S)) # A個選んだ時中で最も低い価値を持つ商品はいくつあるか
    
    # nCk = n! /( (n-k)! * k! )に基づきCを計算
    C = math.factorial(Vs) / (math.factorial(Vs - Ss) * math.factorial(Ss) )

print(int(C))

### FIXED CODE ###

# 元ソースコード：http://abc057.contest.atcoder.jp/submissions/1183710
# 初心者の実験用です

import math
N,A,B = map(int,input().split())
V = list(map(int,input().split()))
V.sort()
S = V[-A:]
avgmax = sum(S) / A
print(avgmax)
 
Vs = V.count(min(S))
Ss = S.count(min(S))
if min(S) != max(S):
	C = math.factorial(Vs) // (math.factorial(Vs -Ss) * math.factorial(Ss))
	print(C)
else:
	i = A
	C = 0
	while i <= B and V[-i] == min(S):
		c = math.factorial(Vs) // (math.factorial(Vs -i) * math.factorial(i))
		C = C + c
		i = i + 1
	print(C)
s = input()[::-1]
t = input()[::-1]
for i,c in enumerate(s):
  if (c == t[0] or c == '?') and (i+len(t) < len(s)-1):
    for j in range(len(t)):
      if t[j] != s[i+j] and s[i+j] != '?':
        break
    else:
      for j in range(len(t)):
        s[i+j] =  t[j]
      print(s.replace('?', 'a')[::-1])
      break
else:
  print('UNRESTORABLE')



### FIXED CODE ###

r = int(input())
g = int(input())   
print(2 * g -r)
a, b = map(int, input().split())
if a == 1:
    a = 14
if: b == 1:
    b = 14
if a < b:
    print("Bob")
elif a > b:
    print("Alice")
else:
    print("Draw")

### FIXED CODE ###

a, b = map(int, input().split())
if a == 1:
    a = 14
if b == 1:
    b = 14
if a < b:
    print("Bob")
elif a > b:
    print("Alice")
else:
    print("Draw")
lis=[1,2,4,8,16,32,64,128,256,512,9,27,81,243,729,25,125,625,216,36,343,49,100,1000]
for i in range(11,32):
    t=i*i
    lis.append(t)
listt=list(set(lis))
listt=sorted(listt)
a=int(input())
for i in range(300):
    if a < listt[i]:
        print (listt[i-1])
        break
    elif a = listt[i]:
        print(listt[i])
        break

### FIXED CODE ###

lis=[1,2,4,8,16,32,64,128,256,512,9,27,81,243,729,25,125,625,216,36,343,49,100,1000]
for i in range(11,32):
    t=i*i
    lis.append(t)
listt=list(set(lis))
listt=sorted(listt)
a=int(input())
for i in range(300):
    if a < listt[i]:
        print (listt[i-1])
        break
    elif a == listt[i]:
        print(listt[i])
        break
N, X = map(int, input().split())

m = []
for i in range(N):
  m.append(int(input()))
  
m.sort()
i = 0
total = 0
while total<=X:
  total += m[i]
  i += 1
  
print(i)

### FIXED CODE ###

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

m = []
for i in range(N):
  m.append(int(input()))

total = N
remain = X - sum(m)
total += remain//min(m)

print(total)
t=int(input())-1
print(((t*(t+1))//2)

### FIXED CODE ###

n=int(input())
n-=1
f=(n*(n+1))//2
print(f)
from heapq import heappush, heappop
from itertools import permutations, accumulate, combinations
from math import pi, gcd, ceil, floor
import numpy as np
from collections import defaultdict, deque
from operator import itemgetter
from bisect import bisect_left, bisect_right, insort_left, insort_right
import sys
input = sys.stdin.readline
# sys.setrecursionlimit(10 ** 6)
# MOD = 10 ** 9 + 7
# INF = float("inf")



def main():
    n = int(input())
    print(n // 3)

if __name__ == '__main__':
    main()

### FIXED CODE ###

n = int(input())
print(n//3)
n, m = map(int, input().split())

a = []
for i in range(1, m):
    if m % n == 0:
        print(m // n)
        exit()
    if m % i == 0 and i * n <= m:
        a.append(i)

print(max(a))


### FIXED CODE ###

import math
n, m = map(int, input().split())

if n == 1:
    print(m)
    exit()
a = []
b = []
for i in range(1, math.ceil(math.sqrt(m))):
    if m % n == 0:
        print(m // n)
        exit()
    if m % i == 0:
        b.append(i)
        b.append(m // i)
        
#print(b)

for i in range(len(b)):
    if b[i] * n <= m:
        a.append(b[i])
#print(a)

if len(b) == 2:
    print(1)
else:
    print(max(a))
def f(n):
    if n%2==0:
        n//2
    else:
        3*n+1
s=int(input())
a=list()
i=1
while 1:
    if f(s) in a:
        break
    a.append(f(s))
    s=f(s)
    i+=1
print(i)

### FIXED CODE ###

def f(n):
    if n%2==0:
        return n//2
    else:
        return 3*n+1
s=int(input())
a=list()
i=1
while 1:
    if s in a:
        break
    a.append(s)
    s=f(s)
    i+=1
print(i)
import copy
h,w=map(int,input().split())
a=[list(map(lambda x:0 if x=="#" else 1,input())) for i in range(h)]
b=[[0 for i in range(w)] for j in range(h)]
count=0
print(a)
while a!=b:
  z=copy.deepcopy(a)
  for i in range(h):
    for j in range(w):
      a[i][j]=z[i][j]*(z[i-1][j] if i!=0 else 1)*(z[i+1][j] if i!=h-1 else 1)*(z[i][j-1] if j!=0 else 1)*(z[i][j+1] if j!=h-1 else 1)
  count+=1
print(count)

### FIXED CODE ###

from collections import deque
h,w=map(int,input().split())
a=[input() for _ in range(h)]
visited=[[-1]*w for _ in range(h)]
queue=deque()
for i in range(h):
  for j in range(w):
    if a[i][j]=='#':
      visited[i][j]=0
      queue.append([i,j])
while queue:
  y,x=queue.popleft()
  for j,k in ([1,0],[-1,0],[0,1],[0,-1]):
    n_y,n_x=y+j,x+k
    if 0<=n_y<h and 0<=n_x<w and a[n_y][n_x]=='.' and visited[n_y][n_x]<0:
      visited[n_y][n_x]=visited[y][x]+1
      queue.append([n_y,n_x])
ans=0
for l in visited:
  ans=max([ans]+l)
print(ans)
while 1:
	n=input()
	if n==0:break
	s=[map(int,raw_input().split()) for i in range(n)]
	sh=set([min(s[i]) for i in range(n)])
	tl=set([max([s[j][i] for j in range(n)]) for i in range(n)])
	print list(sh&tl)[0]

### FIXED CODE ###

while 1:
	n=input()
	if n==0:break
	s=[map(int,raw_input().split()) for i in range(n)]
	sh=set([min(s[i]) for i in range(n)])
	tl=set([max([s[j][i] for j in range(n)]) for i in range(n)])
	print list(sh&tl)[0] if len(sh&tl)>0 else 0
from collections import Counter
def solve(n, m, a, b):
    parents = list(range(n+1))
    def root(x):
        return root(parents[x]) if parents[x] != x else x
    for i in range(m):
        u = root(a[i])
        v = root(b[i])
        if u > v:
            u, v = v, u
        if u != v:
            parents[v] = u
    return max(Counter(parents).values())

n, m = map(int, input().split())
a, b = zip(*[map(int, input().split()) for i in range(m)])
print(solve(n, m, a, b))

### FIXED CODE ###

from collections import Counter
def solve(n, m, a, b):
    parents = list(range(n+1))
    def root(x):
        if parents[x] != x:
            parents[x] = root(parents[x])
        return parents[x]
    for u, v in zip(a, b):
        u = root(u)
        v = root(v)
        if u > v:
            u, v = v, u
        if u != v:
            parents[v] = u
    return max(Counter(map(root, parents)).values())

n, m = map(int, input().split())
if m > 0:
    a, b = zip(*[map(int, input().split()) for i in range(m)])
else:
    a, b = [], []
print(solve(n, m, a, b))
from  fractions  import gcd
n,m = map(int,input().split())
s = input()
t = input()
def lcm(x,y):
  return (x*y)//gcd(x,y)

a = lcm(n,m)
b = gcd(n,m)
if b==1:
  if s[0]==t[1]:
    print(a)
  else:
    print(-1)
k = int(a//b)
for i in range(b):
  w = int(n*i//b)
  ww = int(m*i//b)
  if s[w]==t[ww]:
    continue
  else:
    print(-1)
else:
  print(a)

### FIXED CODE ###

from  fractions  import gcd
n,m = map(int,input().split())
s = input()
t = input()
def lcm(x,y):
  return (x*y)//gcd(x,y)

a = lcm(n,m)
b = gcd(n,m)
if b==1:
  if s[0]==t[0]:
    print(a)
  else:
    print(-1)
else:
  k = int(a//b)
  for i in range(b):
    w = int(n*i//b)
    ww = int(m*i//b)
    if s[w]==t[ww]:
      continue
    else:
      print(-1)
      exit()
  else:
    print(a)
import sys

n,k=map(int,input().split())
a=list(map(int,input().split()))
#n,k=10,10
#a=[158260522, 877914575, 602436426, 24979445,
#   861648772, 623690081, 433933447, 476190629,
#   262703497, 211047202]

if k==0:
    print(max(a))
    sys.exit()

def rf(mm):
    icnt=0
    for i in range(n):
        icnt+=(a[i]-1)//mm+1
    return icnt

asum=sum(a)
m=asum//(n+k)
um=asum
lm=1
for ii in range(100):
#    print(m,rf(m))
    if rf(m)>(n+k) :
        print("1:",m,rf(m))
        lm=m
        m=(um+m)//2+1
    elif rf(m)<(n+k):
#        print("2:",m,rf(m))
        um=m
        m=(lm+m)//2
    elif rf(m)==n+k and rf(m-1)==n+k:
#        print("5:",m,rf(m))
        um=m
        m=(lm+m)//2+1
    elif rf(m)==n+k and rf(m-1)>n+k:
#        print("3:",m,rf(m))
        break
    else:
#        print("4:",m,rf(m))
        m=m-1

print(m)

### FIXED CODE ###

import sys

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

if k==0:
    print(max(a))
    sys.exit()

def rf(mm):
    if mm==0:
        mm=1
    icnt=0
    for i in range(n):
        icnt+=(a[i]-1)//mm+1
    return icnt

asum=sum(a)
m=asum//(n+k)
um=asum
lm=1
for ii in range(60):
    if m==1:
        break
    if rf(m)<=(n+k) and rf(m-1)>(n+k):
        break
    if um-lm<5:
        break
    if rf(m)>(n+k):
        lm=m
        m=(um+lm)//2-1
    elif rf(m)<(n+k):
        um=m
        m=(um+lm)//2-1
    else:
        um=m-1
        m=(um+lm)//2-1
#    if rf(m)==(n+k) and um-lm<5:

if um<1:
    print(1)
    sys.exit()
    
for mi in range(um,max(0,lm-1),-1):
    if rf(mi)<=(n+k) and rf(mi-1)>(n+k):
        break

print(mi)
N,P = map(int,input().split())
ans=1
if N==1|N>=40:
  print(P)
  exit()
elif P==1:
  print(1)
  exit()
else:
  i=2
  while(i*i<=P):	
	count=0
	while(P%i==0):
      P=P//i
	  count+=1
	  ans*=i**(count//N)
    if i==2:  
	  i+=1
    else:
      i+=2
 
  print(ans)

### FIXED CODE ###

N,P = map(int,input().split())
i = round(P**(1/N))
res = []
if N == 1:
  print(P)
elif P == 1:
  print(1)
else:
  for i in range(i,0,-1):
    if P%i**N==0:
      print(i)
      break