Harryxun/GPT-100-sft-dataset huggingface dataset:
Problem p02623 (python)

Fixed submission:
import sys

def resolve():
    lines = sys.stdin.readlines()

    n, m, k = tuple(map(int, lines[0].strip().split(' ')))
    A = list(map(int, lines[1].strip().split(' ')))
    B = list(map(int, lines[2].strip().split(' ')))

    a = [0]
    b = [0]

    for i in range(n):
        a.append(a[i] + A[i])
    for i in range(m):
        b.append(b[i] + B[i])

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

resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    lines = sys.stdin.readlines()

    n, m, k = tuple(map(int, lines[0].strip().split(' ')))
    A = list(map(int, lines[1].strip().split(' ')))
    B = list(map(int, lines[2].strip().split(' ')))

    a = [0]
    b = [0]

    for i in range(n):
        a.append(a[i] + A[i])
    for i in range(m):
        b.append(b[i] + B[i])

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

resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    lines = sys.stdin.readlines()

    n, m, k = tuple(map(int, lines[0].strip().split(' ')))
    a = list(map(int, lines[1].strip().split(' ')))
    b = list(map(int, lines[2].strip().split(' ')))
    c_max = 0
    c = 0
    s = 0
    for q in b:
        s += q
        if s > k:
            break
        c += 1
    c_max = max(c, c_max)
    s = 0
    c = 0
    for p in a:
        s += p
        c += 1
        if s > k:
            break
        sb = s
        cb = c
        for q in b:
            sb += q
            if sb > k:
                break
            cb += 1
        c_max = max(cb, c_max)


    print(c_max)
    
resolve()
Problem p02955 (python)

Fixed submission:
import sys

