Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
s = input()
mn=N
for i in range(N):
    lw=s[:i].count("W")
    re=s[i+1:].count("E")
    sm=lw+re
    if mn>sm:
        mn=sm
print(mn)
    

Fixed submission:
N = int(input())
s = input()
mn=N
lw=0
re=s[1:].count("E")
for i in range(N):
    if i-1>=0 and s[i-1]=="W":
        lw+=1
    if i-1>=0 and s[i]=="E":
        re-=1
    
    sm=lw+re
    if mn>sm:
        mn=sm
print(mn)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
s = input()
mn=N
for i in range(N):
    lw=s[:i].count("W")
    re=s[i+1:].count("E")
    sm=lw+re
    if mn>sm:
        mn=sm
print(mn)

Fixed submission:
N = int(input())
s = input()
mn=N
lw=0
re=s[1:].count("E")
for i in range(N):
    if i-1>=0 and s[i-1]=="W":
        lw+=1
    if i-1>=0 and s[i]=="E":
        re-=1
    
    sm=lw+re
    if mn>sm:
        mn=sm
print(mn)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
s = input()
mn=N
for i in range(N):
    lw=s[:i].count("W")
    re=s[i+1:].count("E")
    sm=lw+re
    mn=min(mn,sm)

print(mn)
    

Fixed submission:
N = int(input())
s = input()
mn=N
lw=0
re=s[1:].count("E")
for i in range(N):
    if i-1>=0 and s[i-1]=="W":
        lw+=1
    if i-1>=0 and s[i]=="E":
        re-=1
    
    sm=lw+re
    if mn>sm:
        mn=sm
print(mn)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
c=0
while True:
    for i in range(N):
        if A[i] % 2 !=0:
            print(c)
            exit()
        else:
            A[i] = A[i] / 2
    c=c+1

Fixed submission:
S = list(input())
print(S.count("1"))

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
c=0
while(True):
    b=0
    for i in A:
        if i%2==0:
            b=b+1
        if b==N:
            for j in range(N):
                A[j]=A[j]/2
            c=c+1
    if b!=N:
        break
print(c)

Fixed submission:
S = list(input())
print(S.count("1"))

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
c=0
while(True):
    b=0
    for i in A:
        if i%2==0:
            b=b+1
        if b==N:
            for j in range(N):
                A[j]=A[j]/2
            c=c+1
    if b!=N:
        break
print(c)




Fixed submission:
S = list(input())
print(S.count("1"))

Buggy python submission (verdict: Runtime Error):
N = int(input())
A=[]
for i in range(N):
    a=int(input())
    A.append(a)
c=0
while(True):
    b=0
    for i in A:
        if i%2==0:
            b=b+1
        if b==N:
            for j in range(N):
                A[j]=A[j]/2
            c=c+1
    if b!=N:
        break
print(c)

Fixed submission:
S = list(input())
print(S.count("1"))

Buggy python submission (verdict: Runtime Error):
N = int(input())
A=[]
for i in range(N):
    A.append(int(input()))
c=0
while(True):
    b=0
    for i in A:
        if i%2==0:
            b=b+1
        if b==N:
            for j in range(N):
                A[j]=A[j]/2
            c=c+1
    if b!=N:
        break
print(c)

Fixed submission:
S = list(input())
print(S.count("1"))
Buggy python submission (verdict: Runtime Error):
N = int(input())
A=[]
for i in range(N):
    A.append(int(input()))
c=0
while(True):
    b=0
    for i in A:
        if i%2==0:
            b=b+1
        if b==N:
            for j in range(N):
                A[j]=A[j]/2
            c=c+1
    if b!=N:
        break
print(c)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
c=0
while True:
    for i in range(N):
        if A[i] % 2 !=0:
            print(c)
            exit()
        else:
            A[i] = A[i] / 2
    c=c+1
Buggy python submission (verdict: Time Limit Exceeded):
a,b,c,d,e,f = map(int, input().split())
mx=0
swmx=a*100
smx=0
 
for i in range(0,31):
    for j in range(0,31):
        for k in range(0,1000):
            for l in range(0,1000):
                w=0
                s=0
                w+=100*a*i+100*b*j
                s+=c*k+d*l
                targ=w+s
                if targ<=f and s<=e*w/100 and targ!=0 and mx<s/(w+s):
                    mx=s/targ
                    swmx=targ
                    smx=s
print(swmx,smx)

