Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
x, k, d = map(int, input().split())

a = [abs(x // d), x % d]

if a[0] > k:
   ans = min(abs(x+k*d) ,abs(x-k*d))
else:
    b = (k- a[0]) % 2
    ans = min(abs(a[1]+b*d) ,abs(a[1]-b*d))

print(ans))

Fixed submission:
x, k, d = map(int, input().split())

a = [abs(x // d), x % d]

if a[0] > k:
   ans = min(abs(x+k*d) ,abs(x-k*d))
else:
    b = (k- a[0]) % 2
    ans = min(abs(a[1]+b*d) ,abs(a[1]-b*d))

print(ans)
Buggy python submission (verdict: Runtime Error):
#N,K入力
N,K= map(int,input().split())
#街の番号入力
A = [int(i) for i in input().split()]

# 重複した要素があるかどうかを判定
def has_duplicates(seq):
    return len(seq) == len(set(seq))

#移動経路
warp = [1]
a = 1

#同じ街にたどり着くまでループ
while has_duplicates(warp):
    a = A [a - 1]
    warp.append(a)
    #同じ街にたどり着かなかった場合はこっち
    if len(warp) == K +1:
        print(warp[K])
        break

l = [i for i, x in enumerate(warp) if x == a]

# 何回ワープしたらループする街に戻ってくるか
width = l[1] - l[0]

#　ループのどこに行くか
d = (K - l[0]) % (l[1]-l[0])

#結果の出力
print(A[d + l[0]])

Fixed submission:
#N,K入力
N,K= map(int,input().split())
#街のテレポート先入力
A = [int(i)-1 for i in input().split()]
judge = [-1] * N
judge[0] = 0
#初期位置
a = 0
#移動回数
step = 1

while step != K +1:
    #移動する街を決める
    a = A[a]
    if judge[a] > -1:
        break
    #何回目の移動なのか加える
    judge[a] = step
    step = step + 1

if step == K +1:
    print(a+1)
    # プログラム終了
else:
    width = step - judge[a]
    s =(K - judge[a]) % width
    print(judge.index(judge[a]+s)+1)

Buggy python submission (verdict: Runtime Error):
#N,K入力
N,K= map(int,input().split())
#街の番号入力
A = [int(i) for i in input().split()]

# 重複した要素があるかどうかを判定
def has_duplicates(seq):
    return len(seq) == len(set(seq))

#移動経路
warp = [1]
a = 1

#同じ街にたどり着くまでループ
while has_duplicates(warp):
    a = A [a - 1]
    warp.append(a)
    #同じ街にたどり着かなかった場合はこっち
    if len(warp) == K +1:
        print(warp[K])
        break

l = [i for i, x in enumerate(warp) if x == a]

# 何回ワープしたらループする街に戻ってくるか
width = l[1] - l[0]

#　ループのどこに行くか
d = (K - l[0]) % (l[1]-l[0])

#結果の出力
print(d + l[0])

Fixed submission:
#N,K入力
N,K= map(int,input().split())
#街のテレポート先入力
A = [int(i)-1 for i in input().split()]
judge = [-1] * N
judge[0] = 0
#初期位置
a = 0
#移動回数
step = 1

while step != K +1:
    #移動する街を決める
    a = A[a]
    if judge[a] > -1:
        break
    #何回目の移動なのか加える
    judge[a] = step
    step = step + 1

if step == K +1:
    print(a+1)
    # プログラム終了
else:
    width = step - judge[a]
    s =(K - judge[a]) % width
    print(judge.index(judge[a]+s)+1)
Buggy python submission (verdict: Runtime Error):
N,M= map(int,input().split())

h = [int(i) for i in input().split()]
judge = [True]*N

for i in range (M):
    a,b= map(int,input().split())
    if h[a - 1] > h[b - 1]:
        judge[b-1] = False
    if h[a - 1] < h[b - 1]:
        judge[a - 1] = False
    if h[a - 1] == h[b - 1]:
        judge[b-1] = False
        judge[a - 1] = False

print(jadge.count(True))

Fixed submission:
N,M= map(int,input().split())

h = [int(i) for i in input().split()]
judge = [True]*N

for i in range (M):
    a,b= map(int,input().split())
    if h[a - 1] > h[b - 1]:
        judge[b-1] = False
    if h[a - 1] < h[b - 1]:
        judge[a - 1] = False
    if h[a - 1] == h[b - 1]:
        judge[b-1] = False
        judge[a - 1] = False

print(judge.count(True))
Buggy python submission (verdict: Time Limit Exceeded):
k = int(input())

def mygcd(x,y):
    a = min(x,y)  # 最小値
    b = max(x,y)  # 最大値
    r = 2  # 余り
    while r != 0:
        r = b % a
        b = a
        a = r
    return b

ans = 0
for i in range(k):
    for j in range(k):
        for l in range(k):
            ans += mygcd(mygcd(i+1,j+1),l+1)

print(ans)

Fixed submission:
K   = int(input())
Sum = 0
def mygcd(x,y):
    a = min(x,y)  # 最小値
    b = max(x,y)  # 最大値
    r = 2  # 余り
    while r != 0:
        r = b % a
        b = a
        a = r
    return b

for A in range(1,K+1):
    for B in range(1,K+1):
        AB = mygcd(A,B)
        if AB==1:
            Sum = Sum+K
        else:
            for C in range(1,K+1):
                Sum = Sum+mygcd(AB,C)
print(Sum)

Buggy python submission (verdict: Time Limit Exceeded):
k = int(input())

def mygcd(x,y):
    a = min(x,y)  # 最小値
    b = max(x,y)  # 最大値
    r = 2  # 余り
    while r != 0:
        r = b % a
        b = a
        a = r
    return b

ans = 0
for i in range(1,k+1):
    for j in range(1,k+1):
        for k in range(1,k+1):
            ans += mygcd(mygcd(i,j),k)

print(ans)

Fixed submission:
K   = int(input())
Sum = 0
def mygcd(x,y):
    a = min(x,y)  # 最小値
    b = max(x,y)  # 最大値
    r = 2  # 余り
    while r != 0:
        r = b % a
        b = a
        a = r
    return b

for A in range(1,K+1):
    for B in range(1,K+1):
        AB = mygcd(A,B)
        if AB==1:
            Sum = Sum+K
        else:
            for C in range(1,K+1):
                Sum = Sum+mygcd(AB,C)
print(Sum)

Buggy python submission (verdict: Time Limit Exceeded):
k = int(input())

def mygcd(x,y):
    a = min(x,y)  # 最小値
    b = max(x,y)  # 最大値
    q = 2  # 商
    r = 2  # 余り
    while r != 0:
        q = b / a
        r = b % a
        b = a
        a = r
    return b

ans = 0
for i in range(1,k+1):
    for j in range(1,k+1):
        for k in range(1,k+1):
            ans += mygcd(mygcd(i,j),k)

print(ans)

Fixed submission:
K   = int(input())
Sum = 0
def mygcd(x,y):
    a = min(x,y)  # 最小値
    b = max(x,y)  # 最大値
    r = 2  # 余り
    while r != 0:
        r = b % a
        b = a
        a = r
    return b

for A in range(1,K+1):
    for B in range(1,K+1):
        AB = mygcd(A,B)
        if AB==1:
            Sum = Sum+K
        else:
            for C in range(1,K+1):
                Sum = Sum+mygcd(AB,C)
print(Sum)
Buggy python submission (verdict: Runtime Error):
import sys
import math
input = sys.stdin.readline

def P(n, r):
  return math.factorial(n)//math.factorial(n-r)
def C(n, r):
  return P(n, r)//math.factorial(r)

MOD=10**9+7
N, K = map(int, input().split())
anssub=[]
for i in range(K):
  a = C(N-K+1,i+1)%MOD
  b = C(K-1,i)%MOD
  c = a * b % MOD
  anssub.append(c)
anssub = map(str,anssub)
print('\n'.join(anssub))

#print(ans)

Fixed submission:
import sys
import math
input = sys.stdin.readline

MOD=10**9+7

fac = [0] * 2001
ifac = [0] * 2001
fac[0] = 1
ifac[0] = 1

def mpow(x, n):
  ans = 1
  while n != 0:
    if n&1:
      ans = ans*x % MOD
    x = x*x % MOD
    n = n >> 1
  return ans

def comb(a, b):
  if a == 0 and b == 0:
    return 1
  if a < b or a < 0:
    return 0
  tmp = ifac[a-b]* ifac[b] % MOD
  return tmp * fac[a] % MOD


for i in range(2000):
  fac[i+1] = fac[i]*(i+1) % MOD
  ifac[i+1] = ifac[i]*mpow(i+1, MOD-2) % MOD

N, K = map(int, input().split())
anssub=[]
for i in range(K):
  a = comb(N-K+1,i+1)%MOD
  b = comb(K-1,i)%MOD
  c = a * b % MOD
  anssub.append(c)
anssub = map(str,anssub)
print('\n'.join(anssub))

#print(ans)
Buggy python submission (verdict: Runtime Error):
import sys
import math
input = sys.stdin.readline
def lcm(x, y):
  return (x * y) // math.gcd(x, y)


A, B, C, D = map(int, input().split())
lcm=lcm(C,D)
ans = B-A+1 - (B//C-A//C) - (B//D-A//D) + (B//(lcm)-A//(lcm)) 


print(ans)

Fixed submission:
import sys
import fractions
input = sys.stdin.readline
def lcm(x, y):
  return (x * y) // fractions.gcd(x, y)


A, B, C, D = map(int, input().split())
lcm=lcm(C,D)
ans = B-A+1 - (B//C-(A-1)//C) - (B//D-(A-1)//D) + (B//(lcm)-(A-1)//(lcm)) 


print(ans)

Buggy python submission (verdict: Runtime Error):
import sys
import math
input = sys.stdin.readline
def lcm(x, y):
    return (x * y) // math.gcd(x, y)


A, B, C, D = map(int, input().split())
lcm=lcm(C,D)
ans = B-A+1 - (B//C-A//C) - (B//D-A//D) + (B//(lcm)-A//(lcm)) 


print(ans)

Fixed submission:
import sys
import fractions
input = sys.stdin.readline
def lcm(x, y):
  return (x * y) // fractions.gcd(x, y)


A, B, C, D = map(int, input().split())
lcm=lcm(C,D)
ans = B-A+1 - (B//C-(A-1)//C) - (B//D-(A-1)//D) + (B//(lcm)-(A-1)//(lcm)) 


print(ans)
Buggy python submission (verdict: Runtime Error):
import math
K, A, B = map(int, input.split())
ans = K+1
if B > 2 + A:
  N = K - A
  if N == 1:
    ans = B
  elif N%2==1:
    ans=B+(B-A)*math.floor((K-A)/2)
  elif N%2==0:
    ans=B+(B-A)*math.floor((K-A)/2-1)+1

print(ans)

Fixed submission:
import math
K, A, B = map(int, input().split())
ans = K+1
if B > 2 + A:
  N = K - A
  if N == 1:
    ans = B
  elif N%2==1:
    ans=B+(B-A)*math.floor((K-A)/2)
  elif N%2==0:
    ans=B+(B-A)*math.floor((K-A)/2-1)+1

print(ans)
Buggy python submission (verdict: Runtime Error):
import sys
import numpy as np
input = sys.stdin.readline

MOD=10**9+7
N, K = map(int, input().split())
grid = np.empty((0,N), dtype=Object)
for i in range(N):
  array = list(map(int, input().strip().split()))
  array2 = np.array(array)
  grid = np.append(grid,[array2],axis=0)
#print(grid)
dp=[[grid]]
gridsave=grid
i=1
while 2**i<=K:
  #print(i)
  #dp.insert(1,grid*grid)
  gridsave=np.dot(dp[i-1][0],dp[i-1][0])
  gridsave=np.mod(gridsave,MOD)
  #print(gridsave)
  dp.append([gridsave])
  i+=1
i-=1
K-=2**i
i-=1
#print('dp',dp)
grid1=dp[len(dp)-1][0]
#print(grid1)
#print(i)
while K>0:
  if K>=2**i:
    #print('i',i)
    grid1=np.dot(grid1,dp[i][0])
    grid1=np.mod(grid1,MOD)
    K-=2**i
    #print('grid1',grid1)
  i-=1
  #print('K',K)
ans=0
#print(grid1)
for i in range(N):
  for j in range(N):
    ans=(ans+grid1[i][j])%MOD
print(ans)


Fixed submission:
import sys
import numpy as np
input = sys.stdin.readline

MOD=10**9+7
N, K = map(int, input().split())
grid = np.empty((0,N), dtype='O')
for i in range(N):
  array = list(map(int, input().strip().split()))
  array2 = np.array(array)
  grid = np.append(grid,[array2],axis=0)
#print(grid)
dp=[[grid]]
gridsave=np.eye(N,dtype="O")
#print(gridsave)
i=1
while K:
  if K & 1:
    gridsave=np.dot(grid,gridsave) % MOD
  grid=np.dot(grid,grid) % MOD
  K>>=1
ans=np.sum(gridsave)%MOD
#print(gridsave)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
import numpy as np
input = sys.stdin.readline

MOD=10**9+7
N, K = map(int, input().split())
grid = np.empty((0,N), int)
for i in range(N):
  array = list(map(int, input().strip().split()))
  array2 = np.array(array)
  grid = np.append(grid,[array2],axis=0)
#print(grid)
dp=[[grid]]
gridsave=grid
i=1
while 2**i<=K:
  #print(i)
  #dp.insert(1,grid*grid)
  #gridsave=np.dot(dp[i-1][0],dp[i-1][0])
  gridsave=[[0]*N]*N
  gridsave =np.array(gridsave)
  for j in range(N):
    for k in range(N):
      for l in range(N):
        #print(l,'1 ',dp[i-1][0][j][l])
        #print(l,'2 ',dp[i-1][0][l][k])
        gridsave[j][k]=(gridsave[j][k]+(dp[i-1][0][j][l]*dp[i-1][0][l][k])%MOD)%MOD

  gridsave=np.mod(gridsave,MOD)
  #print(gridsave)
  dp.append([gridsave])
  i+=1
i-=1
K-=2**i
i-=1
#print('dp',dp)
grid1=dp[len(dp)-1][0]
#print(grid1)
#print(i)
while K>0:
  if K>=2**i:
    #print('i',i)
    grid1=np.dot(grid1,dp[i][0])
    grid1=np.mod(grid1,MOD)
    K-=2**i
    #print('grid1',grid1)
  i-=1
  #print('K',K)
ans=0
#print(grid1)
for i in range(N):
  for j in range(N):
    ans=(ans+grid1[i][j])%MOD
print(ans)

Fixed submission:
import sys
import numpy as np
input = sys.stdin.readline

MOD=10**9+7
N, K = map(int, input().split())
grid = np.empty((0,N), dtype='O')
for i in range(N):
  array = list(map(int, input().strip().split()))
  array2 = np.array(array)
  grid = np.append(grid,[array2],axis=0)
#print(grid)
dp=[[grid]]
gridsave=np.eye(N,dtype="O")
#print(gridsave)
i=1
while K:
  if K & 1:
    gridsave=np.dot(grid,gridsave) % MOD
  grid=np.dot(grid,grid) % MOD
  K>>=1
ans=np.sum(gridsave)%MOD
#print(gridsave)
print(ans)
Buggy python submission (verdict: Runtime Error):
day=input()
resMax=0
resTemp=0
for i in range(len(day)):
  if day[i]=='S':
    resTemp=0
  elif day[i]=='R':
    while(day[i]!='S'):
      resTemp+=1
      i+=1
  if resMax<resTemp:
    resMax=resTemp
print(resMax)
    

Fixed submission:
day = input()
resMax = 0
resTemp = 0
for i in range(len(day)):
  if day[i]=='S':
    resTemp=0
  elif day[i]=='R':
    resTemp=0
    while (i<len(day)) and (day[i]!='S'):
      resTemp+=1
      i+=1
    if resTemp>resMax:
      resMax=resTemp
print(resMax)
Buggy python submission (verdict: Runtime Error):
n=int(input())
l=list(map(int,input().split()))
if n<=2:
	print(0)
else:
	for i in range(n):
		for j in range(i,n):
			for k in range(j,n):
				if (l[i]!=l[j]) and (l[j]!=l[k]) and (l[i]+l[j]>l[k]) and (l[j]+l[k]>l[i]) and (l[k]+l[i]>l[j]):
					res+=1
	print(res)


Fixed submission:
n=int(input())
l=list(map(int,input().split()))
res=0
if n<=2:
	print(0)
else:
	for i in range(n):
		for j in range(i,n):
			for k in range(j,n):
				if (l[i]!=l[j]) and (l[j]!=l[k]) and (l[i]!=l[k]) and (l[i]+l[j]>l[k]) and (l[j]+l[k]>l[i]) and (l[k]+l[i]>l[j]):
					#print(l[i],l[j],l[k])
					res+=1
	print(res)

Buggy python submission (verdict: Runtime Error):
n=int(input())
l=list(map(int,input().split()))
res=0
if n<=2 :
  print(0)
else:
	for i in range(n):
  		for j in range(i,n):
    		for k in range(j,n):
      			if l[i]!=l[j] and l[j]!=l[k] and (l[i]+l[j]>l[k]) and (l[i]+l[k]>l[j]) and (l[j]+l[k]>l[i]):
        		res+=1
print(res)

Fixed submission:
n=int(input())
l=list(map(int,input().split()))
res=0
if n<=2:
	print(0)
else:
	for i in range(n):
		for j in range(i,n):
			for k in range(j,n):
				if (l[i]!=l[j]) and (l[j]!=l[k]) and (l[i]!=l[k]) and (l[i]+l[j]>l[k]) and (l[j]+l[k]>l[i]) and (l[k]+l[i]>l[j]):
					#print(l[i],l[j],l[k])
					res+=1
	print(res)
Buggy python submission (verdict: Runtime Error):
X, K, D = (int(x) for x in input().split())
X = abs(X)

straight = min(K, X // D)
K -= straight
X -= straight * D

if K % 2 == 0:
    print(X)
else:
    print(D-X)

Fixed submission:
S = input()
s_num = len(S)

i=0
max_count = 0
count = 0

while i < s_num:
    if S[i] != "R":
        if max_count < count:
            max_count = count
            count = 0
    elif S[i] == "R":
        count += 1

    i+=1

if max_count < count:
    max_count = count

print(max_count)
Buggy python submission (verdict: Runtime Error):
X = int(input())

if X >= 30:
    print(Yes)
else:
    print(No)

Fixed submission:
X = int(input())

if X >= 30:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Time Limit Exceeded):
K = int(input())

cnt_dig = 1
sev = 7
if K % 2 == 0:
    print(-1)
else:
    while 1 :
        if sev % K == 0:
            print(cnt_dig)
            break
        else:
            sev *= 10
            sev += 7
            cnt_dig += 1

Fixed submission:
import sys

K = int(input())
a = []
i = 1

a.append(7 % K)
while i < K:
    a.append((a[i-1]*10+7) % K)
    i += 1

i = 0
while i < K:
    if(a[i]==0):
        print(i+1)
        exit(0)
    i += 1

print(-1)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input().rstrip())

def calc(target):
    excess = set()
    result = 0
    count = 0
    if target % 2 == 0:
        return -1
        
    while True:
        count += 1
        result = (result * 10 + 7) % target
        excess.add(result)
        if result == 0:
            break
    
    return count
    
print(calc(n))

Fixed submission:
n = int(input().rstrip())

def calc(target):
    result = 0
    count = 0
    if target % 2 == 0:
        print(-1)
        return
        
    for i in range(n):
        result = (result * 10 + 7) % target
        count += 1
        if result == 0:
            print(count)
            return
    
    print(-1)
    
calc(n)
Buggy python submission (verdict: Runtime Error):
if ("RRR" in S):
  print(3)
elif ("RR" in S):
  print(2)
elif ("R" in S):
  print(1)
else:
  print(0)


Fixed submission:
S = input()
if ("RRR" in S):
  print(3)
elif ("RR" in S):
  print(2)
elif ("R" in S):
  print(1)
else:
  print(0)

Buggy python submission (verdict: Runtime Error):
S = input()
if ("RRR" in S):
  return 3
elif ("RR" in S):
  return 2
elif ("R" in S):
  return 1
else:
  return 0


Fixed submission:
S = input()
if ("RRR" in S):
  print(3)
elif ("RR" in S):
  print(2)
elif ("R" in S):
  print(1)
else:
  print(0)

Buggy python submission (verdict: Runtime Error):
if ("RRR" in S):
  return 3
elif ("RR" in S):
  return 2
elif ("R" in S):
  return 1
else:
  return 0

Fixed submission:
S = input()
if ("RRR" in S):
  print(3)
elif ("RR" in S):
  print(2)
elif ("R" in S):
  print(1)
else:
  print(0)
Buggy python submission (verdict: Runtime Error):
N = int(input())
L = list(map(int,input().split()))

l_list = list(itertools.combinations(L, 3))

res = 0

for tri in l_list:
  tri.sort()
  if tri[0] + tri[1] > tri[2]
  	res += 1
    
print(res)

Fixed submission:
import itertools

N = int(input())
L = list(map(int,input().split()))
 
l_list = list(itertools.combinations(L, 3))

res = 0
 
for tri in l_list:
  l = list(tri)
  l.sort()
  if (len(l) != len(set(l))):
    continue
  if (l[0] + l[1] > l[2]):
  	res += 1
    
print(res)
Buggy python submission (verdict: Runtime Error):
l =input().split()

l[0] = A
l[1] = B
if B%A == 0:
    print(A+B)
else:
    print(B-A)

Fixed submission:
l =input().split()

A = int(l[0])
B = int(l[1])

if B%A == 0:
    print(A+B)
else:
    print(B-A)
Buggy python submission (verdict: Runtime Error):
r=0
for l in input():
  r+=1 if l='R' else 0
print(r)

Fixed submission:
r,s=0,input()
for l in s:
  if l=='S' and r>0:
    break
  r+=1 if l=='R' else 0
print(r)
Buggy python submission (verdict: Runtime Error):
x,k,d = [int(i) for i in input().split()]
x=x-k*d*x//abs(x) if abs(x)>=k*d else x-(abs(x)//d)*d*x//abs(x)-(d if abs(x)//d%2==1 else 0)*x//abs(x)
print(x)

Fixed submission:
x,k,d = [int(i) for i in input().split()]
x=abs(x)
x=x-k*d if x>=k*d else abs(x%d-(k-x//d)%2*d)
print(x)

Buggy python submission (verdict: Runtime Error):
x,k,d = [int(i) for i in input().split()]
for i in range(k):
  x+=d if x<0 else -d
  if abs(x)<d:
    x=(abs(x)-d)*x/abs(x) if (k-1-i)&1==1 else x
    break
print(x)

Fixed submission:
x,k,d = [int(i) for i in input().split()]
x=abs(x)
x=x-k*d if x>=k*d else abs(x%d-(k-x//d)%2*d)
print(x)
Buggy python submission (verdict: Runtime Error):
n=input()
print(str(n//3))

Fixed submission:
print(str(int(input())//3))
Buggy python submission (verdict: Time Limit Exceeded):

K=int(input())


if K % 2 == 0 or K % 5 == 0:
    print(-1)
    exit()


i=1

while True:
	if 7*int("1"*i)%K==0:
		exit(print(i))
	i+=1
	if i>1e+15:
		exit(print(-1))




Fixed submission:

K=int(input())
a_i=7%K
i=1
if a_i==0:
	exit(print(1))
while True:
	i+=1
	a_i=(10*a_i+7)%K
	if a_i==0:
		print(i)
		exit()
	if i>=K:
		print(-1)
		exit()

Buggy python submission (verdict: Time Limit Exceeded):
K=int(input())

i=1

while True:
	if 7*int("1"*i)%K==0:
		exit(print(i))
	i+=1

Fixed submission:

K=int(input())
a_i=7%K
i=1
if a_i==0:
	exit(print(1))
while True:
	i+=1
	a_i=(10*a_i+7)%K
	if a_i==0:
		print(i)
		exit()
	if i>=K:
		print(-1)
		exit()
Buggy python submission (verdict: Runtime Error):
S=input()
T=input()

count=0
for i in range(len(S)):
  if S[i]!=T[i]:
    count+=1
    
print(count)



Fixed submission:
a=int(input())

print(a+a**2+a**3)
Buggy python submission (verdict: Runtime Error):
N=int(input())
ans=""
check="abcdefghijklmnopqrstuvwxyz"

while N!=0:
	N-=1
	ans+=check[N%26]
	N=N//26

print(ans[::-1])
"""
while N>0:
	N-=1
	ans+=chr(ord("a")+ N%26)
	N//=26
print(ans[::-1])
"""




Fixed submission:
X, N =map(int, input().split())
p_list=list(map(int, input().split()))
#i=N
#1st Xがp_listにあるか
	#あれば+=!
	#なければ答え
#|X-i|=1がp_listにあるか
	#あれば+=!
	#なければ答え

i=N
j=0
while True:
	if X-j not in p_list:
		print(X-j)
		exit()
	elif X+j not in p_list:
		print(X+j)
		exit()
	else:
		j+=1
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A_list=sorted(list(map(int, input().split())), reverse=True)
ans=1

if 0 in A_list:
  print(0)
  exit()
else:
  for a in A_list:
    ans*=a
  if ans>1e+18:
    ans=-1
    print(-1)
    exit()
  print(ans)







Fixed submission:
N=int(input())
A_list=sorted(list(map(int, input().split())), reverse=True)
ans=1

for a in A_list:
  ans*=a
  if ans>1e+18:
    ans=-1
    break
if 0 in A_list:
  ans=0
print(ans)
Buggy python submission (verdict: Runtime Error):
K=input()
S=input()

len_S=len(S)

if K<=len_S:
  print(S)
  
else:
  print(S[K:], "...")

Fixed submission:
K=int(input())
S=str(input())


if K>=len(S):
  print(S)
  
else:
  print(S[:K]+ "...")
Buggy python submission (verdict: Runtime Error):
in=input()
for i in range(len(in)):
  if(in[i]=="7"):
    print("Yes")
    exit(0)
print("No")
s = input()
for i in range(len(s)):
  if(s[i]=='7'):
    print("Yes")
    exit(0)
print("No")


Fixed submission:
N=input()
if '7' in N:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
N=int(input())
ans=0

for i in range(N):
  if (N+1)% !=3 and (N+1)% !=5:
    ans+=i
print(ans)

Fixed submission:
n=int(input())
sum=0
for i in range(1,n+1):
  if i%3!=0 and i%5 !=0:
    sum+=i
print(sum)
Buggy python submission (verdict: Runtime Error):
N, K =map(int, input().split())
import math
lcm=math.lcm(N,K)
ans=min(lcm, K-lcm) 


Fixed submission:
N, K =map(int, input().split())
ans=N%K
print(min(ans, K-ans))

Buggy python submission (verdict: Runtime Error):
N, K =map(int, input().split())
import math
gcd=math.gcd(N,K)
ans=min(gcd, K-gcd) 

Fixed submission:
N, K =map(int, input().split())
ans=N%K
print(min(ans, K-ans))

Buggy python submission (verdict: Runtime Error):
N, K =map(int, input().split())
import math
print(math.gcd(N,K))

Fixed submission:
N, K =map(int, input().split())
ans=N%K
print(min(ans, K-ans))
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
def combinations_count(n, r):
  	if n==1 or n==0:
      return 0
    else:
      return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

print(combinations_count(N, 2)+combinations_count(M, 2))


Fixed submission:
from scipy.misc import comb
N, M = [int(i) for i in input().split()]
ans = comb(N,2,exact=True) + comb(M,2,exact=True)
print(ans)
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
from collections import defaultdict, Counter
dd=defaultdict(int)
dd_count=defaultdict(int)
Flag=False #s=1 and c=0となる値があるかどうか
for _ in range(M):
	s, c = map(int, input().split())

	if N>=2 and s==1 and c==0:
		Flag=Trye

	#異なるものが2個以上ある
	if dd_count[s-1]>=1 and dd[s-1]!=c:
		exit(print(-1))
	else:
		dd[s-1]=c
		dd_count[s-1]+=1
	
if N>=2 and not Flag:
	ans=10**(N-1)
	for i in range(1,N):
		ans+=dd[i]*10**(N-i-1)
	print(int(ans))

elif N>=2 and dd[0]==0:
	exit(print(-1))
else:
	ans=0
	for i in range(N):
		ans+=dd[i]*10**(N-i-1)
	print(int(ans))


Fixed submission:
N, M = map(int, input().split())
from collections import defaultdict, Counter
dd=defaultdict(int)
dd_count=defaultdict(int)
Flag=False #s=1 and c=0となる値があるかどうか
for _ in range(M):
	s, c = map(int, input().split())

	if N>=2 and s==1 and c==0:
		Flag=True

	#異なるものが2個以上ある
	if dd_count[s-1]>=1 and dd[s-1]!=c:
		exit(print(-1))
	else:
		dd[s-1]=c
		dd_count[s-1]+=1
	
if N>=2 and dd[0]==0 and not Flag:
	ans=10**(N-1)
	for i in range(1,N):
		ans+=dd[i]*10**(N-i-1)
	exit(print(ans))

if N>=2 and Flag:
	exit(print(-1))
else:
	ans=0
	for i in range(N):
		ans+=dd[i]*10**(N-i-1)
	print(int(ans))
Buggy python submission (verdict: Runtime Error):
N=int(input())
X=list(map(int, input().split()))
import numpy as np
p=np.floor(np.mean(X))
ans=min(np.sum([(x-p)**2 for x in X]), np.sum([(x-(p+1))**2 for x in X]))

print(int(ans))

Fixed submission:
N=int(input())
X=list(map(int, input().split()))
import numpy as np
p=np.floor(np.mean(X))
ans=min(np.sum([(x-p)**2 for x in X]), np.sum([(x-(p+1))**2 for x in X]))

print(int(ans))
Buggy python submission (verdict: Runtime Error):
a=input()
b=input()
pre=a*int(b)
post=b*int(a)
print(pre if pre<=post else post)

Fixed submission:
a, b = input().split()
pre=a*int(b)
post=b*int(a)
print(pre if pre<=post else post)
Buggy python submission (verdict: Time Limit Exceeded):
A, B, K = map(int, input().split())

for k in range(K):
  if A>0 and B!=0:
    A+=-1
  elif A==0 and B>0:
    B+=-1
  elif A==0 & B==0:
    break
print(A, B)




Fixed submission:
A, B, K = map(int, input().split())

if K<=A:
  print(A-K, B)
elif A<K<=(A+B):
  print(0, B-(K-A))
else:
  print(0,0)
"""
for k in range(K):
  if A>0 and B!=0:
    A+=-1
  elif A==0 and B>0:
    B+=-1
  elif A==0 & B==0:
    break
print(A, B)
"""