Harryxun/stf_run huggingface dataset:
# -*- coding: utf-8 -*-

import numpy as np

s = input()

x = np.base_repr(int(s), 26)

strings = {
"0": "a",
"1": "b",
"2": "c",
"3": "d",
"4": "e",
"5": "f",
"6": "g",
"7": "h",
"8": "i",
"9": "j",
"A": "k",
"B": "l",
"C": "m",
"D": "n",
"E": "o",
"F": "p",
"G": "q",
"H": "r",
"I": "s",
"J": "t",
"K": "u",
"L": "v",
"M": "w",
"N": "x",
"O": "y",
"P": "z",
}

strings_2 = {
"1": "a",
"2": "b",
"3": "c",
"4": "d",
"5": "e",
"6": "f",
"7": "g",
"8": "h",
"9": "i",
"A": "j",
"B": "k",
"C": "l",
"D": "m",
"E": "n",
"F": "o",
"G": "p",
"H": "q",
"I": "r",
"J": "s",
"K": "t",
"L": "u",
"M": "v",
"N": "w",
"O": "x",
"P": "y",
"Q": "z"
}

_index = 0
r = ''
for i in list(x):
    if _index == len(list(x)):
        r += strings[i]
    else:
        r += strings_2[i]
    _index += 1

print(r)


### FIXED CODE ###

# -*- coding: utf-8 -*-

n = int(input())

r = ''

def to_moji(x: int):
    if x == 0:
        x = 26
    return chr(96 + x)

def devide(x, moji):
    a = x // 26
    b = x % 26

    if b == 0:
        a -= 1

    if a < 1:
        moji = to_moji(b) + moji
        return moji
    elif 1 <= a and a <= 26:
        moji = to_moji(b) + moji
        moji = to_moji(a) + moji
        return moji
    else:
        moji = to_moji(b) + moji
        return devide(a, moji)

print(devide(n, r))
flg = 0
for s in n:
    if s == '7':
        print(s)
        flg = 1

if flg == 1:
      print('Yes')
else:
      print('No')


### FIXED CODE ###

n=input()
flg = 0
for s in n:
    if s == '7':
        flg = 1
 
if flg == 1:
      print('Yes')
else:
      print('No')
from decimal import Decimal

IN = input().split()
A = Decimal(IN[0])
B = Decimal(IN[1])

ans = A*B

if ans < 1:
    print(0)
else:
    math.floor(ans)

### FIXED CODE ###

from decimal import Decimal,ROUND_FLOOR

IN = input().split()
A = Decimal(IN[0])
B = Decimal(IN[1])

ans = A*B

if ans < 1:
    print(0)
else:
    print(ans.quantize(Decimal("0"), rounding=ROUND_FLOOR))
import sys
from collections import deque

N=input()
A=map(int, sys.stdin.readline().split())

dp=[ [ 0 for i in range(N) ]  for j in range(N) ]

def func(x,y,cnt):
	if dp[x][y]!=0: return dp[x][y]

	ret=0
	if x==y:
		if cnt%2==0:
			ret=A[x]
			dp[x][y]=ret
			return ret
		else:
			ret=-1*A[x]
			dp[x][y]=ret
			return ret
	if cnt%2==0:
		cnt+=1
		ret+=max( func(x,y-1,cnt)+A[y] , func(x+1,y,cnt)+A[x]  )
	else:
		cnt+=1
		ret+=min( func(x,y-1,cnt)-A[y] ,func(x+1,y ,cnt)-A[x] )

	dp[x][y]=ret
	return ret

func(0,N-1,0)


print dp[0][N-1]


### FIXED CODE ###

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

N=input()
A=map(int, sys.stdin.readline().split())

dp=[ [ None for i in range(N) ]  for j in range(N) ]


for i in range(N-1,-1,-1):
	if N%2==0:
		dp[i][i]=A[i]*-1
	else:
		dp[i][i]=A[i]