Fixed submission:
a,b,c,d,e,f = map(int, input().split())
mx=0
swmx=100*a
smx=0
 
for i in range(0,31):
    for j in range(0,31):
        for k in range(0,51):
            for l in range(0,51):
                w=0
                s=0
                w+=100*a*i+100*b*j
                s+=c*k+d*l
                if w+s<=f and s<=e*w/100 and w!=0 and mx<100*s/(w+s):
                    mx=100*s/(w+s)
                    swmx=w+s
                    smx=s
print(swmx,smx)

Buggy python submission (verdict: Time Limit Exceeded):
a,b,c,d,e,f = map(int, input().split())
mx=0
swmx=0
smx=0

for i in range(0,31):
    for j in range(0,31):
        for k in range(0,1000):
            for l in range(0,1000):
                w=0
                s=0
                w+=100*a*i+100*b*j
                s+=c*k+d*l
                if w+s<=f and s<=e*w/100 and w!=0 and mx<100*s/(w+s):
                    mx=100*s/(w+s)
                    swmx=w+s
                    smx=s
print(swmx,smx)


Fixed submission:
a,b,c,d,e,f = map(int, input().split())
mx=0
swmx=100*a
smx=0
 
for i in range(0,31):
    for j in range(0,31):
        for k in range(0,51):
            for l in range(0,51):
                w=0
                s=0
                w+=100*a*i+100*b*j
                s+=c*k+d*l
                if w+s<=f and s<=e*w/100 and w!=0 and mx<100*s/(w+s):
                    mx=100*s/(w+s)
                    swmx=w+s
                    smx=s
print(swmx,smx)

Buggy python submission (verdict: Time Limit Exceeded):
a,b,c,d,e,f = map(int, input().split())
mx=0
swmx=0
smx=0

for i in range(0,31):
    for j in range(0,31):
        for k in range(0,101):
            for l in range(0,101):
                w=0
                s=0
                w+=100*a*i+100*b*j
                s+=c*k+d*l
                if w+s<=f and s<=e*w/100 and w!=0 and mx<100*s/(w+s):
                    mx=100*s/(w+s)
                    swmx=w+s
                    smx=s
print(swmx,smx)



Fixed submission:
a,b,c,d,e,f = map(int, input().split())
mx=0
swmx=100*a
smx=0
 
for i in range(0,31):
    for j in range(0,31):
        for k in range(0,51):
            for l in range(0,51):
                w=0
                s=0
                w+=100*a*i+100*b*j
                s+=c*k+d*l
                if w+s<=f and s<=e*w/100 and w!=0 and mx<100*s/(w+s):
                    mx=100*s/(w+s)
                    swmx=w+s
                    smx=s
print(swmx,smx)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
B=[]
C=[]
for i in range(N):
    B.append(A[i]-1)
for i in range(N):
    C.append(A[i]+1)
D=[]
D=A+B+C
mx=0
for i in D:
    cnt=0
    for j in range(N):
        if i==A[j]:
            cnt+=1
        elif i==B[j]:
            cnt+=1
        elif i==C[j]:
            cnt+=1
    mx=max(mx,cnt)
print(mx)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
B=[]
C=[]
for i in range(N):
    B.append(A[i]-1)
for i in range(N):
    C.append(A[i]+1)
D=[]
D=A+B+C
mx=0
E=[0]*10**6
for i in D:
    E[i]+=1
    
print(max(E))

Buggy python submission (verdict: Runtime Error):
A = list(map(int, input().split()))
B=[]
C=[]
for i in range(N):
    B.append(A[i]-1)
for i in range(N):
    C.append(A[i]+1)
D=[]
D=A+B+C

mx=0
for i in D:
    cnt=0
    for j in range(N):
        if i==A[j]:
            cnt+=1
        elif i==B[j]:
            cnt+=1
        elif i==C[j]:
            cnt+=1
    mx=max(mx,cnt)
print(mx)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
B=[]
C=[]
for i in range(N):
    B.append(A[i]-1)
for i in range(N):
    C.append(A[i]+1)
D=[]
D=A+B+C
mx=0
E=[0]*10**6
for i in D:
    E[i]+=1
    
print(max(E))

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
B=[]
C=[]
for i in range(N):
    B.append(A[i]-1)
for i in range(N):
    C.append(A[i]+1)