def divisor(n):
    i = 1
    table = []
    while i * i <= n:
        if n % i == 0:
            table.append(i)
            table.append(n//i)
        i += 1
    table = list(set(table))
    table.sort(reverse=True)
    return table

def resolve():
    lines = sys.stdin.readlines()
    n, k = tuple(map(int, lines[0].split(' ')))
    a = list(map(int, lines[1].split(' ')))
    divs = divisor(sum(a))

    for div in divs:
        a_mod = list(map(lambda x: x % div, a))
        sum_mod = sum(a_mod)
        a_mod.sort(reverse=True)
        loop = sum_mod//div
        for i in range(loop):
            a_mod[i] = 0
        sum_e_mod = sum(a_mod)
        if k >= sum_e_mod:
            print(div)
            return
    print(1)

resolve()

Buggy submission (verdict: Runtime Error):
import sympy

def resolve():
    lines = sys.stdin.readlines()
    n, k = tuple(map(int, lines[0].split(' ')))
    a = list(map(int, lines[1].split(' ')))
    divs = sympy.divisors(sum(a))
    divs = list(reversed(divs))

    for div in divs:
        a_mod = list(map(lambda x: x % div, a))
        sum_mod = sum(a_mod)
        if k >= sum_mod//2:
            print(div)
            break
resolve()
Problem p02659 (python)

Fixed submission:
a, b = input().split()
a = int(a)
b = int(float(b) * 100 +0.1)
print(int(a*b) // 100)

Buggy submission (verdict: Runtime Error):
a, b = input().split()
a = int(a)
# b = int(float(b) * 100 +0.1)
b = int(b.replace(".". ""))
print(int(a*b) // 100)
Problem p02759 (python)

Fixed submission:
import math

pages = input()
count = int(pages)

if count %2 == 0 :
    print(count/2)
else :
    print((count + 1)/2)

Buggy submission (verdict: Runtime Error):
v = []
m = [False for _ in range(9)]
for i in range(3):
    a, b, c = map(int, input().split())
    v += [a, b, c]

n = int(input())
for i in range(n):
    a = int(input())
    if a in v:
        m[v.index(a)] = True

def control():
    for i in range(3):
        if all(m[3*i:3*i+3]):
            return True
        if all(m[i::3]):
            return True

    if all(m[::4]) or all(m[2:8:2]):
        return True
    return False

print("Yes" if control() else "No")

Buggy submission (verdict: Runtime Error):
import math

pages = input()
count = int(pages)

if count %2 = 0 :
    print(count/2)
else :
    print((count + 1)/2)

Buggy submission (verdict: Runtime Error):
pages = input()
count = int(pages)

if count %2 = 0 :
    print(count/2)
else :
    print((count + 1)/2)

Buggy submission (verdict: Runtime Error):
pages = input()
count = int(pages)

if count %2 = 0 :
    print(count/2)
else :
    print((count + 1)/2)

Buggy submission (verdict: Runtime Error):
pages = input()
count = int(pages)

if count %2 = 0 :
    print(count/2)

else :
    print((count + 1)/2)
Problem p02933 (python)

Fixed submission:
a=int(input())
s=input()


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

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10**6)
n,q = map(int,input().split())
a=[[] for i in range(n)]
p=[]*n
l=[0]*n
ans=[0]*n

def dfs(parent,current,value):
    value += l[current]
    ans[current] = value
    for i in a[current]:
        if i == parent:
            continue
        dfs(current,i,value)


for i in range(n-1):
    t1,t2 = map(int,input().split())
    a[t1-1].append(t2-1)
    a[t2-1].append(t1-1)
    
for i in range(q):
    t1,t2 = map(int,input().split())
    l[t1-1]+=t2
dfs(-1,0,0)

print(" ".join(map(str,ans)))
Problem p02935 (python)

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

v = sorted(v)
# print(v)
def dfs (l):
    if len(l)==1:
         return l[0]
    num = (l[0]+l[1])/2.0
    l = l[2:]
    # print(l)
    l.append(num)
    # print(l)
    l = sorted(l)
    return dfs(l)



print(dfs(v))

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10**6)
n,q = map(int,input().split())
a=[[] for i in range(n)]
p=[]*n
l=[0]*n

def dfs(parent,current):
    for i in a[current-1]:
        if i != parent:
            l[i-1] += l[current-1]
            dfs(current,i)


for i in range(n-1):
    t1,t2 = map(int,input().split())
    a[t1-1].append(t2)
    a[t2-1].append(t1)
    
for i in range(q):
    t1,t2 = map(int,input().split())
    l[t1-1]+=t2
dfs(-1,1)

print(" ".join(map(str,l)))
Problem p03107 (python)

Fixed submission:
s = input()
a = s.count('1')
b = s.count('0')

num = min(a,b)*2
print(num)

Buggy submission (verdict: Runtime Error):
s = input()
origin = s
past = ''
cnt=0
while True:
    past = s
    s = s.replace('10','').replace('01','')
    print(s)
    print(past)
    if past==s:
        break

num = len(origin)-len(s)
print(num)
Problem p02659 (python)

Fixed submission:
a = input().split()
b = int(a[0])
c = float(a[1])
c = round(c*100)

ans = b*c // 100
print(int(ans))

Buggy submission (verdict: Runtime Error):
n = int(input())
a = input().split()
a_int = [int(n) for n in a]
ans = 1
for num in a_int:
    if ans > 10**18:
        print(-1)
        exit()
    else:
        ans *= num
print(ans)

Buggy submission (verdict: Runtime Error):
from math import floor
a, b = input().split()
a = int(a)
b = float(b)
print(int(floor(a*b))
Problem p02676 (python)

Fixed submission:
k = int(input())
s = str(input())
if k < len(s):
    ans = s[0:k]+'...'
    print(ans)
else:
    print(s)

Buggy submission (verdict: Runtime Error):
from math import cos, sqrt, pi
a, b, h, m = map(int, input().split())
#時針の角度
ang_a = pi * h / 6 + pi * m / 360
#分針の角度
ang_b = pi * m / 30
#角度差
ang = abs(ang_a-ang_b)
#余弦定理
c = sqrt(a**2 + b**2 - 2*a*b*cos(ang))
print(c)
Problem p02689 (python)

Fixed submission:
n, m = map(int, input().split())
h = list(map(int, input().split()))
delete_list =[]
for i in range(m):
    a, b = map(int, input().split())
    if h[a-1] > h[b-1]:
        delete_list.append(b)
    if h[a-1] == h[b-1]:
        delete_list.append(a)
        delete_list.append(b)
    if h[a-1] < h[b-1] :
        delete_list.append(a)

delete_list = set(delete_list)
print(n - len(delete_list))

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
h = list(map(int, input().split()))
delete_list =[]
pairs = []
for i in range(m):
    a, b = map(int, input().split())
    if h[a-1] > h[b-1]:
        delete_list.append(b)
    if h[a-1] == h[b-1]:
        delete_list.append(a, b)
    else:
        delete_list.append(a)

delete_list = set(delete_list)
print(n - len(delete_list))
Problem p02707 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
anss = [0] * n
for _ in a:
    anss[_-1] += 1
for ans in anss:
    print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
anss = [0] * n
for _ in a:
    anss[a-1] += 1
for ans in anss:
    print(ans)
Problem p02879 (python)

Fixed submission:
A, B = map(int,input().split())
if (0<=A<=9) and (0<=B<=9):
  print(A*B)
else:
  print(-1)

Buggy submission (verdict: Runtime Error):
A, B = map(int.input().split())
if (0<=A<=9) and (0<=B<=9):
  print(A*B)
else:
  print(-1)
Problem p02623 (python)

Fixed submission:
from sys import stdin
data = stdin.readlines()

n = int(data[0].split()[0])
m = int(data[0].split()[1])

k = int(data[0].split()[2])

A = [int(s) for s in data[1].split()]
B = [int(s) for s in data[2].split()]

a = [0]
b = [0]

for i in range(n):
    a.append(a[i]+A[i])
for i in range(m):
    b.append(b[i]+B[i])

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

Buggy submission (verdict: Runtime Error):
from sys import stdin
data = stdin.readlines()

n = int(data[0].split()[0])
m = int(data[0].split()[1])

k = int(data[0].split()[2])

A = [int(s) for s in data[1].split()]
B = [int(s) for s in data[2].split()]

a = [0]
b = [0]

for i in range(n):
    a.append(a[i]+A[i])
for i in range(m):
    b.append(b[i]+B[i])
a.pop(0)
b.pop(0)

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

Buggy submission (verdict: Runtime Error):
from sys import stdin
data = stdin.readlines()

n = int(data[0].split()[0])
m = int(data[0].split()[1])

k = int(data[0].split()[2])

A = [int(s) for s in data[1].split()]
B = [int(s) for s in data[2].split()]

a = [0]
b = [0]

for i in range(n):
    a.append(a[i]+A[i])
for i in range(m):
    b.append(b[i]+B[i])
a.pop(0)
b.pop(0)

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

Buggy submission (verdict: Runtime Error):
from sys import stdin
data = stdin.readlines()

n = int(data[0].split()[0])
m = int(data[0].split()[1])

k = int(data[0].split()[2])

A = [int(s) for s in data[1].split()]
B = [int(s) for s in data[2].split()]

a = [0]
b = [0]

for i in range(n):
    a.append(a[i]+A[i])
for i in range(m):
    b.append(b[i]+B[i])
a.pop(0)
b.pop(0)

ans = []
for i in range(n):
    if a[i] <= k:
        for j in reversed(range(m)):
            if a[i]+b[j] <= k:
                ans.append(i+j+2)
                break
print(max(ans))
Problem p02629 (python)

Fixed submission:
from sys import stdin
n = int(stdin.readline().rstrip())

a = []
while n // 26 >= 1:
    if n%26 == 0:
        a.insert(0, 26)
        n = (n - 26) // 26
    else:
        a.insert(0, n%26)
        n = (n - n%26) // 26
if n > 0:
    a.insert(0, n)

i = 1
while i <= len(a):
    t = a[i-1]
    if t == 1:
        a[i-1] = "a"
    elif t == 2:
        a[i-1] = "b"
    elif t == 3:
        a[i-1] = "c"
    elif t == 4:
        a[i-1] = "d"
    elif t == 5:
        a[i-1] = "e"
    elif t == 6:
        a[i-1] = "f"
    elif t == 7:
        a[i-1] = "g"
    elif t == 8:
        a[i-1] = "h"
    elif t == 9:
        a[i-1] = "i"
    elif t == 10:
        a[i-1] = "j"
    elif t == 11:
        a[i-1] = "k"
    elif t == 12:
        a[i-1] = "l"
    elif t == 13:
        a[i-1] = "m"
    elif t == 14:
        a[i-1] = "n"
    elif t == 15:
        a[i-1] = "o"
    elif t == 16:
        a[i-1] = "p"
    elif t == 17:
        a[i-1] = "q"
    elif t == 18:
        a[i-1] = "r"
    elif t == 19:
        a[i-1] = "s"
    elif t == 20:
        a[i-1] = "t"
    elif t == 21:
        a[i-1] = "u"
    elif t == 22:
        a[i-1] = "v"
    elif t == 23:
        a[i-1] = "w"
    elif t == 24:
        a[i-1] = "x"
    elif t == 25:
        a[i-1] = "y"
    elif t == 26:
        a[i-1] = "z"
    i += 1

print(''.join(a))

Buggy submission (verdict: Runtime Error):
from sys import stdin
n = int(stdin.readline().rstrip())

a = []
while n // 26 >= 1:
    if n%26 == 0:
        a.insert(0, 26)
        n = (n - 26) // 26
    else:
        a.insert(0, n%26)
        n = (n - n%26) // 26
if n >= 0:
    a.insert(0, n)

i = 1
while i <= len(a):
    t = a[i-1]
    if t == 1:
        a[i-1] = "a"
    elif t == 2:
        a[i-1] = "b"
    elif t == 3:
        a[i-1] = "c"
    elif t == 4:
        a[i-1] = "d"
    elif t == 5:
        a[i-1] = "e"
    elif t == 6:
        a[i-1] = "f"
    elif t == 7:
        a[i-1] = "g"
    elif t == 8:
        a[i-1] = "h"
    elif t == 9:
        a[i-1] = "i"
    elif t == 10:
        a[i-1] = "j"
    elif t == 11:
        a[i-1] = "k"
    elif t == 12:
        a[i-1] = "l"
    elif t == 13:
        a[i-1] = "m"
    elif t == 14:
        a[i-1] = "n"
    elif t == 15:
        a[i-1] = "o"
    elif t == 16:
        a[i-1] = "p"
    elif t == 17:
        a[i-1] = "q"
    elif t == 18:
        a[i-1] = "r"
    elif t == 19:
        a[i-1] = "s"
    elif t == 20:
        a[i-1] = "t"
    elif t == 21:
        a[i-1] = "u"
    elif t == 22:
        a[i-1] = "v"
    elif t == 23:
        a[i-1] = "w"
    elif t == 24:
        a[i-1] = "x"
    elif t == 25:
        a[i-1] = "y"
    elif t == 26:
        a[i-1] = "z"
    i += 1


print(''.join(a))
Problem p02623 (python)

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

best=0
j=M
for i in range(0,N+1):
  while j>0:
    if A[i]+B[j]<=K:
      break
    else: j-=1
  if A[i]+B[j]<=K:
    best=max(best,i+j)
  pass
print(best)

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

j,best=0,0
for j in range(M):
  if B[j] > K: break
  else:best=j+1
j＝0
for i in range(N):
  if A[i] > K: break
  while j < M:
    if A[i]+B[j] > K: break
    else: j+=1
  best=max(best,i+1+j)
print(best)
Problem p02699 (python)

Fixed submission:
S,W=map(int,input().split())
if S <= W:
  print('unsafe')
else:
  print('safe')

Buggy submission (verdict: Runtime Error):
S,W=map(int,input().split())
if S <= W:
  print('unsafe')
else
  print('safe')

Buggy submission (verdict: Runtime Error):
S,W=map(int,input.split())
if S <= W:
  print('unsafe')
else
  print('safe')
Problem p02819 (python)

Fixed submission:
def is_prime(p):
  if p>1:
    for i in range(2,p):
      if p%i==0:return True
  return False

X=int(input())
p=X
while is_prime(p) != False:p+=1
print(p)

Buggy submission (verdict: Runtime Error):
X=int(input())
ps=[]
x=2
while x=<X:
  f=True
  for p in ps:
    if x%p==0:
      f=False
      break
  if f:ps.append(x)
  x+=1
print(x)
Problem p02707 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
ans = [0] * n
for i in range(n-1):
    ans[a[i] - 1] += 1
for i in range(n):
    print(ans[i])

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
a = list(map(int, input().split()))
sum = sum(a)
if n >= sum:
    print(n - sum)
else:
    print(-1)
Problem p02820 (python)

Fixed submission:
n, k = map(int, input().split())
r, s, p = map(int, input().split())
t = list(input())
win = []
ans = 0
for i in range(n):
    if t[i] == "r":
        win.append("p")
    elif t[i] == "s":
        win.append("r")
    else:
        win.append("s")
for i in range(n):
    if i >= k:
        if win[i] == win[i - k]:
            if i + k >= n:
                pass
            elif win[i + k] != t[i]:
                win[i] = t[i]
            else:
                if win[i] != r and [i + k] != r:
                    win[i] = r
                elif win[i] != s and [i + k] != s:
                    win[i] = s
                elif win[i] != p and [i + k] != p:
                    win[i] = p
        else:
            if win[i] == "r":
                ans += r
            elif win[i] == "s":
                ans += s
            else:
                ans += p
    else:
        if win[i] == "r":
            ans += r
        elif win[i] == "s":
            ans += s
        else:
            ans += p
print(ans)

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
r, s, p = map(int, input().split())
t = list(input())
win = []
ans = 0
for i in range(n):
    if t[i] == "r":
        win.append("p")
    elif t[i] == "s":
        win.append("r")
    else:
        win.append("s")
for i in range(n):
    if i >= k:
        if win[i] == win[i - k]:
            if i + k > n:
                pass
            elif win[i + k] != t[i]:
                win[i] = t[i]
            else:
                if win[i] != r and [i + k] != r:
                    win[i] = r
                elif win[i] != s and [i + k] != s:
                    win[i] = s
                elif win[i] != p and [i + k] != p:
                    win[i] = p
        else:
            if win[i] == "r":
                ans += r
            elif win[i] == "s":
                ans += s
            else:
                ans += p
    else:
        if win[i] == "r":
            ans += r
        elif win[i] == "s":
            ans += s
        else:
            ans += p
print(ans)
Problem p02623 (python)

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

def main():
    n, m, k = map(int,input().split())
    a = list(map(int,input().split()))
    b = list(map(int,input().split()))

    asum = [0]*(n+1)
    bsum = [0]*(m+1)

    for i in range(n):
        asum[i+1] = asum[i] + a[i]

    for i in range(m):
        bsum[i+1] = bsum[i] + b[i]

    # jを小さくしていく発想がなかった
    j = m
    res = 0
    for i in range(n+1):
        # asumの分岐をさせてからbsumとの和を考えていく
        if asum[i] > k:
            break
        while asum[i] + bsum[j] > k:
            j -= 1
        
        res = max(res, j+i)
    print(res)


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.buffer.readline

def main():
    n, m, k = map(int,input().split())
    a = list(map(int,input().split()))
    b = list(map(int,input().split()))

    asum = [0]*(n+1)
    bsum = [0]*(m+1)

    for i in range(n):
        asum[i+1] = asum[i] + a[i]

    for i in range(m):
        bsum[i+1] = bsum[i] + b[i]

    cnt = 0
    t = 0
    res = 0

    bb = 0
    for i in range(m):
        while bb < m and asum[i] + bsum[bb+1] <= k:
            cnt += 1
            t += bsum[bb+1] - bsum[bb]
            bb += 1

        res += (bb - i)

        if bb == i:
            bb += 1
        else:
            t -= asum[i]
            cnt -= 1

    print(res)

if __name__ == '__main__':
    main()
Problem p02729 (python)

Fixed submission:
import itertools
a = list(map(int,input().split()))

s = [i for i in range(a[0])]
t = [i for i in range(a[1])]

n = list(itertools.combinations(s, 2))
m = list(itertools.combinations(t, 2))

print(len(n) + len(m))

Buggy submission (verdict: Runtime Error):
from scipy.misc.comb() import comb
a = list(map(int,input().split()))

print(scipy.misc.comb(a[0], 2, exact=True) + scipy.misc.comb(a[1], 2, exact=True))

Buggy submission (verdict: Runtime Error):
from scipy.special import comb
a = list(map(int,input().split()))

print(comb(a[0], 2, exact=True) + comb(a[1], 2, exact=True))
Problem p02629 (python)

Fixed submission:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys


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

def Base_10_to_n(i10, n, ans_list:list):
    i10 -= 1
    if(int(i10/n)):
        ans_list.append(Base_10_to_n(int(i10/n), n, ans_list))
        return str(i10%n)
    return str(i10%n)


def resolve():
    n = int(input().rstrip())
    n_list = []

    ans_list = []

    n_list.append(Base_10_to_n(n, 26, n_list))
    n26_list =[]
    for n26 in n_list:
        n26_list.append(int(n26))

    for n26 in n26_list:
        string = ord("a") + n26
        ans_list.append(chr(string))

    ans_string = ""
    for st in ans_list:
        ans_string += st
    print(ans_string.rstrip())

if __name__ == "__main__":
    resolve()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys


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

def Base_10_to_n(i10, n, ans_list:list):
    # 各桁を0-indexにするために1減らす
    i10 -= 1
    if(int(i10/n)):
        ans_list.append(Base_10_to_n(int(i10/n), n, ans_list))
        return str(i10%n)
    return str(i10%n)


def resolve():
    n = int(input().rstrip())
    n_list = []
    ans_list = []

    n_list.append(Base_10_to_n(n, 26, n_list))

    for n26 in n_list:
        string = ord("a") + n26
        ans_list.append(chr(string))

    ans_string = ""
    for st in ans_list:
        ans_string += st
    print(ans_string.rstrip())

if __name__ == "__main__":
    resolve()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys


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

def Base_10_to_n(i10, n, ans_list:list):
    if(int(i10/n)):
        ans_list.append(Base_10_to_n(int(i10/n), n, ans_list))
        return str(i10%n)
    return str(i10%n)


def resolve():
    n = int(input().rstrip())
    n_list = []

    ans_list = []

    n_list.append(Base_10_to_n(n, 26, n_list))
    cnt = 0

    #print(n_list)
    for i in range(len(n_list)):
        #print(ans_list)
        if n_list[i] == "0":
            cnt = 1
            while n_list[i - cnt] == "1":
                #print(ans_list,cnt, i-cnt)
                ans_list.pop(i-cnt)
                ans_list.append("z")
                #print(ans_list)
                if i-cnt == 0:
                    break
                cnt += 1
            #print(i, cnt)
            if n_list[i-cnt] != "1":
                #print(ans_list)
                ord_s = ord(ans_list.pop(i-cnt-1)) -1
                #print(ans_list)
                ans_list.append(chr(ord_s))
                ans_list.append("z")


        else:
            string = ord('a') + int(n_list[i]) -1
            ans_list.append(chr(string))

    ans_string = ""
    for st in ans_list:
        ans_string += st
    print(ans_string.rstrip())

if __name__ == "__main__":
    resolve()