Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n = int(input())
c0 = c1 = c2 = c3 = 0
for _ in range(n):
  s = input()
  if s == "AC":
    c0 += 1
  elif s == "WA":
    c1 += 1
  elif s == "TLE":
    c2 += 1
  else
  	c3 += 1

print("AC x", c0, sep = " ")
print("WA x", c1, sep = " ")
print("TLE x", c2, sep = " ")
print("RE x", c3, sep = " ")


Fixed submission:
N = int(input())
s = [input() for i in range(N)]
for v in ['AC', 'WA', 'TLE', 'RE']:
    print('{} x {}'.format(v, s.count(v)))

Buggy python submission (verdict: Runtime Error):
from collections import Counter

n = int(input())
a = []
for _ in range(n):
  a.append(input())

dct = dict(Counter(a))
for v, num in dct.items():
  print(v + " x " + num)

Fixed submission:
N = int(input())
s = [input() for i in range(N)]
for v in ['AC', 'WA', 'TLE', 'RE']:
    print('{} x {}'.format(v, s.count(v)))

Buggy python submission (verdict: Runtime Error):
from collections import Counter

n = int(input())
a = []
for _ in range(n):
  a.append(input())

dct = dict(Counter(a))
for v, num in dct.items():
  print(f"{v} x {num})
  



Fixed submission:
N = int(input())
s = [input() for i in range(N)]
for v in ['AC', 'WA', 'TLE', 'RE']:
    print('{} x {}'.format(v, s.count(v)))
Buggy python submission (verdict: Runtime Error):
n = int(input())

print(a+a**2+(a*(a**2)))

Fixed submission:
a = int(input())

print(a+a**2+a**3)
Buggy python submission (verdict: Runtime Error):
n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
 
aa, bb = [0], [0]
for i in range(n):
	aa.append(aa[i]+a[i])
 
for i in range(m):
	bb.append(b[i]+bb[i])
 
 
ans, i = 0, m
for j in range(n+1):
	if aa[j] > k:
		break
	while b[i] > k-aa[j]:
		j -= 1
 
	ans = max(ans, i+j)
 
 
print(ans)


Fixed submission:
N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
a, b = [0], [0]
for i in range(N):
    a.append(a[i] + A[i])
for i in range(M):
    b.append(b[i] + B[i])

ans, j = 0, M
for i in range(N + 1):
    if a[i] > K:
        break
    while b[j] > K - a[i]:
        j -= 1
    ans = max(ans, i + j)



print(ans)

Buggy python submission (verdict: Runtime Error):
n, m, k = map(int, input.split())
a = list(map(int, input.split()))
b = list(map(int, input.split()))

aa, bb = [0], [0]
for i in range(n):
	aa.append(aa[i]+a[i])

for i in range(m):
	bb.append(b[i]+bb[i])


ans, i = 0, m
for j in range(n+1):
	if aa[j] > k:
		break
	while b[i] > k-aa[j]:
		j -= 1

	ans = max(ans, i+j)


print(ans)


Fixed submission:
N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
a, b = [0], [0]
for i in range(N):
    a.append(a[i] + A[i])
for i in range(M):
    b.append(b[i] + B[i])

ans, j = 0, M
for i in range(N + 1):
    if a[i] > K:
        break
    while b[j] > K - a[i]:
        j -= 1
    ans = max(ans, i + j)



print(ans)
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
pr = list(map(int, input().split()))

pr.sort()

print(sum(pr[0:k])

Fixed submission:
n, k = map(int, input().split())
pr = list(map(int, input().split()))
 
pr.sort()
 
print(sum(pr[0:k]))
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = ''
while n > 0:
  n-=1
  ans += chr(ord('a') + n%26)
  n//=26
 
print(ans[::-1])
  

Fixed submission:
n = int(input())
s = ''
while n > 0:
  n-=1
  s += chr(ord('a') + n%26)
  n//=26
 
print(s[::-1])
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))

x = 1
for i in a:
    x *= i

ans = x
if ans > 10**18:
    ans = -1
print(ans)


Fixed submission:
n = int(input())
a = list(map(int, input().split()))
a.sort()