mx=0
for i in range(max(C)+1):
    cnt=0
    for j in range(N):
        if i==A[j]:
            cnt+=1
        elif i==B[j]:
            cnt+=1
        elif i==C[j]:
            cnt+=1
    mx=max(mx,cnt)
print(mx)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
B=[]
C=[]
for i in range(N):
    B.append(A[i]-1)
for i in range(N):
    C.append(A[i]+1)
D=[]
D=A+B+C
mx=0
E=[0]*10**6
for i in D:
    E[i]+=1
    
print(max(E))

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
B=[]
C=[]
for i in range(N):
    B.append(A[i]-1)
for i in range(N):
    C.append(A[i]+1)
mx=0
for i in range(max(C)+1):
    cnt=0
    for j in range(N):
        if i==A[j]:
            cnt+=1
        elif i==B[j]:
            cnt+=1
        elif i==C[j]:
            cnt+=1
    mx=max(mx,cnt)
print(mx)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
B=[]
C=[]
for i in range(N):
    B.append(A[i]-1)
for i in range(N):
    C.append(A[i]+1)
D=[]
D=A+B+C
mx=0
E=[0]*10**6
for i in D:
    E[i]+=1
    
print(max(E))
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
B=[2]*(N)
if n<=2:
    print(1)
    exit(0)
 
for i in range(N-1):
    if A[i]>A[i+1]:
        B[i]=-1
    elif A[i]==A[i+1]:
        B[i]=0
    elif A[i]<A[i+1]:
        B[i]=1
i=0
cnt=[0]*N
while True:
    if B[i]==1:
        if B[i+1]==0 or B[i+1]==1:
            i+=1
        elif B[i+1]==-1:
            if cnt[i-1]==0 or i==0:
                cnt[i]=1
            i+=1
        else:
            i+=1
    if B[i]==0:
        i+=1
    if B[i]==-1:
        if B[i+1]==0 or B[i+1]==-1:
            i+=1
        elif B[i+1]==1:
            if cnt[i-1]==0 or i==0:
                cnt[i]=1
            i+=1
        else:
            i+=1
    if B[i]==2:
        break
print(cnt.count(1)+1)



Fixed submission:
n = int(input())
a = list(map(int, input().split()))
i=0
cnt=0

tmp=[]
for i in range(1,n):
    if a[i]>a[i-1]:
        tmp.append(1)
    elif a[i]==a[i-1]:
        tmp.append(0)
    else:
        tmp.append(-1)

flg=0
swi=0
for j in range(len(tmp)):
    if swi==1:
        flg=tmp[j]
        swi=0
        continue
 
    if flg==0:
        flg=tmp[j]
    elif flg==1:
        if tmp[j]==-1:
            cnt+=1
            flg=-1
            swi=1
    elif flg==-1:
        if tmp[j]==1:
            cnt+=1
            flg=1
            swi=1

print(cnt+1)
Buggy python submission (verdict: Runtime Error):
N,C,K = map(int, input().split())
T = [int(input()) for i in range(N)]
T.sort()
ans=s=0
while s<N:
    t=T[s]+K
    sm=1
    for i in range(s+1,s+c):
        if T[i]<t:
            sm+=1
        else:
            break
    s+=sm
    ans+=1
print(ans)


Fixed submission:
N,C,K = map(int, input().split())
T = [int(input()) for i in range(N)]
T.sort()
ans=s=0
while s<N:
    t=T[s]+K
    sm=1
    for i in range(s+1,min(s+C,N)):
        if T[i]<=t:
            sm+=1
        else:
            break
    s+=sm
    ans+=1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
a=1
for i in range(1,N+1):
    a*=i
print(a%(10**9+7))

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

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
a=1
for i in range(1,N+1):
    a*=i
print(a%(10**9+7))

Fixed submission:
N = int(input())
a=1
for i in range(1,N+1):
    a*=i
    a%=(10**9+7)
print(a%(10**9+7))
Buggy python submission (verdict: Runtime Error):
import itertools
N, M = map(int, input().split())
p=[[0]*N for i in range(N)]
for i in range(M):
    a,b=map(int,input().split())
    p[a-1][b-1]=1
    p[b-1][a-1]=1
cnt=0
a=[i for i in range(N)]

for i in itertools.permutations(a):
    flag=0
    if i[0]==0:
        for j in range(1,M):
            if p[i[j]][i[j-1]]!=1:
                flag=1
        if flag==0:
            cnt+=1
    
print(cnt)
      

