Harryxun/stf_run huggingface dataset:
x=int(input())
p=x**0.5
ans=[]
for i in range(1,p+1):
  j=2
  while True:
    if i**j<=x:
      ans.append(i**j)
    else:
      break
    j+=1
print(max(ans))

### FIXED CODE ###

x=int(input())
import math
p=math.ceil(x**0.5)
ans=[1]
for i in range(2,p+1):
  j=2
  while True:
    if i**j<=x:
      ans.append(i**j)
    else:
      break
    j+=1
print(max(ans))
from biesect import biesect_right
from numpy import cumsum
from sys import stdin
input=stdin.readline
n,m,k=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
a=numpy.cumsum(a)
b=numpy.cumsum(b)
ans=0
for i in range(len(a)):
  x=k-a[i]
  y=biesect.biesect_right(b,x)
  if ans<y+i+1:
    ans=y+i+1
print(ans)

### FIXED CODE ###

from bisect import bisect_right
from numpy import cumsum
from sys import stdin
input=stdin.readline
n,m,k=map(int,input().split())
a=[0]+list(map(int,input().split()))
b=list(map(int,input().split()))
a=cumsum(a)
b=cumsum(b)
ans=0
for i in range(len(a)):
  x=k-a[i]
  if x>=0:
    y=bisect_right(b,x)
    if ans<y+i:
      ans=y+i
  else:
    break
print(ans)
N,M,P=map(int,input().split())
ways=[[] for _ in range(N)]
Rways=[[] for _ in range(N)]

for i in range(M):
  A,B,C=map(int,input().split())
  ways[A-1].append([B-1,C-P])
  Rways[B-1].append(A-1)
  
  
visited=[-float("inf")]*N
visited[0]=0

blacklist=[True]*N
blacklist[-1]=False
"""
for c in range(M):
  for i in range(N):
    if blacklist[i]==True:
      continue
    for to in Rways[i]:
      blacklist[to]=False
"""
def b_update(nord):
  global blacklist
  for to in Rways[nord]:
    if blacklist[to]==True:
      blacklist[to]=False
      b_update(to)
      
b_update(N-1)

for c in range(M+1):
  flag=False
  for i in range(N):
    debit=visited[i]
    if debit==-float("inf"):
      continue
    for to,cost in ways[i]:
      if visited[to]<debit+cost and not blacklist[to]:
        visited[to]=debit+cost
        flag=True
        
  if not flag:
    break
  if c==M:
    print(-1)
    exit()
      
ans=visited[-1]
if ans==-float("inf"):
  print(-1)
else:
  print(max(ans,0))
  
  


### FIXED CODE ###

import sys
sys.setrecursionlimit(10000)

N,M,P=map(int,input().split())
ways=[[] for _ in range(N)]
Rways=[[] for _ in range(N)]

for i in range(M):
  A,B,C=map(int,input().split())
  ways[A-1].append([B-1,C-P])
  Rways[B-1].append(A-1)
  
  
visited=[-float("inf")]*N
visited[0]=0

blacklist=[True]*N
blacklist[-1]=False
"""
for c in range(M):
  for i in range(N):
    if blacklist[i]==True:
      continue
    for to in Rways[i]:
      blacklist[to]=False
"""
def b_update(nord):
  global blacklist
  for to in Rways[nord]:
    if blacklist[to]==True:
      blacklist[to]=False
      b_update(to)
      
b_update(N-1)

for c in range(N):
  flag=False
  for i in range(N):
    debit=visited[i]
    if debit==-float("inf"):
      continue
    for to,cost in ways[i]:
      if visited[to]<debit+cost and not blacklist[to]:
        visited[to]=debit+cost
        flag=True
        
  if not flag:
    break
  if c==N-1:
    print(-1)
    exit()
      
ans=visited[-1]
if ans==-float("inf"):
  print(-1)
else:
  print(max(ans,0))
n = int(input())
a, b = [0]*n, [0]*n
for i in range(n):
	a[i], b[i] = map(int, input().split())