x = 1
for i in a:
    x *= i
    if x > 10**18:
        break

ans = x
if ans > 10**18:
    ans = -1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
def divisor(x):
    i = 1
    d = []
    while i*i <= x:
        if x%i == 0:
            d.append(i)
            d.append(x//i)
        i += 1
    return d

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

ans = 1
for i in range(2):
    for d in divisor(a[i]):
        ct = 0
        for j in a:
            if j%d == 0:
                ct += 1
        if ct >= n-1:
            ans = max(ans, d)

print(ans)


Fixed submission:
def divisor(x):
    i = 1
    d = []
    while i*i <= x:
        if x%i == 0:
            d.append(i)
            d.append(x//i)
        i += 1
    return d

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

ans = 1
for i in range(2):
    for d in divisor(a[i]):
        ct = 0
        for j in a:
            if j%d == 0:
                ct += 1
        if ct >= n-1:
            ans = max(ans, d)

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
x,y,z,k = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))

for l in [b,c]:
    p = []
    for i in a:
        for j in l:
            p.append(i+j)
    a = sorted(p, reverse=True)[:k]

for i in a:
    print(i)


Fixed submission:
x,y,z,k = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))

for l in [b,c]:
    p = []
    for i in a:
        for j in l:
            p.append(i+j)
    a = sorted(p, reverse=True)[:k]

for i in a:
    print(i)
Buggy python submission (verdict: Runtime Error):
from math import gcd

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

g = 0
for i in a:
    g = gcd(g,i)
print(g)


Fixed submission:
from fractions import gcd

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

g = 0
for i in a:
    g = gcd(g,i)
print(g)
Buggy python submission (verdict: Runtime Error):
import math

def main():
    a,b,c,d = map(int,input().split())
    a,c = min(a,c),max(a,c)
    b,d = min(b,d),max(b,d)

    c -= a
    a = 0
    d -= b
    b = 0

    if a==c or b==d:
        return 0

    g = math.gcd(c,d)
    c//=g
    d//=g
    ct = c+d-1
    return g*ct

if __name__ == '__main__':
    print(main())


Fixed submission:
import fractions

def main():
    a,b,c,d = map(int,input().split())
    a,c = min(a,c),max(a,c)
    b,d = min(b,d),max(b,d)

    c -= a
    a = 0
    d -= b
    b = 0

    if a==c or b==d:
        return 0

    g = fractions.gcd(c,d)
    c//=g
    d//=g
    ct = c+d-1
    return g*ct

if __name__ == '__main__':
    print(main())
Buggy python submission (verdict: Runtime Error):
R=input()
print(R*3.141592)

Fixed submission:
R=float(input())
print(2*R*3.141592)

Buggy python submission (verdict: Runtime Error):
import math
R=input()
print(R*math.pi)

Fixed submission:
R=float(input())
print(2*R*3.141592)
Buggy python submission (verdict: Runtime Error):
N=input()
if N[0]="7" or N[1]="7" or N[2]="7":
    print("Yes")
else:
    print("No")

Fixed submission:
N=input()
if N[0]=="7" or N[1]=="7" or N[2]=="7":
    print("Yes")
else:
    print("No")
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: Runtime Error):
x = int(input("x"))

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: Runtime Error):
import copy
x,n = list(map(int, input("").split()))
p = list(map(int, input("").split()))

mina =101
y = []
minc = []

if x not in p:
    print(x)
    exit()

for i in range(1,101):
    y.append(i)

if n == 0:
    print(x)
else:
    for j in range(n):
        y.remove(p[j])

    z = copy.copy(y)

    for k in range(len(y)):
        if abs(x - y[k]) < mina:
            mina = abs(x - y[k])
            minb = y[k]
            z.remove(minb)

    minc.append(minb)
    mina = 101

    for m in range(len(z)):
        if abs(x - z[m]) < mina:
            mina = abs(x - z[m])
            minb = z[m]

    minc.append(minb)

    print(min(minc))

Fixed submission:
x,n = list(map(int, input("").split()))
p = list(map(int, input("").split()))

for i in range(101):
    if x-i not in p:
        print(x-i)
        exit()
    elif x+i not in p:
        print(x+i)
        exit()