Fixed submission:
import itertools
N, M = map(int, input().split())
p=[[0]*N for i in range(N)]
for i in range(M):
    a,b=map(int,input().split())
    p[a-1][b-1]=1
    p[b-1][a-1]=1
cnt=0
a=[i for i in range(N)]

for i in itertools.permutations(a):
    flag=0
    if i[0]==0:
        for j in range(1,N):
            if p[i[j]][i[j-1]]!=1:
                flag=1
        if flag==0:
            cnt+=1
    
print(cnt)

Buggy python submission (verdict: Runtime Error):
import itertools
N, M = map(int, input().split())
A = [list(map(int, input().split())) for i in range(N)]
cnt=0
for l in range(1,N+1):
    for i in itertools.combinations(A,l):
        a=[0]*N
        for j,k in i:
            a[j-1]+=1
            a[k-1]+=1
        if a[0]==1 and a.count(1)==2 and a.count(2)==N-2:
            cnt+=1
print(cnt)
      

Fixed submission:
import itertools
N, M = map(int, input().split())
p=[[0]*N for i in range(N)]
for i in range(M):
    a,b=map(int,input().split())
    p[a-1][b-1]=1
    p[b-1][a-1]=1
cnt=0
a=[i for i in range(N)]

for i in itertools.permutations(a):
    flag=0
    if i[0]==0:
        for j in range(1,N):
            if p[i[j]][i[j-1]]!=1:
                flag=1
        if flag==0:
            cnt+=1
    
print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
K, S = map(int, input().split())
cnt=0
for x in range(K+1):
    for y in range(K+1):
        for z in range(K+1):
            if x+y+z==S:
                cnt+=1

print(cnt)


Fixed submission:
K, S = map(int, input().split())
cnt=0
for x in range(K+1):
    for y in range(K+1):
        if x+y<=S:
            if K>=S-x-y:
                cnt+=1

print(cnt)
Buggy python submission (verdict: Runtime Error):
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()))
a.sort(reverse = True)
b.sort(reverse = True)
c.sort(reverse = True)
h = []
for i in range(x):
    if(i + 1>k) : break
    for j in range(y):
        if((i + 1)*(j + 1)j>k): break
        for l in range(z):
            if((i + 1)*(j + 1)*(l + 1)>k): break
            h.append(a[i] + b[j] +c[l])
h.sort(reverse = True)
for i in range(k):
    print(h[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()))
a.sort(reverse = True)
b.sort(reverse = True)
c.sort(reverse = True)
h = []
for i in range(x):
    for j in range(y):
        if(i*j>k): break
        for l in range(z):
            if(i*j*l>k): break
            h.append(a[i] + b[j] +c[l])
h.sort(reverse = True)
for i in range(k):
    print(h[i])

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()))
a.sort(reverse = True)
b.sort(reverse = True)
c.sort(reverse = True)
h = []
for i in range(x):
    for j in range(y):
        for l in range(z):
            if(i*j*l>k): break
            h.append(a[i] + b[j] +c[l])
h.sort(reverse = True)
for i in range(k):
    print(h[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()))
a.sort(reverse = True)
b.sort(reverse = True)
c.sort(reverse = True)
h = []
for i in range(x):
    for j in range(y):
        if(i*j>k): break
        for l in range(z):
            if(i*j*l>k): break
            h.append(a[i] + b[j] +c[l])
h.sort(reverse = True)
for i in range(k):
    print(h[i])
Buggy python submission (verdict: Runtime Error):
numbers = map(int, input().split())
number_list = [i+numbers[0] for i in range(numbers[1]-numbers[0])]
count = 0
for i in numbers_list:
  if number_list % numbers[2] == 0:
    count+=1
print(count)

Fixed submission:
numbers = [i for i in map(int, input().split())]
number_list = [i+numbers[0] for i in range(numbers[1]-numbers[0]+1)]
count = 0
for i in number_list:
  if i % numbers[2] == 0:
    count+=1
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
max_number = int(input())
list_numbers = [i+1 for i in range(max_number)]
count = 0
for i in list_numbers:
  count = 0
  for x in range(1,100):
    for y in range(1,100):
      for z in range(1,100):
        tot = x**2 + y**2 + z**2 + x * y + y * z + z * x
        if (tot == i):
          count += 1
  print(count)