for i in range(N-2,-1,-1):
	for j in range(i+1,N):
		t=N-(j-i+1)	#残りの要素数
		if t%2==0:
			if dp[i][j] is None : dp[i][j]=float("-inf")
			dp[i][j]=max(dp[i][j] , dp[i][j-1]+A[j])
			dp[i][j]=max(dp[i][j] , dp[i+1][j]+A[i])
		else:
			if dp[i][j] is None : dp[i][j]=float("inf")
			dp[i][j]=min(dp[i][j] , dp[i][j-1]-A[j])
			dp[i][j]=min(dp[i][j] , dp[i+1][j]-A[i])

print dp[0][N-1]
from collections import deque

h,w = map(int,input().split())
ch,cw = map(int,input().split())
dh,dw = map(int,input().split())
S = ["#" *(w+2) ] + ["#" + input()+ "#" for _ in range(h)] + ["#" *(w+2) ]
v = [[10 ** 6]*(h+2) for _ in range(w+2)]
v[ch][cw] = 0
Q = deque([(ch,cw)])
while Q :
    y,x = Q.popleft()

    for i,j in [(0,1),(1,0),(-1,0),(0,-1)] :
        if S[y+i][x+j] == "." and v[y+i][x+j] > v[y][x]:
            v[y+i][x+j] = v[y][x]
            Q.append([y+i,x+j])
    for i in range(-2,3) :
        for j in range(-2,3) :
            if i == j == 0 :
                continue
            elif 1 <= y+i <= h and 1 <= x+j <= w and S[y+i][x+j] == "." and v[y+i][x+j] > v[y][x] + 1 :
                v[y+i][x+j] = v[y][x] + 1
                Q.appendleft((y+i,x+j))
ans = v[dh][dw]
if ans == 10 ** 6 :
    print(-1)
else :
    print(ans)

### FIXED CODE ###

from collections import deque

h,w = map(int,input().split())
ch,cw = map(int,input().split())
dh,dw = map(int,input().split())
S = ["#" *(w+2) ] + ["#" + input()+ "#" for _ in range(h)] + ["#" *(w+2) ]
v = [[10 ** 6]*(w+2) for _ in range(h+2)]
v[ch][cw] = 0
Q = deque([(ch,cw)])
while Q :
    y,x = Q.pop()
    for i,j in [(0,1),(1,0),(-1,0),(0,-1)] :
        if S[y+i][x+j] == "." and v[y+i][x+j] > v[y][x]:
            v[y+i][x+j] = v[y][x]
            Q.append((y+i,x+j))
    for i in range(-2,3) :
        for j in range(-2,3) :
            if i == j == 0 :
                continue
            elif 1 <= y+i <= h and 1 <= x+j <= w and S[y+i][x+j] == "." and v[y+i][x+j] > v[y][x] + 1 :
                v[y+i][x+j] = v[y][x] + 1
                Q.appendleft((y+i,x+j))
ans = v[dh][dw]
if ans == 10 ** 6 :
    print(-1)
else :
    print(ans)
l = map(int, input().split())
a=list(l)
x1=a[0]
y1=a[1]
x2=a[2]
y2=a[3]
x=x2-x1
y=y2-y1
x3=x2-y
y3=y2+x
x4=x1-y
y4=y1+x
c=[x3, y3, x4, y4]
print(c[0], c[1], c[2], c[3])

### FIXED CODE ###