Buggy python submission (verdict: Runtime Error):
import copy
x,n = list(map(int, input("").split()))
p = list(map(int, input("").split()))

mina =101
y = []
minc = []

for x not in p:
    print(x)
    exit()

for i in range(1,101):
    y.append(i)

if n == 0:
    print(x)
else:
    for j in range(n):
        y.remove(p[j])

    z = copy.copy(y)

    for k in range(len(y)):
        if abs(x - y[k]) < mina:
            mina = abs(x - y[k])
            minb = y[k]
            z.remove(minb)

    minc.append(minb)
    mina = 101

    for m in range(len(z)):
        if abs(x - z[m]) < mina:
            mina = abs(x - z[m])
            minb = z[m]

    minc.append(minb)

    print(min(minc))

Fixed submission:
x,n = list(map(int, input("").split()))
p = list(map(int, input("").split()))

for i in range(101):
    if x-i not in p:
        print(x-i)
        exit()
    elif x+i not in p:
        print(x+i)
        exit()

Buggy python submission (verdict: Runtime Error):
import copy
x,n = list(map(int, input("").split()))
p = list(map(int, input("").split()))

mina =101
y = []
minc = []


for i in range(1,101):
    y.append(i)

if n == 0:
    print(x)
else:
    for j in range(n):
        y.remove(p[j])

    z = copy.copy(y)

    for k in range(len(y)):
        if abs(x - y[k]) < mina:
            mina = abs(x - y[k])
            minb = y[k]
            z.remove(minb)

    minc.append(minb)
    mina = 101

    for m in range(len(z)):
        if abs(x - z[m]) < mina:
            mina = abs(x - z[m])
            minb = z[m]

    minc.append(minb)

    print(min(minc))

Fixed submission:
x,n = list(map(int, input("").split()))
p = list(map(int, input("").split()))

for i in range(101):
    if x-i not in p:
        print(x-i)
        exit()
    elif x+i not in p:
        print(x+i)
        exit()
Buggy python submission (verdict: Runtime Error):
a, v = list(map(int, input("").split()))
b, w = list(map(int, input("").split()))
t = int(input(""))

l  = abs(a-b)

if (v - w) * t >= l:
    Print("YES")
else:
    Print("NO")

Fixed submission:
a, v = list(map(int, input().split()))
b, w = list(map(int, input().split()))
t = int(input())

l  = abs(a-b)

if (v - w) * t >= l:
    print("YES")
else:
    print("NO")

Buggy python submission (verdict: Runtime Error):
a, v = list(map(long, input("").split()))
b, w = list(map(long, input("").split()))
t = long(input(""))

if b > a:
    if a + v * t >= b + w * t:
        print("YES")
    else:
        print("NO")
else:
    if v > w:
        print("NO")
    else:
        if b + w * t >= a + v * t:
            print("YES")
        else:
            print("No")


Fixed submission:
a, v = list(map(int, input().split()))
b, w = list(map(int, input().split()))
t = int(input())

l  = abs(a-b)

if (v - w) * t >= l:
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Runtime Error):
n,k = list(map(int, input("").split()))

sunuke = [0] * n
 
for i in range(K):
    d = int(input())
    a = list(map(int,input().split()))
    for j in a:
        sunuke[j-1] = 0

print(sum(sunuke))

Fixed submission:
n,k = list(map(int, input().split()))

sunuke = [1] * n
 
for i in range(k):
    d = int(input())
    a = list(map(int, input().split()))
    for j in a:
        sunuke[j-1] = 0

print(sum(sunuke))
Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())

while  n >= k:
    a += 1
    n = n // k

print(a + 1)

Fixed submission:
n,k=map(int,input().split())
a = 0
while  n >= k:
    a += 1
    n = n // k

print(a + 1)
Buggy python submission (verdict: Runtime Error):
n = int(input())
d=list(map(int,input().split()))

kaihuku = 0

for i in range(n-1):
    for j in range(i+1,n):
        kaihuku += d(i) * d(j)

print(kaihuku)

Fixed submission:
n = int(input())
d=list(map(int,input().split()))