Fixed submission:
N=int(input())
a=[0]*10**4
for j in range(1,101):
    for k in range(1,101):
        for h in range(1,101):
            tmp=h**2+j**2+k**2+h*j+j*k+k*h
            if tmp<=10000:
                a[tmp-1]+=1
for i in range(N):
    print(a[i])
Buggy python submission (verdict: Runtime Error):
number = int(intput())
print(number + number**2 + number**3)


Fixed submission:
number = int(input())
print(number + number**2 + number**3)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
numbers =[i for i in map(int,input().split())]
result =1
standard = 10**18
for i in range(N):
  result *= numbers[i]
  if result == 0:
    print("0")
    break
else:
  if result > standard:
    print("-1")
  else:
  	print(result)

Fixed submission:
n = int(input())
a = [i for i in map(int, input().split())]
 
if a.count(0) != 0:
  print(0)
else:
  result = 1
  for i in range(n):
    result *= a[i]
    if result > (10**18):
      print(-1)
      break
    else:
      continue
  else:
    print(result)

Buggy python submission (verdict: Runtime Error):
#include <iostream>
using namespace std;
int n;
int numbers[110];
int result;
int main() {
  cin >> n;
  for(int i; i<n; i++){
    cin >> numbers[i]
  }
  for(int i; i<sizeof(numbers)/sizeof(array[0]); i++){
    if(i == 0){
      cout << "0";
    }else{
      result *= numbers[i]
    }
  }
  if(result > pow(10,18.0)){
    cout << "-1"
  }else{
    cout << result
  }
}

Fixed submission:
n = int(input())
a = [i for i in map(int, input().split())]
 
if a.count(0) != 0:
  print(0)
else:
  result = 1
  for i in range(n):
    result *= a[i]
    if result > (10**18):
      print(-1)
      break
    else:
      continue
  else:
    print(result)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
N_S = map(int, input().split())
n = 1
for i in N_S:
  if i == 0:
    print('0')
    break
  else:
    n *=i
else:
  if n > 10**18:
    print('-1')
  else:
    print(n)

Fixed submission:
n = int(input())
a = [i for i in map(int, input().split())]
 
if a.count(0) != 0:
  print(0)
else:
  result = 1
  for i in range(n):
    result *= a[i]
    if result > (10**18):
      print(-1)
      break
    else:
      continue
  else:
    print(result)
Buggy python submission (verdict: Runtime Error):
from decimal import Decimal
 
A,B = input().split()
 
A=int(A)
B=Decimal(B)
print(int(a*b))

Fixed submission:
from decimal import Decimal
 
A,B = input().split()
 
A=int(A)
B=Decimal(B)
print(int(A*B))
Buggy python submission (verdict: Time Limit Exceeded):
data = [i for i in map(int,input().split())]
for i in range(data[2]):
  if data[0] >= 1:
    data[0] -= 1
  elif data[1] >=1:
    data[1] -=1
print(f'{data[0]} {data[1]}')

Fixed submission:
a,b,k = map(int, input().split())
if a <= k:
    k -= a
    if b <= k:
        k -= b
        print(0,0)
    else:
        print(0,b-k)
else:
    print(a-k,b)

Buggy python submission (verdict: Runtime Error):
data = map(int,input().split())
for i in range(data[2]):
  if data[0] >= 1:
    data[0] -= 1
  elif data[1] >=1:
    data[1] -=1
print(f'{data[0]} {data[1]}')

Fixed submission:
a,b,k = map(int, input().split())
if a <= k:
    k -= a
    if b <= k:
        k -= b
        print(0,0)
    else:
        print(0,b-k)
else:
    print(a-k,b)
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
N = int(input())
count = 0
for A in range(1,N):
  for B in range(1,N):
    if A*B >= N:
      break
    else:
      count += 1
print(count)