N= int(input())
print(N//2 * (N-N//2))
n=int(input())
a=list(map(int,input().split()))
l=[0]*(10**6+1)
for m in a:
  l[m]=1
x=0
j=2
#print(l)
for i in range(n):
  c=0
  k=1
  while j*k<=10**6+1 :
    if l[j*k]==1:
      c+=1
      l[j*k]=0
    k+=1
  if c==n:
    print("not coprime")
    exit()
  elif c>1:
    x=1
  j+=1 
if x==1:
  print("setwise coprime")
else:
  print("pairwise coprime")
  
    


### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
l=[0]*(10**6+100)
x=0
for m in a:
  l[m]+=1

j=2
#print(l)


while j <10**6+1:
  c=0
  k=1
  while j*k<=10**6+1 :
    if l[j*k]>0:
      c+=l[j*k]
    k+=1

  if c==n:
    print("not coprime")
    exit()
  elif c>1:
    x=1
  j+=1 
  
if x==1:
  print("setwise coprime")
else:
  print("pairwise coprime")
n = int(input())
A = list(map(int, input().split())).sort()
ans = 0
for a, b in zip(A, A[1:]):
  ans += a
print(ans)

### FIXED CODE ###

n = int(input())
A = sorted(list(map(int, input().split())))
ans = 0
flag = True
for i in reversed(range(len(A))):
  if flag is False:
    flag = True
    continue
  if i - 1 < 0:
    continue
  ans += A[i - 1]
  flag = False
print(ans)
from collections import Counter

N,M = map(int,input().split())
num = [i for i in range(N+1)]
ab = [list(map(int,input().split())) for _ in range(M)]

ab.sort()

for a,b in ab:
    m = min(num[a],num[b])
    num[a] = num[b] = m

print(max(Coutner(num).values()))

### FIXED CODE ###

class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())



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

for _ in range(M):
    a,b = map(int,input().split())
    uf.union(a-1,b-1)

ans = 1
for i in range(N):
    ans = max(ans,uf.size(i))

print(ans)
# AtCoder Grand Contest 041
# A - Table Tennis Training

def f(A,B,n):
    judge=abs(B-A)
    if judge%2==0:
        n+=judge//2
        return(n)
    else:
        if abs(1-A) < abs(N-B) :
            if A>1:
                A-=1
                B-=1
                n+=1
            else:
                B-=1
                n+=1
            return f(A,B,n)
        else:
            if B<N:
                B+=1
                A+=1
                n+=1
            else:
                A+=1
                n+=1
            return f(A,B,n)


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

print(f(A,B,0))

### FIXED CODE ###

# AtCoder Grand Contest 041
# A - Table Tennis Training

def f(A,B,n) :
    judge=B-A

    if judge%2==0 :
        n+=judge//2
        return(n)

    else :
        if abs(A-1) < abs(N-B) :
            if A==1 :
                A=A
                B-=1
                n+=1
            else:
                B-=A-1
                n+=A-1
                A-=A-1
            return f(A,B,n)
        else :
            if B==N :
                B=B
                A+=1
                n+=1
            else :
                A+=abs(N-B)
                n+=abs(N-B)
                B+=abs(N-B)
            return f(A,B,n)

N,A,B=map(int,input().split())
print(f(A,B,0))
#%%
import itertools

D, G = map(int, input().split())
p = [0] * D
c = [0] * D
com = [0] * D
for i in range(D):
    p[i], c[i] = map(int, input().split())
    com[i] = [100 * (i+1) * p[i] + c[i], p[i]]

l = list(itertools.product(range(2), repeat=D))
score_list = []
for i in range(len(l)):
    tmp1 = 0
    tmp2 = []
    tmp3 = -1
    tmp5 = 0
    for j in range(D):
        if l[i][j] == 0:
            tmp2.append(j)
            pass
        else:
            tmp1 += com[j][0]
            tmp5 += com[j][1]
    if len(tmp2) != 0:
        tmp3 = tmp2[-1]
    if tmp3 != -1:
        tmp4 = tmp1 + (tmp3+1) * 100 * (p[tmp3]-1)
    else:
        tmp4 = tmp1
    
    score_list.append([tmp1, tmp3, tmp4, tmp5])

#print(score_list)

ans_list = []

for i in range(len(score_list)):
    if score_list[i][2] != -1:
        if score_list[i][0]<= G and score_list[i][2] >= G:
            tmp = (G - score_list[i][0]) // ((score_list[i][1]+1)*100)
            ans = score_list[i][3] + tmp
            ans_list.append(ans)
#            print(score_list[i][3], ans)
    else:
        if score_list[i][0]>= G:
            ans_list.append(score_list[i][3])

#print(ans_list)
print(min(ans_list))



### FIXED CODE ###

import itertools
D, G = map(int, input().split())
p = [0] * D
c = [0] * D
pc = [0] * D
for i in range(D):
    p[i], c[i] = map(int, input().split())

l = list(itertools.product(range(2), repeat=D))