kaihuku = 0

for i in range(n-1):
    for j in range(i+1,n):
        kaihuku += d[i] * d[j]

print(kaihuku)
Buggy python submission (verdict: Runtime Error):
n = int(input())
power = 1
for i in range(1,n+1):
    power *= i
    power = power % (10 ** 9 + 7))

print(power % (10 ** 9 + 7))

Fixed submission:
n = int(input())
power = 1
for i in range(1,n+1):
    power *= i
    power = power % (10 ** 9 + 7)

print(power % (10 ** 9 + 7))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
power = 1
for i in range(1,n+1):
    power *= i

print(power % (10 ** 9 + 7))

Fixed submission:
n = int(input())
power = 1
for i in range(1,n+1):
    power *= i
    power = power % (10 ** 9 + 7)

print(power % (10 ** 9 + 7))
Buggy python submission (verdict: Runtime Error):
X=input()

if (X>40 or X<-40):
  return 0
elif(X=>30 and X=<40):
  print('Yes')
elif(X=>-40 and X<30)
  print('No')



Fixed submission:
x=input()
X=int(x)
if(X>=30 and X<=40):
  print('Yes')
elif(X>=-40 and X<30):
  print('No')

Buggy python submission (verdict: Runtime Error):
x=input()
X=int(x)
if (X>40||X<-40):
  return 0
elif(X=>30&&X=<40):
  print('Yes')
elif(X=>-40&&X<30):
  print('No')


Fixed submission:
x=input()
X=int(x)
if(X>=30 and X<=40):
  print('Yes')
elif(X>=-40 and X<30):
  print('No')

Buggy python submission (verdict: Runtime Error):

X=input()

if (X>40||X<-40):
  return 0
elif(X=>30&&X=<40):
  print('Yes')
elif(X=>-40&&X<30)
  print('No')


Fixed submission:
x=input()
X=int(x)
if(X>=30 and X<=40):
  print('Yes')
elif(X>=-40 and X<30):
  print('No')

Buggy python submission (verdict: Runtime Error):
X=input()
if (X>40||X<-40):
  return 0

if(X=>30&&X=<40):
  print("Yes")
else:
  print("No")


Fixed submission:
x=input()
X=int(x)
if(X>=30 and X<=40):
  print('Yes')
elif(X>=-40 and X<30):
  print('No')

Buggy python submission (verdict: Runtime Error):
X=input()
if (X>40||X<-40):
  return 0
  if(X=>30):
    print(Yes)
  else:
    print(No)


Fixed submission:
x=input()
X=int(x)
if(X>=30 and X<=40):
  print('Yes')
elif(X>=-40 and X<30):
  print('No')

Buggy python submission (verdict: Runtime Error):
input(X)
if (X>40||X<-40):
  return 0
  if(X=>30):
    print(Yes)
  else:
    print(No)


Fixed submission:
x=input()
X=int(x)
if(X>=30 and X<=40):
  print('Yes')
elif(X>=-40 and X<30):
  print('No')
Buggy python submission (verdict: Runtime Error):
S, T = input().split()
A, B = map(int, input().split())
U = input()
if U == S:
    A = A - 1
elif U == T:
    B = B -1
print(A, B)

Fixed submission:
S, T = input().split()
A, B = map(int, input().split())
U = input()
if U == S:
    A = A - 1
elif U == T:
    B = B -1