Fixed submission:
# -*- coding: utf-8 -*-
N = int(input())
count = 0
for A in range(1,N):
  if N % A == 0:
    count += (N//A) - 1
  else:
    count += (N//A)
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
mod = pow(10,9)+7
n = int(input())
a = list(map(int,input().split()))
ans = []
for i in range(n-1):
    for j in range(i+1, n):
        ans.append(a[i]*a[j])
print(sum(ans) % mod)


Fixed submission:
mod = 1000000007
n = int(input())
a = list(map(int,input().split()))
ans = 0
ans += (sum(a)*sum(a))%mod
for i in range(n):
    ans -= (a[i]*a[i])%mod
    if ans < 0:
        ans += mod
ans *= (mod + 1) // 2
ans %= mod
print(int(ans))
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
a = list(map(int, input().split()))

li = []
for i in range(n-k +1):
    tmp = a[i]
    for j in range(1, k):
        tmp *= a[i +j]
    li.append(tmp)

for i in range(len(li) -1):
    if (li[i] >= li[i+1]):
        print("No")
    else:
        print("Yes")

Fixed submission:
n, k = map(int, input().split())
a = list(map(int, input().split()))
for i in range(n -k):
    if a[i] >= a[k+i]:
        print("No")
    else:
        print("Yes")
Buggy python submission (verdict: Runtime Error):
import sys
import itertools
import resource
xrange = lambda stop: iter(itertools.count().next, stop)
sys.setrecursionlimit(1000000)
ys.setrecursionlimit(10 ** 9)
resource.setrlimit(resource.RLIMIT_STACK, (-1, -1))
n = int(input())

chars ={1: 'a', 2: 'b', 3: 'c', 4: 'd', 5: 'e', 6: 'f', 7: 'g', 8: 'h', 9: 'i', 10: 'j', 11: 'k', 12: 'l', 13: 'm', 14: 'n', 15: 'o', 16: 'p', 17: 'q', 18: 'r', 19: 's', 20: 't', 21: 'u', 22: 'v', 23: 'w', 24: 'x', 25: 'y', 26: 'z'}

if n <= 26:
    print(chars[n])
    sys.exit()



def Base_10_to_26(X):
    if (X//26):
        return Base_10_to_26(int(X//26))+chars[int(X%26)]
    return chars[int(X%n)]

print(Base_10_to_26(n))


Fixed submission:
import sys
import itertools
#import resource
#xrange = lambda stop: iter(itertools.count().next, stop)
#sys.setrecursionlimit(1000000)
#sys.setrecursionlimit(10 ** 13)
n = int(input())

chars ={1: 'a', 2: 'b', 3: 'c', 4: 'd', 5: 'e', 6: 'f', 7: 'g', 8: 'h', 9: 'i', 10: 'j', 11: 'k', 12: 'l', 13: 'm', 14: 'n', 15: 'o', 16: 'p', 17: 'q', 18: 'r', 19: 's', 20: 't', 21: 'u', 22: 'v', 23: 'w', 24: 'x', 25: 'y', 26: 'z'}

if n <= 26:
    print(chars[n])
    sys.exit()


ans = []
while True:
    n -= 1
    ans.append(chr(ord("a") + n % 26))
    n //= 26
    if n <= 0:
        break
for i in range(len(ans)):
    print(ans[-i-1], end="")

Buggy python submission (verdict: Runtime Error):
n = int(input())

chars ={1: 'a', 2: 'b', 3: 'c', 4: 'd', 5: 'e', 6: 'f', 7: 'g', 8: 'h', 9: 'i', 10: 'j', 11: 'k', 12: 'l', 13: 'm', 14: 'n', 15: 'o', 16: 'p', 17: 'q', 18: 'r', 19: 's', 20: 't', 21: 'u', 22: 'v', 23: 'w', 24: 'x', 25: 'y', 26: 'z'}

if n <= 26:
    print(chars[n])
    exit()



def Base_10_to_26(X):
    if (int(X/26)):
        return Base_10_to_26(int(X/26))+chars[int(X%26)]
    return chars[int(X%n)]

N = (Base_10_to_26(n))

print(N)


Fixed submission:
import sys
import itertools
#import resource
#xrange = lambda stop: iter(itertools.count().next, stop)
#sys.setrecursionlimit(1000000)
#sys.setrecursionlimit(10 ** 13)
n = int(input())

chars ={1: 'a', 2: 'b', 3: 'c', 4: 'd', 5: 'e', 6: 'f', 7: 'g', 8: 'h', 9: 'i', 10: 'j', 11: 'k', 12: 'l', 13: 'm', 14: 'n', 15: 'o', 16: 'p', 17: 'q', 18: 'r', 19: 's', 20: 't', 21: 'u', 22: 'v', 23: 'w', 24: 'x', 25: 'y', 26: 'z'}

if n <= 26:
    print(chars[n])
    sys.exit()


ans = []
while True:
    n -= 1
    ans.append(chr(ord("a") + n % 26))
    n //= 26
    if n <= 0:
        break
for i in range(len(ans)):
    print(ans[-i-1], end="")