comp = []
for i in range(len(l)-1):
    score = 0
    count = 0
    m = -100
    for j in range(D):
        if l[i][j] == 1:
            score += (j+1) * 100 * p[j] + c[j]
            count += p[j]
        elif l[i][j] == 0:
            m = max(m, j)
    tmp = [score, count]
    comp.append(tmp)
    for j in range(p[m]-1):
        score += (m+1) * 100 * 1
        count += 1
        tmp = [score, count]
        comp.append(tmp)

score = 0
count = 0
for i in range(D):
    score += (i+1) * 100 * p[i] + c[i]
    count += p[i]
tmp = [score, count]
comp.append(tmp)    

#print(comp)

ans = []
for i in range(len(comp)):
    if comp[i][0] >= G:
        ans.append(comp[i][1])

ans = min(ans)
print(ans)
N,K = [int(a) for a in input().split()]
A = [int(a) for a in input().split()]

idx = [-1 for _ in range(len(A))]
now = 0
period = 0
bias = 0
tmp = []
for i in range(K+1):
    tmp.append(now+1)
    if idx[now] == -1:
        idx[now] = i
    else:
        period = i - idx[now]
        cycle = tmp[-period-1:-1]
        bias = i - period
        break
    now = A[now]-1

if K <= bias:
    now = 0
    for _ in range(K):
        now = A[now] - 1
    print(now + 1)
else:
    K -= bias
    K = K % period
    print(cycle[K])

### FIXED CODE ###

def solve(N, K, A):
    idx = [-1 for _ in range(len(A))]
    now = 0
    period = 0
    bias = 0
    tmp = []
    found = False
    i = 0
    while not found:
        tmp.append(now+1)
        if idx[now] == -1:
            idx[now] = i
        else:
            period = i - idx[now]
            cycle = tmp[-period-1:-1]
            bias = i - period
            break
        now = A[now]-1
        i += 1

    if K <= bias:
        now = 0
        for _ in range(K):
            now = A[now] - 1
        print(now + 1)
    else:
        K -= bias
        K = K % period
        print(cycle[K])

if __name__=="__main__":
    N,K = [int(a) for a in input().split()]
    A = [int(a) for a in input().split()]
    solve(N, K, A)
N, M, K = map(int, input().split())

MOD = 10**9+7
fact = [1 for i in range(N+1)]
for i in range(2, N+1):
    fact[i] = fact[i-1] * i

def comb(n, r):
    return fact[n] // fact[n-r] // fact[r]

p = comb(K-2, N*M-2)
ans = 0
for i in range(N):
    for j in range(M):
        if i == 0 and j == 0:
            continue
        d = i+j
        #print(i, j, calc_rec_num(N, M, 0, 0, i, j))
        cnt = (N-i) * (M-j)
        if i != 0 and j != 0:
            cnt *= 2
        ans += d * cnt
        #if ans > DIV:
        #    ans %= DIV
        #print(ans)

print((ans*p)%MOD)


### FIXED CODE ###

from math import factorial
N, M, K = map(int, input().split())

MOD = 10**9+7

fact = [1] * (N*M+1)
for i in range(2, N*M+1):
    fact[i] = fact[i-1] * i % MOD

def comb(n, r):
    r = n-r if n-r < r else r
    return fact[n] * pow(fact[r], MOD-2, MOD) * pow(fact[n-r], MOD-2, MOD) % MOD

p = comb(N*M-2, K-2)
ans = 0
for i in range(N):
    for j in range(M):
        if i == 0 and j == 0:
            continue
        d = i+j
        cnt = (N-i) * (M-j)
        if i != 0 and j != 0:
            cnt *= 2
        ans += d * cnt % MOD
ans = ans * p % MOD

print(ans)
print(x*3)

### FIXED CODE ###

x = int(input())
print(x ** 3)
n = int(input())
l = []
for i in range(N):
  a, b = input().split()
  l.append((i+1, a, int(b)))
  
l = sorted(l, key=lambda x: (x[1],x[2]))
for i in l:
  print(i[0])

### FIXED CODE ###