print(A, B)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
A_set = set(A)
if len(A_set) == N:
        print("YES")
    else:
        print("NO")

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
A_set = set(A)
if len(A_set) == N:
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
# 整数の入力
inputs = []
inputs.append(int(input()))
inputs.append(int(input()))
inputs.append(int(input()))
inputs.append(int(input()))
inputs.append(int(input()))
amari_list = []
time = 0
for input in inputs:
  amari = input % 10
  if amari == 0:
    time += input
  else:
    time += (input // 10) * 10
    amari_list.append(amari)
time += (len(amari_list) - 1)*10
time += min(amari_list)
# 出力
print(time)

Fixed submission:
# -*- coding: utf-8 -*-
# 整数の入力
inputs = []
inputs.append(int(input()))
inputs.append(int(input()))
inputs.append(int(input()))
inputs.append(int(input()))
inputs.append(int(input()))
amari_list = []
time = 0
for input in inputs:
  amari = input % 10
  if amari == 0:
    time += input
  else:
    time += (input // 10) * 10
    amari_list.append(amari)
if len(amari_list) > 0:
  time += (len(amari_list) - 1)*10
  time += min(amari_list)
# 出力
print(time)
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
# 整数の入力
N = int(input())
can_moves = []
can_moves.append(int(input()))
can_moves.append(int(input()))
can_moves.append(int(input()))
can_moves.append(int(input()))
can_moves.append(int(input()))
cities = [N, 0, 0, 0, 0, 0]
time = 0
for t in range(1, 10**15):
  for i in reversed(range(len(cities) - 1)):
    if cities[i] != 0:
      cities[i] -= can_moves[i]
      cities[i+1] += can_moves[i]
      if cities[i] < 0:
        cities[i+1] += cities[i]
        cities[i] = 0
  if cities[-1] == N:
    time = t
    # print(cities)
    break
  
# 出力
print(time)

Fixed submission:
# -*- coding: utf-8 -*-
# 整数の入力
import math
N = int(input())
can_moves = []
can_moves.append(int(input()))
can_moves.append(int(input()))
can_moves.append(int(input()))
can_moves.append(int(input()))
can_moves.append(int(input()))
min_can_moves = min(can_moves)
time = math.ceil(N / min_can_moves) + len(can_moves) - 1
  
# 出力
print(time)
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: Runtime Error):
n, d = map(int, input().split())
count = 0
for i in range(n):
  a, b = map(int, input().split())
  if ((a+b)*(a-b))**(1/2) <= d:
    count += 1
print(count)

Fixed submission:
n, d = map(int, input().split())
count = 0
for i in range(n):
  a, b = map(int, input().split())
  k = a**2 + b**2
  if k >= 0:
  	if (k)**(1/2) <= d:
  		count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
print(a*b)

Fixed submission:
a, b = map(int,input().split())
print(a*b)
Buggy python submission (verdict: Runtime Error):
import numpy as np
import scipy.sparse as sps
import scipy.misc as spm
import collections as col
import functools as func
import itertools as ite
import fractions as frac
import math as ma
from math import cos,sin,tan,sqrt
import cmath as cma
import copy as cp
import sys
import re
import bisect as bs
sys.setrecursionlimit(10**7)
EPS = sys.float_info.epsilon
PI = np.pi; EXP = np.e; INF = np.inf
MOD = 10**9 + 7

def sinput(): return sys.stdin.readline().strip()
def iinput(): return int(sinput())
def imap(): return map(int, sinput().split())
def fmap(): return map(float, sinput().split())
def iarr(n=0):
    if n: return [0 for _ in range(n)]
    else: return list(imap())
def farr(): return list(fmap())
def sarr(n=0):
    if n: return ["" for _ in range(n)]
    else: return sinput().split()
def adj(n): return [[] for _ in range(n)]

def meguru(ok, ng):
    while abs(ok - ng) > 1:
        mid = (ok + ng)//2
        if isOK(mid): ok = mid
        else: ng = mid
    return ok

def isOK(num): return bcum[num] <= tb

n,m,k = imap()
a,b = iarr(),iarr()
acum,bcum = np.array(a).cumsum(),np.array(b).cumsum()

anss = []
for i in range(n+1):
    ans = i + 1
    ta = 0 if i==n+1 else acum[i]
    if ta > k: continue
    else: tb = k - ta
    #ok,ng = -1,m
    #ans += meguru(ok,ng) + 1 # OKなければansは-1+1で不変
    ans += bs.bisect_right(bcum, tb)
    anss.append(ans)
ans = max(anss) if anss else 0
print(ans)


Fixed submission:
import numpy as np
import scipy.sparse as sps
import scipy.misc as spm
import collections as col
import functools as func
import itertools as ite
import fractions as frac
import math as ma
from math import cos,sin,tan,sqrt
import cmath as cma
import copy as cp
import sys
import re
import bisect as bs
sys.setrecursionlimit(10**7)
EPS = sys.float_info.epsilon
PI = np.pi; EXP = np.e; INF = np.inf
MOD = 10**9 + 7

def sinput(): return sys.stdin.readline().strip()
def iinput(): return int(sinput())
def imap(): return map(int, sinput().split())
def fmap(): return map(float, sinput().split())
def iarr(n=0):
    if n: return [0 for _ in range(n)]
    else: return list(imap())
def farr(): return list(fmap())
def sarr(n=0):
    if n: return ["" for _ in range(n)]
    else: return sinput().split()
def adj(n): return [[] for _ in range(n)]

def meguru(ok, ng):
    while abs(ok - ng) > 1:
        mid = (ok + ng)//2
        if isOK(mid): ok = mid
        else: ng = mid
    return ok

def isOK(num): return bcum[num] <= tb

n,m,k = imap()
a,b = iarr(),iarr()
acum,bcum = np.array(a).cumsum(),np.array(b).cumsum()

anss = []
for i in range(n+1):
    ans = 0 if i==n else i + 1
    ta = 0 if i==n else acum[i]
    if ta > k: continue
    else: tb = k - ta
    #ok,ng = -1,m
    #ans += meguru(ok,ng) + 1 # OKなければansは-1+1で不変
    ans += bs.bisect_right(bcum, tb)
    anss.append(ans)
ans = max(anss) if anss else 0
print(ans)
Buggy python submission (verdict: Runtime Error):
import numpy as np
import scipy.sparse as sps
import scipy.misc as spm
import collections as col
import functools as func
import itertools as ite
import fractions as frac
import math as ma
from math import cos,sin,tan,sqrt
import cmath as cma
import copy as cp
import sys
import re
import bisect as bs
sys.setrecursionlimit(10**7)
EPS = sys.float_info.epsilon
PI = np.pi; EXP = np.e; INF = np.inf
MOD = 10**9 + 7

def sinput(): return sys.stdin.readline().strip()
def iinput(): return int(sinput())
def imap(): return map(int, sinput().split())
def fmap(): return map(float, sinput().split())
def iarr(n=0):
    if n: return [0 for _ in range(n)]
    else: return list(imap())
def farr(): return list(fmap())
def sarr(n=0):
    if n: return ["" for _ in range(n)]
    else: return sinput().split()
def barr(n): return [False for _ in range(n)]
def adj(n): return [[] for _ in range(n)]

n = iinput()
ch = ["z"]+[chr(i) for i in range(ord("a"), ord("a")+25)]

def cnt26(num):
    cnt = 0
    while 1:
        if 26 ** cnt > num: return cnt - 1
        else: cnt += 1

s = ""
dig = cnt26(n)
while dig >= 1:
    div,mod = divmod(n, 26**dig)
    #print(div,mod)
    n = mod
    s += ch[div]
    dig -= 1
s += ch[mod]
print(s)


Fixed submission:
import numpy as np
import scipy.sparse as sps
import scipy.misc as spm
import collections as col
import functools as func
import itertools as ite
import fractions as frac
import math as ma
from math import cos,sin,tan,sqrt
import cmath as cma
import copy as cp
import sys
import re
import bisect as bs
sys.setrecursionlimit(10**7)
EPS = sys.float_info.epsilon
PI = np.pi; EXP = np.e; INF = np.inf
MOD = 10**9 + 7

def sinput(): return sys.stdin.readline().strip()
def iinput(): return int(sinput())
def imap(): return map(int, sinput().split())
def fmap(): return map(float, sinput().split())
def iarr(n=0):
    if n: return [0 for _ in range(n)]
    else: return list(imap())
def farr(): return list(fmap())
def sarr(n=0):
    if n: return ["" for _ in range(n)]
    else: return sinput().split()
def barr(n): return [False for _ in range(n)]
def adj(n): return [[] for _ in range(n)]

n = iinput()
ch = ["z"]+[chr(i) for i in range(ord("a"), ord("a")+25)]

ans = ""
while n>0:
    if n%26: ans = ch[n%26] + ans; n //= 26
    else: ans = ch[n%26] + ans; n //= 26; n -= 1
print(ans)