ans = 0
for i in range(n)[::-1]:
	a_, b_ = a[i] + p, b[i]
	if a_%b_ != 0:
		ans += (a_ // b_ + 1) * b_ - a_

print(p)


### FIXED CODE ###

n = int(input())
ab = []
for i in range(n):
	a, b = map(int, input().split())
	ab.append((a, b))

ans = 0
for i in range(n)[::-1]:
	a, b = ab[i][0]+ans, ab[i][1]
	if a%b != 0:
		ans += ((a//b + 1)*b - a)

print(ans)
friends=input()
friends.split(' ')
friends_all=friends[0]
cakes=input()
cakes.split(' ')
cakes_amount=(sum(cakes))
one_person=cakes_amount//friends_all
if cakes_amount%friends_all==0:
        pass
else:
        one_person+=1
        
print(one_person)



### FIXED CODE ###

friends=input()
friends=friends.split()
friends_all=friends[0]
person=int(friends_all)+1
cakes=input()
cakes_amount=0
for a in cakes.split():
        cakes_amount+=int(a)
one_person=cakes_amount//person

if cakes_amount%person!=0:
        one_person+=1
else:
        pass
print(one_person)
H = input()
A = input()
c = 0
while true:
  H = H - A
  c = c+1
  if H < 0:
    print(c)
    

### FIXED CODE ###

H,A = map(int, input().split())
c = 0
while True:
  H = H - A
  c = c+1
  if H <= 0:
    print(c)
    break
nx = x*2
if nx > y:
    print(1)
else:
    i = 2
    while nx*2 <= y:
        nx = nx*2
        i += 1
    print(i)

### FIXED CODE ###

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

nx = x*2
if nx > y:
    print(1)
else:
    i = 2
    while nx*2 <= y:
        nx = nx*2
        i += 1
    print(i)
n = int(input())
a = 2
b = 1
for i in range(n-1):
    c=b+a
    a,b=b,c
print(c)

### FIXED CODE ###

n = int(input())
a = 2
b = 1
for i in range(n-1):
    c=b+a
    a,b=b,c
if n == 0:
    print(a)
elif n == 1:
    print(b)
else:
    print(c)
S = input()
if S[5:7] >= "04":
	print("TBD")
else
	print("Heisei")

### FIXED CODE ###

S = input()
if int(S[5:7]) <= 4:
    print("Heisei")
else:
    print("TBD")
import math
x1,y1,x2,y2 = (int(i) for i in input().split())
print(math.sqrt((x2-x1)**2+(y2-y1)**2))

### FIXED CODE ###

import math
x1,y1,x2,y2 = (float(i) for i in input().split())
print(math.sqrt((x2-x1)**2+(y2-y1)**2))
N,M=map(int, input().split())
P=[]
S=[]
for i in range(M):
    p,s=input().split()
    P.append(int(p))
    S.append(s)


import numpy as np
P=np.array(P)
S=np.array(S)

ans=np.unique(P[S=="AC"])

wa=0
for j in ans:
    for i in S[P==j]:
        if i=="WA":
            wa+=1
        else:
            break

print(len(ans),wa)

### FIXED CODE ###

N,M=map(int,input().split())
AC={}
WA={}
for i in range(M):
    a,b=input().split()
    if not(a in AC.keys()):
        if b=="AC":
            AC[a]=1
        else:
            if a in WA.keys():
                WA[a]+=1
            else:
                WA[a]=1
y=0
for i in AC.keys():
    if i in WA.keys():
        y+=WA[i]
print(sum(AC.values()),y)
a = list(map(int,ipnut().split()))
a = set(a)
if len(a)==2:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

def resolve():
    s = set(map(int,input().split()))
    if len(s) == 2:
        print("Yes")
    else:
        print("No")
resolve()
S = input()

S = S.split()

S = list(set(S))

if len(S == 2:
    print("Yes)
else:
    print("No")


### FIXED CODE ###

S = input()


S = list(set(S))

if len(S) == 2:
    print("Yes")
else:
    print("No")
N = int(input())
A = []
for i in range(1, N+1) :
    a = int(input())
    A.append(a)

ma = max(A)
mi = min(A)

print(ma - mi)

### FIXED CODE ###

n = int(input())
A = input().split()
for i in range(len(A)) :
    A[i] = int(A[i])
print(max(A)-min(A))
P,Q,R = int(input().split())
print(min(P+Q,P+R,Q+R))

### FIXED CODE ###

P,Q,R = map(int,input().split())
print(min(P+Q,P+R,Q+R))
N=int(input())
n=N[-1]
if n==3:
  ans='bon'
elif n==0 or n==1 or n==6 or n==8:
  ans='pon'
else:
  ans='hon'
print(ans)


### FIXED CODE ###

N=input()
n=N[-1]
if n=='3':
  ans='bon'
elif n=='0' or n=='1' or n=='6' or n=='8':
  ans='pon'
else:
  ans='hon'
print(ans)
import collections
N = int(input())
liss = []
for i in range(N):
  s = input()
  a = s.sorted()
  if a in liss:
    liss[a] += 1
  else:
    liss[a] = 1

ans = 0
for cc in liss:
  ans = ans + (liss[cc] * (liss[cc] - 1) / 2)
print(int(ans))


### FIXED CODE ###

N = int(input())
liss = {}
for i in range(N):
  s = input()
  a = "".join(sorted(s))
  if a in liss:
    liss[a] += 1
  else:
    liss[a] = 1

ans = 0
for cc in liss:
  ans = ans + (liss[cc] * (liss[cc] - 1) / 2)
print(int(ans))
# -*- coding: utf-8 -*-
#レート 1-399：灰色 :gray
#レート 400-799：茶色 :brown
#レート 800-1199：緑色 : green
#レート 1200-1599：水色 :skyblue
#レート 1600-1999：青色 :blue
#レート 2000-2399：黄色 :yellow
#レート 2400-2799：橙色 :orange
#レート 2800-3199：赤色 :red

x = int(input())

y = input().split()

gray = 0
brown = 0
green = 0
skyblue = 0
blue = 0
yellow = 0
orange = 0
red = 0
other = 0

for i in range(x):
    z = int(y[i]) 
    if z < 400:
       gray = 1 
    elif z < 800:
        brown = 1
    elif z < 1200:
        green = 1
    elif z < 1600:
        skyblue = 1
    elif z < 2000:
        blue = 1
    elif z < 2400:
        yellow = 1
    elif z < 2800:
        orange = 1
    elif z < 3200:
        red = 1
    else:
        other = other + 1

if other > 1:
    ans_max = gray + brown + green + skyblue + blue + yellow + orange + red + other
    ans_min = gray + brown + green + skyblue + blue + yellow + orange + red + 1
    
    print(ans_min & " " & ans_max)

else:
    ans = gray + brown + green + skyblue + blue + yellow + orange + red + other
    
    print(ans & " " & ans)
    


### FIXED CODE ###

# -*- coding: utf-8 -*-
#レート 1-399：灰色 :gray
#レート 400-799：茶色 :brown
#レート 800-1199：緑色 : green
#レート 1200-1599：水色 :skyblue
#レート 1600-1999：青色 :blue
#レート 2000-2399：黄色 :yellow
#レート 2400-2799：橙色 :orange
#レート 2800-3199：赤色 :red

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

gray = 0
brown = 0
green = 0
skyblue = 0
blue = 0
yellow = 0
orange = 0
red = 0
other = 0

for i in range(x):
    z = int(y[i]) 
    if z < 400:
       gray = 1 
    elif z < 800:
        brown = 1
    elif z < 1200:
        green = 1
    elif z < 1600:
        skyblue = 1
    elif z < 2000:
        blue = 1
    elif z < 2400:
        yellow = 1
    elif z < 2800:
        orange = 1
    elif z < 3200:
        red = 1
    else:
        other = other + 1

if other >= 1:
    ans_max = gray + brown + green + skyblue + blue + yellow + orange + red + other
    ans_min = gray + brown + green + skyblue + blue + yellow + orange + red + 0
    
    if ans_min == 0:
        ans_min = 1
    
    print(str(ans_min) + " " + str(ans_max))

else:
    ans = gray + brown + green + skyblue + blue + yellow + orange + red + other
    
    print(str(ans) + " " + str(ans))
s,t=map(int,input().split())
a,b=map(int,input().split())
if s==input(): a-=1
else: b-=1
print(a,b)

### FIXED CODE ###

s,t=map(str,input().split())
a,b=map(int,input().split())
u=input()
if s==u: a-=1
else: b-=1
print(a,b)
S = str(input())
T = str(input())

Sum = 0

for i in range(S):
    if S[i] == T[i]:
        Sum += 1
        
print(Sum)

### FIXED CODE ###

S = str(input())
T = str(input())

Sum = 0

for i in range(len(S)):
    if S[i] == T[i]:
        Sum += 1
        
print(Sum)
input()

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

sum = 0

for x in a:
    sum += x

print(min(a), max(a), sum)


### FIXED CODE ###

input()

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

s = 0

for i in a:
    s = s + i

print(min(a), max(a), s)
import math
from math import gcd,pi,sqrt
INF = float("inf")
MOD = 10**9 + 7

import sys
sys.setrecursionlimit(10**6)
import itertools
import bisect
from collections import Counter,deque
def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_str(N): return [s_list() for _ in range(N)]
def s_row_list(N): return [list(s_input()) for _ in range(N)]


def main():
    a,b,c,d,e,f = i_map()
    W = set()
    for i in range(0,f+1,a**100):
        for j in range(0,f+1, b*100):
            W.add(i+j)

    S = set()
    for i in range(0,f+1, c):
        for j in range(0, f+1, d):
            S.add(i+j)

    rate = -1

    for w in W:
        for s in S:
            if 0 < w+s <= f and s <= w*e//100:
                if s/(w+s) > rate:
                    rate = s/(w+s)
                    ans = w+s,s
    print(ans[0], ans[1])






if __name__=="__main__":
    main()


### FIXED CODE ###

import math
from math import gcd,pi,sqrt
INF = float("inf")
MOD = 10**9 + 7

import sys
sys.setrecursionlimit(10**6)
import itertools
import bisect
from collections import Counter,deque
def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_str(N): return [s_list() for _ in range(N)]
def s_row_list(N): return [list(s_input()) for _ in range(N)]


def main():
    a,b,c,d,e,f = i_map()
    W = set()
    for i in range(0,f+1,a*100):
        for j in range(0,f+1, b*100):
            W.add(i+j)

    S = set()
    for i in range(0,f+1, c):
        for j in range(0, f+1, d):
            S.add(i+j)

    rate = -1

    for w in W:
        for s in S:
            if 0 < w+s <= f and s <= w*e//100:
                if s/(w+s) > rate:
                    rate = s/(w+s)
                    ans = (w+s,s)
    print(ans[0], ans[1])





if __name__=="__main__":
    main()
from collections import defaultdict
def main():
    n,x,m = map(int,input().split())
    d = defaultdict(bool)
    t = [x]
    k = -1
    for _ in range(n):
        x = x**2 % m
        if d[x]:
            k = x
            break
        else:
            d[x] = True
        t.append(x)
    s = t.index(k)
    if s == -1:
        print(sum(t))
        return
    else:
        ans = sum(t[0:s])
        b = t[s:len(t)]
        n -= s
        ans += sum(b) * (n//len(b))
        ans += sum(b[0:n%len(b)])
        print(ans)

if __name__ == "__main__":
    main()

### FIXED CODE ###

def main():
    n,x,m = map(int,input().split())
    if m == 0:
        print(0)
        return
    t = [x]
    k = -1
    for _ in range(n-1):
        x = x**2 % m
        if x in t:
            k = x
            break
        t.append(x)
    if k not in t:
        print(sum(t))
        return
    else:
        s = t.index(k)
        ans = sum(t[0:s])
        b = t[s:len(t)]
        n -= s
        ans += sum(b) * (n//len(b))
        ans += sum(b[0:n%len(b)])
        print(ans)

if __name__ == "__main__":
    main()
N = int(input())
a = list(map(int, input().split()))
flag = [0]*9
ans = 0
ans_max =0
for i in range(N):
    num = int(a[i]/400)
    flag[num]+=1
for i in range(len(flag)-1):
    if flag[i]>=1:
        ans += 1
if flag[8]>8:
    ans_sum = ans + 8
else:
    ans_sum = ans + flag[8]
    
print(ans, ans_sum)

### FIXED CODE ###

# coding: utf-8

N = int(input())
a = list(map(int, input().split()))
flag = [0]*9
ans = 0
ans_max =0
for i in range(N):
    num = a[i]//400
    if num>=8:
        flag[8]+=1
    else:
        flag[num]=1
ans = sum(flag[:-1])
if ans == 0:
    ans =1
    ans_sum = flag[8]
else: 
    ans_sum= ans+flag[8]
    
print(ans, ans_sum)
import math
from decimal import *
import sympy
a, b, h, m = map(int, input().split())

big = max(30*h, 6*m)
small = min(30*h, 6*m)
gap = min(big - small, 360 - (big - small)) + (m*0.5)


print(format(math.sqrt(a**2 + b**2 - 2*a*b*math.cos(math.radians(gap))), ".20f"))

### FIXED CODE ###

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

big = max(30*h + (m*0.5), 6*m)
small = min(30*h + (m*0.5), 6*m)
gap = min(big - small, 360 - (big - small))

print(format(math.sqrt(a**2 + b**2 - 2*a*b*math.cos(math.radians(gap))), ".20f"))
n,z,w=map(int,input().split())
a=list(map(int,input().split()))
cand1=abs(a[-1]-a[-2])
cand2=abs(a[-1]-w)
res=max(cand1,cand2)
print(res)

### FIXED CODE ###

n,z,w=map(int,input().split())
a=list(map(int,input().split()))
print(max(abs(a[-2]-a[-1]),abs(a[-1]-w)) if n>=2 else abs(a[-1]-w))
N ,K = map(int, input().split())

import math

A = list(map(int, input().split()))
d = [0] * N

#二分探索
min = 1
max = max(A)

while True:
    X = (min + max)//2
    for i in range(N):
        d[i] = math.ceil(A[i]/X) - 1
    if sum(d) <= K:
        max = X - 1
    else:
        min = X + 1
    #print(min, max)
    
    if min == max:
        print(int(max))
        break

### FIXED CODE ###

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

A = list(map(int, input().split()))
d = [0] * N

#二分探索
min1 = 0
max1 = max(A) + 1

while True:
    X = (min1 + max1)//2
    for i in range(N):
        if A[i] % X == 0:
            d[i] = A[i]//X - 1
        else:
            d[i] = A[i]//X
    if sum(d) <= K:
        max1 = X 
    else:
        min1 = X
    #print(min1, max1)

    if max1 - min1 <= 1:
        print(int(max1))
        break
import numpy as np

N, M = [int(c) for c in input().split()]
F = np.zeros((N+2, M+2), dtype="int8")
C = F.copy()
c = np.ones((N, M), dtype="int8")
C[1:-1, 1:-1] += c

F[:-1, :] += C[1:, :]
F[1:, :] += C[:-1, :]
F[:, :-1] += C[:, 1:]
F[:, 1:] += C[:, :-1]
F[:-1, 1:] += C[1:, :-1]
F[1:, :-1] += C[:-1, 1:]
F[:-1, :-1] += C[1:, 1:]
F[1:, 1:] += C[:-1, :-1]

print(np.sum(np.where(F[1:-1, 1:-1] % 2, 0, 1)))

### FIXED CODE ###

N, M = [int(c) for c in input().split()]

if N == 1 and M == 1:
    print(1)
elif N == 1 or M == 1:
    print(M+N - 3)
else:
    print((M-2) * (N-2))
a = input()
s = input()

if a >= 3200:
	print(s)
else
	print("red")



### FIXED CODE ###

a = input()
s = input()

if int(a) < 3200:
	print("red")
else:
	print(s)
#coding: UTF-8

x = raw_input().split()

y = map(int,x)

a = y[0]
b = y[1]

c = a*b
d = (a+b)*2

print c, d


### FIXED CODE ###

x=int(input())
print(x*x*x)
S = input()
K = int(input())

s_list = list(S)

modified = "mdf"

def solve():
    # その単語に1種類の文字しかなければ、合計の文字数を2で割捨てした数
    if len(set(s_list)) == 1:
        return (len(s_list * K))//2
    
    cnt = 1
    cnt_list = []
    for i in range(len(S)-1):
        if s_list[i] == s_list[i+1]:
            cnt += 1
        else:
            cnt_list.append(cnt)
            cnt = 1
    
    # 最後の対応
    # cnt = 1の時、最後は1文字だけ
    # cnt >= 2の時、最後は同じ文字が続いてる
    cnt_list.append(cnt)
    
    # 最初と最後が同じ時は最初と最後を足したやつを作る必要。
    head = cnt_list[0]
    tail = cnt_list[-1]
    body = cnt_list[1:-1]
    
    if s_list[0] == s_list[-1]:
        head_tail = cnt_list[0] + cnt_list[-1]
        return head//2 + tail//2 + (sum(body)//2)*K + (head_tail//2)*(K-1)
    else:
        return (head//2 + tail//2 + sum(body)//2) * K

result = solve()

print(result)

### FIXED CODE ###

S = input()
K = int(input())

s_list = list(S)

modified = "mdf"

def solve():
    # その単語に1種類の文字しかなければ、合計の文字数を2で割捨てした数
    if len(set(s_list)) == 1:
        return (len(s_list)*K)//2
    
    cnt = 1
    cnt_list = []
    for i in range(len(s_list)-1):
        if s_list[i] == s_list[i+1]:
            cnt += 1
        else:
            cnt_list.append(cnt)
            cnt = 1
    
    # 最後の対応
    # cnt = 1の時、最後は1文字だけ
    # cnt >= 2の時、最後は同じ文字が続いてる
    cnt_list.append(cnt)
    
    # 最初と最後が同じ時は最初と最後を足したやつを作る必要。
    head = cnt_list[0]
    tail = cnt_list[-1]
    body = cnt_list[1:-1]
    
    def body_change_cnt(body):
        cnt = 0
        for b in body:
            cnt += b//2
        return cnt
    
    if s_list[0] == s_list[-1]:
        head_tail = cnt_list[0] + cnt_list[-1]
        return head//2 + tail//2 + body_change_cnt(body)*K + (head_tail//2)*(K-1)
    else:
        return (head//2 + tail//2 + body_change_cnt(body)) * K

result = solve()

print(result)
N, Q = map(int,input().split())

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

# print(AB)

# 添字を1からにしたいのでN+1
graph = [[] for _ in range(N+1)]

# 各頂点に隣接する頂点
for a,b in AB:
    graph[a].append(b)
    graph[b].append(a)

# print(graph)
counter = [0] * (N+1)

# print(counter)

PX = [[int(x) for x in input().split()] for _ in range(Q)]

# 各頂点に点数を足す
for p,x in PX:
  counter[p] += x


def shori(pa,c,val):
  val += counter[c]
  counter[c] = val
  for i in graph[c]:
    if i == pa:
      continue
    shori(c,i,val)
  
shori(0,1)
  

print(" ".join(map(str, counter[1:])))



### FIXED CODE ###

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

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

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

# print(AB)

# 添字を1からにしたいのでN+1
graph = [[] for _ in range(N+1)]

# 各頂点に隣接する頂点
for _ in range(N-1):
    a, b = map(int, input().split())
    graph[a].append(b)
    graph[b].append(a)

# print(graph)
counter = [0] * (N+1)

# print(counter)

# PX = [[int(x) for x in input().split()] for _ in range(Q)]

# 各頂点に点数を足す
for _ in range(Q):
  p, x = map(int, input().split())
  counter[p] += x


def shori(pa,c,val):
  val += counter[c]
  counter[c] = val
  for i in graph[c]:
    if i == pa:
      continue
    shori(c,i,val)
  
shori(0,1,0)
  

print(" ".join(map(str, counter[1:])))
A, B, C, X, Y = map(int, input().split())

if Y == X:
    if C * 2 < A + B:
        res = C * X * 2
        print(res)
        
elif Y < X:
    if C * 2 <= A + B:
        res = C * Y * 2
        if C * 2 <= A:
            res += (X - Y) * 2 * C
        else:
            res += (X - Y) * A
    else:
        res = A * X + B * Y

else:
    if C * 2 <= A + B:
        res = C * X * 2
        if C * 2 <= B:
            res += (Y - X) * 2 * C
        else:
            res += (Y - X) * B
    else:
        res = A * X + B * Y

print(res)

### FIXED CODE ###

A, B, C, X, Y = map(int, input().split())

if Y == X:
    if C * 2 < A + B:
        res = C * X * 2
    else:
        res = A * X + B * Y
        
elif Y < X:
    if C * 2 <= A + B:
        res = C * Y * 2
        if C * 2 <= A:
            res += (X - Y) * 2 * C
        else:
            res += (X - Y) * A
    else:
        res = A * X + B * Y

else:
    if C * 2 <= A + B:
        res = C * X * 2
        if C * 2 <= B:
            res += (Y - X) * 2 * C
        else:
            res += (Y - X) * B
    else:
        res = A * X + B * Y

print(res)
line = input()
line = list(line)

count = 0
for i in line:
	if i == "1":
      count += 1
      
print(count)


### FIXED CODE ###

line = input()
line = list(line)

count = 0
for i in line:
    if i == "1":
        count += 1
        
print(count)
import sys


def input():
    return sys.stdin.readline().strip()


sys.setrecursionlimit(20000000)


def main():
    N, M = map(int, input().split())
    S = []

    d = [[float("inf")] * N for _ in range(N)]
    L = []
    for i in range(M):
        a, b, c = map(int, input().split())
        d[a - 1][b - 1] = c
        d[b - 1][a - 1] = c
        if a < b:
            L.append((a - 1, b - 1))
        else:
            L.append(b - 1, a - 1)
    for i in range(N):
        d[i][i] = 0
    L = set(L)

    def warshall_floyd(d):
        # d[i][j]: iからjへの最短距離
        for k in range(N):
            for i in range(N):
                for j in range(N):
                    if d[i][j] > d[i][k] + d[k][j]:
                        d[i][j] = d[i][k] + d[k][j]
                        if i < j:
                            if (i, j) in L:
                                S.append((i, j))
                        else:
                            if (j, i) in L:
                                S.append((j, i))
        return d

    warshall_floyd(d)
    print(len(set(S)))


if __name__ == "__main__":
    main()


### FIXED CODE ###

import sys


def input():
    return sys.stdin.readline().strip()


sys.setrecursionlimit(20000000)


def main():
    N, M = map(int, input().split())
    S = []

    d = [[float("inf")] * N for _ in range(N)]
    L = []
    for i in range(M):
        a, b, c = map(int, input().split())
        d[a - 1][b - 1] = c
        d[b - 1][a - 1] = c
        if a < b:
            L.append((a - 1, b - 1))
        else:
            L.append((b - 1, a - 1))
    for i in range(N):
        d[i][i] = 0
    L = set(L)

    def warshall_floyd(d):
        # d[i][j]: iからjへの最短距離
        for k in range(N):
            for i in range(N):
                for j in range(N):
                    if d[i][j] > d[i][k] + d[k][j]:
                        d[i][j] = d[i][k] + d[k][j]
                        if i < j:
                            if (i, j) in L:
                                S.append((i, j))
                        else:
                            if (j, i) in L:
                                S.append((j, i))
        return d

    warshall_floyd(d)
    print(len(set(S)))


if __name__ == "__main__":
    main()
n = int(input())
 
def p(x):
  if x == 2:
    return True
  for i in range(x/2):
    if x % i == 0:
      return False
  return True
 
for i in range(n,2*n):
  if p(i):
    print(i)
    break


### FIXED CODE ###

n = int(input())
 
def p(x):
  if x == 2:
    return True
  for i in range(2,x//2):
    if x % i == 0:
      return False
  return True
 
for i in range(n,2*n):
  if p(i):
    print(i)
    break