n = int(input())
l = []
for i in range(n):
  a, b = input().split()
  l.append((i+1, a, int(b)))
  
l = sorted(l, key=lambda x: (x[1],-x[2]))
for i in l:
  print(i[0])
h = int(input())
w = int(input())
s = list(input() for i in range(1,h+1)
number = []
cnt = 0

for i in range(1,h+1) :
  if i != 1 and i != h :
    for j in range(1,w+1) :
      if j != 1 and j != w :
        number = [s[i-1][j-1],s[i-1][j],s[i-1][j+1],s[i][j-1],s[i][j+1],s[i+1][j-1],s[i+1][j],s[i+1][j+1]]
        cnt = number.count('#')
        s[i][j] = cnt
  
  elif i == 1 :
    for j in range(1,w+1) :
      if j != 1 and j != w :
        number = [s[i-1][j-1],s[i-1][j],s[i-1][j+1],s[i][j-1],s[i][j+1],s[i+1][j-1],s[i+1][j],s[i+1][j+1]]
        cnt = number.count('#') 
        s[i][j] = cnt
      
      elif j == 1 :
        number = [s[1][2],s[2][1],s[2][2]]
        cnt = number.count('#') 
        s[1][1] = cnt
        
      elif j == w :
        number = [s[1][w-1],s[2][w-1],s[2][w]]
        cnt = number.count('#') 
        s[1][w] = cnt        
  
  elif i == h :
    for j in range(1,w+1) :
      if j == 1 :
        number = [s[h-1][1],s[h-1][2],s[h][2]]
        cnt = number.count('#') 
        s[h][1] = cnt
        
      elif j == w :
        number = [s[h-1][w-1],s[h-1][w],s[h][w-1]]
        cnt = number.count('#') 
        s[h][w] = cnt
        
print(''.join(s))

### FIXED CODE ###

h, w = map(int, input().split())
ss = [[0] * w for _ in range(h)]
s = [list(input()) for _ in range(h)]
for i in range(h):
    for j in range(w):
        if s[i][j] == "#":
            for k in range(max(0, i - 1), min(h, i + 2)):
                for l in range(max(0, j - 1), min(w, j + 2)):
                    ss[k][l] += 1
for i in range(h):
    ans = ""
    for j in range(w):
        if s[i][j] == "#":
            ans += s[i][j]
        else:
            ans += str(ss[i][j])
    print(ans)
def solve(t,a,tp,ap):

    if t/a == tp/ap:
        return t,a
    
    next_t=0
    next_a=0
    
    num_a = max( int(a/ap)  , int(t/tp) )
    next_t = num_a*tp
    next_a = num_a*ap

    while not(next_t > t and next_a > a):
        next_t += tp
        next_a += ap
    return next_t,next_a


N = int(raw_input())
l = []
for i in range(N):
    l.append( map(float,raw_input().split()) )

t = 1.0
a = 1.0

while len(l):
    tp,ap = l.pop(0)
    t,a = solve(t,a,tp,ap)

print int(t+a)




### FIXED CODE ###

l =  map(int,raw_input().split())
print len(set(l))
n=int(input())
s=input()
r=S.count(".")
a=r
for i in range(n):
  if s[i]=="#":r+=1
  else:r-=1
  a=min(a,r)
print(a)


### FIXED CODE ###

n=int(input())
s=input()
r=s.count(".")
a=r
for i in range(n):
  if s[i]=="#":r+=1
  else:r-=1
  a=min(a,r)
print(a)
n,q = map(int, input().split())
Q = [0 for i in range(n+1)]
head = 0
tail = 0
def enqueue(x):
    global tail
    Q[tail] = ???
    tail = (tail + 1) % (n + 1)
def dequeue():
    global head
    x,t = Q[head]
    head = (head + 1) % (n + 1)
    return [x,t]
for i in range(n):
    P = input().split()
    enqueue([P[0], int(P[1])])
elaps = 0
while head != tail:
    u,t = dequeue()
    c = min(q, t)
    t -= c
    elaps += c
    if t > 0:
        enqueue([u,t])
    else:
        print(u + " " + str(elaps))

### FIXED CODE ###

n,q = map(int, input().split())
MAX = n + 2
Q = [0 for i in range(MAX)]
head = 0
tail = 0

def enqueue(u, t):
    global tail
    Q[tail] = [u, t]
    tail = (tail + 1) % MAX

def dequeue():
    global head
    x,t = Q[head]
    head = (head + 1) %MAX
    return [x,t]
for i in range(n):
    P = list(input().split())
    enqueue(P[0], int(P[1]))

elaps = 0
while head != tail:
    u,t = dequeue()
    c = min(q, t)
    t -= c
    elaps += c
    if t > 0:
        enqueue(u,t)
    else:
        print(u + " " + str(elaps))
from math import ceil
time_list = [int(input()) for i in range(5)]
sum_list = []
time_list_0 = []
for i in range(5):
    time_list_0[i] = ceil(time_list[i] / 10) * 10
for j in range(5):
    sum_list[i] = sum(time_list_0) - 10 + time_list[i] % 10
print(min(sum_list))


### FIXED CODE ###

from math import ceil
time_list = [int(input()) for i in range(5)]
sum_list = []
time_list_0 = []
for i in range(5):
    time_list_0.append(ceil(time_list[i] / 10) * 10)
for j in range(5):
    if time_list[j] % 10 == 0:
        sum_list.append(sum(time_list_0))
    else:
        sum_list.append(sum(time_list_0) - 10 + (time_list[j] % 10))
print(min(sum_list))
import math
import collections

def combinations_count(n, r):
	if n < 2:
		return 0
	return int(math.factorial(n) / math.factorial(r) /  math.factorial(n-r))

_ = int(input())
ns = input().split(" ")
cs = collections.Counter(ns)

c = 0
for n in ns:
	for k, v in cs.items():
		if v==1:
			c += 0
		elif n==k:
			c += combinations_count(v-1, 2)
		else:
			c += combinations_count(v, 2)
	print(c)
	c = 0

### FIXED CODE ###

N = int(input())
A = [int(a)-1 for a in input().split()]
X = [0] * N
for a in A:
	X[a] += 1
s = 0
for x in X:
	s += x * (x-1) // 2
for a in A:
	print(s - (X[a] - 1))
if int(input())==1:print("Hello World")else:print(int(input())+int(input()))

### FIXED CODE ###

if int(input())==1:
	print("Hello World")
else:
	print(int(input())+int(input()))
rate = input()
if rate < 1200 :
  print( "ABC" )
else :
  print( "ARC" )

### FIXED CODE ###

rate = int( input() )
if rate < 1200 :
  print( "ABC" )
else :
  print( "ARC" )
a = list(map(int, input().split()))
def fac(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            while temp%i==0:
                temp //= i
            arr.append(i)

    if temp!=1:
        arr.append(temp)

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

    return arr

la=fac(a[0])
lb=fac(a[1])


print(len(la & lb)+1)

### FIXED CODE ###

b = list(map(int, input().split()))
def fac(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

la=fac(b[0])
lb=fac(b[1])


print(len(set(la) & set(lb))+1)
#D    高橋君と見えざる手 / An Invisible Hand
N,T = [int(i) for i in input().split(" ")]
A=[int(i) for i in input().split(" ")]
Max = 0
count = 1
for i in range(N-1,0,-1):
    for j in range(i-1,-1,-1):
        temp = A[i]-A[j]
        if temp>Max:
            Max = temp
            count = 1
        elif temp==Max:
            count +=1

print(count)

### FIXED CODE ###

#003
list = list(input())
result = 0

for i in range(len(list)-1):
    if list[i]!=list[i+1]:
        result+=1

print(result)
from sympy import nextprime
n=int(input())

print (nextprime(n))

### FIXED CODE ###

n = int(input())
for i in range(n, 100004):
    flag = 0
    for j in range(2, int(i**(1/2)) + 1):
        if i % j == 0:
            flag = 1
            break
    if flag == 0:
        print(i)
        break
S = list(input())
n = len(S)
W = list('abcdefghijklmnopqrstuvwxyz')

ans = []
if S == list('zyxwvutsrqponmlkjihgfedcba'):
    print(-1)
elif n == 26:
    for i in range(n):
        if S[i] == W[i]:
            ans.append(W[i])
        else:
            ans.pop(-1)
            ans.append(W[i])
            break
    print(*ans, sep='')
else:
    for s in S:
        W.remove(s)
        ans.append(s)
    ans.append(W[0])
    print(*ans, sep='')


### FIXED CODE ###

S = list(input())

if len(S) < 26:
    W = list('abcdefghijklmnopqrstuvwxyz')
    for s in S:
        W.remove(s)
    S += W[0]
    print(*S, sep='')
else:
    s_last = S[-1]
    idx = -1
    for i in range(24, -1, -1):
        s = S[i]
        if s > s_last:
            s_last = s
        else:
            idx = i
            break
    if idx == -1:
        print(-1)
    else:
        res = []
        for s in S[idx+1:]:
            if s > S[idx]:
                res.append(s)
        res.sort()
        print(*(S[:idx] + [res[0]]), sep='')
S = input()
T = input()
cnt = 0
for i, v in zip(S,T):
  if v[0] == v[1]:
    continue
  else:
    S[i] = v[1]
    cnt += 1
print(cnt)

### FIXED CODE ###

S = input()
T = input()
cnt = 0
for i, v in enumerate(zip(S,T)):
  if v[0] == v[1]:
    continue
  else:
    cnt += 1
print(cnt)
O=input()
E=input()

b=[]

if(len(O)>len(E)):
    X=O
else:
    X=E

for i in range(len(X)):
    b.append(O[i])
    b.append(E[i])

a=str(b)

a=a.replace("'","")
a=a.replace(",","")
a=a.replace(" ","")
a=a.replace("[","")
a=a.replace("]","")



print(a)


### FIXED CODE ###

O=input()
E=input()

S=''

for i in range(len(E)):
    S+=O[i]+E[i]
if(len(O)>len(E)):
    S+=O[-1]

print(S)
a,b,c,k = map(int,input().split())

if a>=k:
    Result=k
elif a+b>=k>a:
    Result=a
else:
    Result=2a-k+b

print(Result)

### FIXED CODE ###

a,b,c,k = map(int,input().split())


if a>=k:
    Result=k
elif a+b>=k>a:
    Result=a
else:
    Result=2*a-k+b

print(Result)
import copy
N, M = map(int, input().split())

def f(x):
    return int(x) - 1

A = []
#B = []
C = []
for i in range(M):
    a, b = map(int, input().split())
    A.append(a)
    #B.append(b)
    C.append(list(map(f, input().split())))



def rec(cost, still_closed, d):
    """
    初期値
    cost = 0
    still_closed = [1]*N
    d = 0
    """
    if d == M:
        if sum(still_closed) == 0:
            return cost
        else:
            return - 1
    still_closed1 = copy.copy(still_closed)
    still_closed2 = copy.copy(still_closed)
    res1 = rec(cost, still_closed1, d + 1)
    for c in C[d]:
        still_closed[c] = 0
    res2 = rec(cost + A[d], still_closed, d + 1)
    if res1 == - 1 or res2 == - 1:
        return max(res1, res2)
    else:
        return min(res1, res2)

print(rec(0, [1]*N, 0))

### FIXED CODE ###

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

INF = 10**7
dp = [INF]*2**N
dp[0] = 0

for i in range(M):
    a, b = map(int, input().split())
    d = sum((1<< (i - 1)) for i in  map(int, input().split()))    
    for j in range(2**N):
        jord = j | d
        dp[jord] = min(dp[j] + a, dp[jord])
        
if dp[- 1] == INF:
    print(- 1)
else:
    print(dp[- 1])
a, b, c ,d = map(int,input().split(' '))
 L=a+b;R=c+d:
if L>R:
	print('Left')
elif L=R:
	print('Balance')
else:
	print('Right')


### FIXED CODE ###

a , b, c ,d = map(int,input().split(' '))
L=a+b
R=c + d
if L> R:
    print('Left')
elif L<R:
    print('Right')
else:
    print('Balanced ')