Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
def main():
    N = int(input())
    T = tuple(int(input()) for _ in range(N))

    lcm_ = T[0]
    for i in T:
        lcm_ = lcm(i, lcm_)

    print(int(lcm_))

def gcd(a, b):
    if a < b:
        a, b = b, a
    r = a % b
    if r == 0:
        return b
    else:
        a = b
        b = r
        return gcd(a, b)

def lcm(a, b):
    c = gcd(a, b)
    return a * b / c

main()


Fixed submission:
def main():
    N = int(input())
    T = tuple(int(input()) for _ in range(N))

    lcm_ = T[0]
    for i in T:
        lcm_ = lcm(i, lcm_)

    print(lcm_)

def gcd(a, b):
    if a < b:
        a, b = b, a
    r = a % b
    if r == 0:
        return b
    else:
        a = b
        b = r
        return gcd(a, b)

def lcm(a, b):
    c = gcd(a, b)
    return a * b // c

main()

Buggy python submission (verdict: Runtime Error):
import math

def main():
    N = int(input())
    T = tuple(int(input()) for _ in range(N))

    gcd_ = math.gcd(max(T), min(T))
    ans = max(T) * min(T) // gcd_
    print(ans)

main()


Fixed submission:
def main():
    N = int(input())
    T = tuple(int(input()) for _ in range(N))

    lcm_ = T[0]
    for i in T:
        lcm_ = lcm(i, lcm_)

    print(lcm_)

def gcd(a, b):
    if a < b:
        a, b = b, a
    r = a % b
    if r == 0:
        return b
    else:
        a = b
        b = r
        return gcd(a, b)

def lcm(a, b):
    c = gcd(a, b)
    return a * b // c

main()
Buggy python submission (verdict: Runtime Error):
def main():
    N, M = map(int, input().split())
    A = tuple(tuple(map(int, input().split())) for _ in range(M))

    if M == 1:
        print('IMPOSSIBLE')
        return

    for a, b in A:
        if a == 1:
            relay1 = b
        elif b == N:
            relay2 = a

    if relay1 == relay2:
        print('POSSIBLE')
    else:
        print('IMPOSSIBLE')

main()


Fixed submission:
def main():
    N, M = map(int, input().split())
    A = tuple(tuple(map(int, input().split())) for _ in range(M))

    if M == 1:
        print('IMPOSSIBLE')
        return

    relay = []
    for a, b in A:
        if a == 1:
            relay.append(b)
        elif b == N:
            relay.append(a)

    if len(relay) > len(set(relay)):
        print('POSSIBLE')
    else:
        print('IMPOSSIBLE')

main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N, M = map(int, input().split())
    A = tuple(tuple(map(int, input().split())) for _ in range(M))

    flag = 0
    for i in range(1, N):
        for a, b in A:
            if a == 1 and b == i:
                flag += 1
            elif a == i and b == N:
                flag += 1

        if flag == 2:
            ans = 'POSSIBLE'
            break
        else:
            flag = 0
    else:
        ans = 'IMPOSSIBLE'

    print(ans)

main()


Fixed submission:
def main():
    N, M = map(int, input().split())
    A = tuple(tuple(map(int, input().split())) for _ in range(M))

    if M == 1:
        print('IMPOSSIBLE')
        return

    relay = []
    for a, b in A:
        if a == 1:
            relay.append(b)
        elif b == N:
            relay.append(a)

    if len(relay) > len(set(relay)):
        print('POSSIBLE')
    else:
        print('IMPOSSIBLE')

main()
Buggy python submission (verdict: Runtime Error):
def main():
    N = int(input())
    A = tuple([int(input()) for _ in range(N)])

    a = list(A)
    idx = a.index(1)
    ans = 0
    while True:
        btn = a[idx]
        if btn == 0:
            ans = -1
            break
        elif btn == 2:
            break
        a[idx] = 0
        idx = btn - 1
        ans += 1

    print(ans)

main()


Fixed submission:
def main():
    N = int(input())
    A = tuple([int(input()) for _ in range(N)])

    a = list(A)
    ans = 0
    try:
        idx = a.index(1)
    except:
        idx = 0
        ans += 1

    while True:
        btn = a[idx]
        if btn == 0:
            ans = -1
            break
        elif btn == 2:
            break
        a[idx] = 0
        idx = btn - 1
        ans += 1

    print(ans)

main()
Buggy python submission (verdict: Runtime Error):
def main():
    N = int(input())
    S = input()

    s = S
    while True:
        s = s.replace('()', '')
        if s.count('()') == 0:
            break

    left = ''
    right = ''
    l = s.count('(')
    r = s.count(')')
    if s[0] == ')':
        left = '(' * r
    if s[-1] == '(':
        right = ')' * l

    print('{}{}{}'.format(left, S, right))

main()


Fixed submission:
def main():
    N = int(input())
    S = input()

    s = S
    while True:
        s = s.replace('()', '')
        if s.count('()') == 0:
            break

    if len(s) == 0:
        print(S)
        return

    left = ''
    right = ''
    if s[0] == ')':
        left = '(' * s.count(')')
    if s[-1] == '(':
        right = ')' * s.count('(')

    print('{}{}{}'.format(left, S, right))

main()
Buggy python submission (verdict: Runtime Error):
def main():
    N, A, B = map(int, input().split())

    num = tuple(range(A, B+1))
    n = len(num)
    cmb = n ** (N - 2)
    ans = (cmb + 1) // 2
    print(int(ans))

main()


Fixed submission:
def main():
    N, A, B = map(int, input().split())

    if A > B or (N == 1 and A != B):
        ans = 0
    elif N == 1:
        ans = 1
    else:
        ans = (N - 2) * (B - A) + 1
    print(ans)

main()

Buggy python submission (verdict: Runtime Error):
import itertools

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

    num = tuple(range(A, B+1))
    val = []
    for n in itertools.combinations_with_replacement(num, N):
        if n[0] == A and n[-1] == B:
            val.append(sum(n))

    ans = len(set(val))
    print(ans)

main()


Fixed submission:
def main():
    N, A, B = map(int, input().split())

    if A > B or (N == 1 and A != B):
        ans = 0
    elif N == 1:
        ans = 1
    else:
        ans = (N - 2) * (B - A) + 1
    print(ans)

main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N, K = map(int, input().split())
    ary = []
    i = 0
    while i < N:
        a, b = map(int, input().split())
        ary += [a] * b
        i += 1

    ans = sorted(ary)[K-1]
    print(ans)

main()


Fixed submission:
def main():
    N, K = map(int, input().split())
    ab = []
    i = 0
    while i < N:
        a, b = map(int, input().split())
        ab.append([a, b])
        i += 1

    ary = sorted(ab)
    j = 0
    for i in ary:
        j += i[1]
        if j >= K:
            print(i[0])
            break

main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    A, B, C = map(int, input().split())

    a = A
    b = B
    c = C
    i = 0
    while True:
        if (b + c) % 2 > 0 or (a + c) % 2 > 0 or (a + b) % 2 > 0:
            break
        elif A == B == C:
            i = -1
        else:
            now_a = (b + c) / 2
            now_b = (a + c) / 2
            now_c = (a + b) / 2
            a = now_a
            b = now_b
            c = now_c
            i += 1
    print(i)

main()


Fixed submission:
def main():
    A, B, C = map(int, input().split())

    a = A
    b = B
    c = C
    i = 0
    while True:
        if a % 2 > 0 or b % 2 > 0 or c % 2 > 0:
            break
        elif A == B == C:
            i = -1
            break
        else:
            now_a = (b + c) / 2
            now_b = (a + c) / 2
            now_c = (a + b) / 2
            a = now_a
            b = now_b
            c = now_c
            i += 1
    print(i)

main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N, M = map(int, input().split())

    i = 0
    AB = []
    while i < M:
        a, b = map(int, input().split())
        AB += [a, b]
        i += 1

    i = 1
    while i <= N:
        if AB.count(i) % 2 > 0:
            print('NO')
            break
        i += 1
    else:
        print('YES')

main()


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

    i = 0
    AB = [0 for i in range(N)]
    while i < M:
        a, b = map(int, input().split())
        AB[a-1] += 1
        AB[b-1] += 1
        i += 1

    for i in AB:
        if i % 2 > 0:
            print('NO')
            break
    else:
        print('YES')

main()

Buggy python submission (verdict: Runtime Error):
def main():
    N, M = map(int, input().split())

    i = 0
    AB = []
    while i < M:
        AB.append(tuple(map(int, input().split())))
        i += 1

    edge = [0 for i in range(M)]
    for i in AB:
        j = i[0] - 1
        end = i[1] - 1
        while j < end:
            edge[j] += 1
            j += 1

    for i in edge:
        if i % 2 > 0:
            print('NO')
            break
    else:
        print('YES')

main()


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

    i = 0
    AB = [0 for i in range(N)]
    while i < M:
        a, b = map(int, input().split())
        AB[a-1] += 1
        AB[b-1] += 1
        i += 1

    for i in AB:
        if i % 2 > 0:
            print('NO')
            break
    else:
        print('YES')

main()
Buggy python submission (verdict: Runtime Error):
def main():
    O = list(input())
    E = list(input())

    if len(E) % 2 != 0:
        E.append('')

    i = 0
    passwd = ''
    while i < len(O):
        passwd = passwd + O[i] + E[i]
        i += 1
    print(passwd)

main()


Fixed submission:
def main():
    O = list(input())
    E = list(input())

    if len(O) > len(E):
        E.append('')

    i = 0
    passwd = ''
    while i < len(O):
        passwd = passwd + O[i] + E[i]
        i += 1
    print(passwd)

main()
Buggy python submission (verdict: Runtime Error):
def main():
    N = int(input())

    i = 0
    S = []
    while i < N:
        S.append(list(str(input())))
        i += 1

    i = 0
    while i < N - 1:
        sset = set(S[i]) & set(S[i+1])
        i += 2

    ans = []
    for a in sset:
        i = 0
        n = []
        while i < N:
            n.append(S[i].count(a))
            i += 1
        small = min(n)
        ans.append(a * small)

    ans.sort()
    print(''.join(ans))

main()


Fixed submission:
import sys

def main():
    N = int(input())

    i = 0
    S = []
    while i < N:
        S.append(list(str(input())))
        i += 1
    if N == 1:
        ans = sorted(S[0])
        print(''.join(ans))
        sys.exit()

    i = 0
    while i < N - 1:
        sset = set(S[i]) & set(S[i+1])
        i += 2

    ans = []
    for a in sset:
        i = 0
        n = []
        while i < N:
            n.append(S[i].count(a))
            i += 1
        small = min(n)
        ans.append(a * small)

    ans.sort()
    print(''.join(ans))

main()

Buggy python submission (verdict: Runtime Error):
def main():
    N = int(input())

    i = 0
    S = []
    while i < N:
        S.append(sorted(list(str(input()))))
        i += 1

    i = 0
    while i < N - 1:
        s = set(S[i]) & set(S[i+1])
        i += 2

    ans = []
    for a in s:
        i = 0
        x = []
        while i < N:
            x.append(S[i].count(a))
            i += 1
        n = min(x)
        ans.append(a * n)

    ans.sort()
    print(''.join(ans))

main()


Fixed submission:
import sys

def main():
    N = int(input())

    i = 0
    S = []
    while i < N:
        S.append(list(str(input())))
        i += 1
    if N == 1:
        ans = sorted(S[0])
        print(''.join(ans))
        sys.exit()

    i = 0
    while i < N - 1:
        sset = set(S[i]) & set(S[i+1])
        i += 2

    ans = []
    for a in sset:
        i = 0
        n = []
        while i < N:
            n.append(S[i].count(a))
            i += 1
        small = min(n)
        ans.append(a * small)

    ans.sort()
    print(''.join(ans))

main()
Buggy python submission (verdict: Runtime Error):
def main():
    N = int(input())
    A = list(map(int, input().split()))

    A.sort()
    i = 1
    j = N - 1
    x = sum(A)
    while j > 0:
        if (x - A[j]) * 2 >= A[j]:
            i += 1
        else:
            break
        x -= A[j]
        j -= 1
    print(str(i))

main()

Fixed submission:
def main():
    N, C, K = map(int, input().split())
    i = 0
    T = []
    while i < N:
        T.append(int(input()))
        i += 1
    T.sort()
    T.reverse()

    c = 1
    i = 1
    bus = 1
    time = T[0]
    while i < N:
        if time - T[i] > K or c == C:
            bus += 1
            c = 1
            time = T[i]
        elif time - T[i] <= K:
            c += 1
        i += 1

    print(str(bus))

main()

Buggy python submission (verdict: Runtime Error):
def main():
    N = int(input())
    A = list(map(int, input().split()))

    A.sort()
    A.reverse()

    i = 1
    j = 1
    while j < N:
        if A[j - 1] / 2 <= sum(A[j:]):
            i += 1
        else:
            break
        j += 1
    print(str(i))

main()

Fixed submission:
def main():
    N, C, K = map(int, input().split())
    i = 0
    T = []
    while i < N:
        T.append(int(input()))
        i += 1
    T.sort()
    T.reverse()

    c = 1
    i = 1
    bus = 1
    time = T[0]
    while i < N:
        if time - T[i] > K or c == C:
            bus += 1
            c = 1
            time = T[i]
        elif time - T[i] <= K:
            c += 1
        i += 1

    print(str(bus))

main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N = int(input())
    A = list(map(int, input().split()))

    A.sort()

    i = 1
    j = N - 1
    while j > 0:
        if sum(A[:j]) * 2 >= A[j]:
            i += 1
        else:
            break
        j -= 1
    print(str(i))

main()

Fixed submission:
def main():
    N = int(input())
    A = list(map(int, input().split()))

    A.sort()
    i = 1
    j = N - 1
    x = sum(A)
    while j > 0:
        if (x - A[j]) * 2 >= A[j]:
            i += 1
        else:
            break
        x -= A[j]
        j -= 1
    print(str(i))

main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N = int(input())
    A = list(map(int, input().split()))

    A.sort()
    A.reverse()

    i = 1
    j = 1
    while j < N:
        if A[j - 1] / 2 <= sum(A[j:]):
            i += 1
        else:
            break
        j += 1
    print(str(i))

main()

Fixed submission:
def main():
    N = int(input())
    A = list(map(int, input().split()))

    A.sort()
    i = 1
    j = N - 1
    x = sum(A)
    while j > 0:
        if (x - A[j]) * 2 >= A[j]:
            i += 1
        else:
            break
        x -= A[j]
        j -= 1
    print(str(i))

main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N = int(input())
    A = list(map(int, input().split()))

    A.sort()
    A.reverse()

    i = 1
    j = 1
    while j < N:
        if A[j - 1] / 2 <= sum(A[j:]):
            i += 1
        else:
            break
        j += 1
    print(str(i))

main()

Fixed submission:
def main():
    N = int(input())
    A = list(map(int, input().split()))

    A.sort()
    i = 1
    j = N - 1
    x = sum(A)
    while j > 0:
        if (x - A[j]) * 2 >= A[j]:
            i += 1
        else:
            break
        x -= A[j]
        j -= 1
    print(str(i))

main()
Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split())
if M / N > 2:
    while True:
        M -= 2
        N += 1
        if M / N < 2:
            M += 2
            N -= 1
            break
    Scc = N
else:
    Scc = M // 2

print(str(Scc))

Fixed submission:
N, M = map(int, input().split())
if M == 0:
    Scc = M // 4
elif M / N >= 2:
    M -= N * 2
    Scc = N + (M // 4)
else:
    Scc = M // 2

print(str(Scc))
Buggy python submission (verdict: Runtime Error):
def even(num):
    if num & 1:
        return('uneven')
    else:
        return('even')

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

n = 0
for a in A:
    if even(a) == 'uneven':
        n += 1

if even(n) =a= 'even':
    print('YES')
else:
    print('NO')


Fixed submission:
def even(num):
    if num & 1:
        return('uneven')
    else:
        return('even')

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

n = 0
for a in A:
    if even(a) == 'uneven':
        n += 1

if even(n) == 'even':
    print('YES')
else:
    print('NO')
Buggy python submission (verdict: Runtime Error):
def main():
    N = int(input())

    lst = erastosthenes(N)
    plist = [i for i in range(3, N + 1, 2) if lst[i]]
    plist = [2] + plist

    mod = 1000000007
    ans = 1
    for p in plist:
        cnt = 0
        i = 1
        while 1:
            x = p ** i
            if x > N:
                break
            cnt += N // x
            i += 1
        ans = (ans % mod * (cnt + 1) % mod) % mod
    print(ans)

def erastosthenes(n):
    prime = [0, 1] * ((n + 1) // 2)
    if not n % 2:
        prime += [0]
    prime[1], prime[2] = 0, 1

    sqrt = n ** 0.5
    i = 3
    while i <= sqrt:
        for j in range(i ** 2, n, i):
            prime[j] = 0
        i += 2
    return prime

main()


Fixed submission:
def main():
    N = int(input())

    if N == 1:
        print(1)
        return

    lst = erastosthenes(N)
    plist = [i for i in range(3, N + 1, 2) if lst[i]]
    plist = [2] + plist

    mod = 1000000007
    ans = 1
    for p in plist:
        cnt = 0
        i = 1
        while 1:
            x = p ** i
            if x > N:
                break
            cnt += N // x
            i += 1
        ans = ans * (cnt + 1) % mod
    print(ans)

def erastosthenes(n):
    prime = [0, 1] * ((n + 1) // 2)
    if not n % 2:
        prime += [0]
    prime[1], prime[2] = 0, 1

    sqrt = n ** 0.5
    i = 3
    while i <= sqrt:
        for j in range(i ** 2, n + 1, i):
            prime[j] = 0
        i += 2
    return prime

main()
Buggy python submission (verdict: Time Limit Exceeded):
K, S = map(int, input().split())
n = 0
for i in range(K + 1):
    for j in range(K + 1):
        if (i + j) > S:
            continue
        elif (S - i - j) > K:
            continue
        for k in range(K + 1):
            if (i + j + k) == S:
                n += 1
print(str(n))


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

Buggy python submission (verdict: Time Limit Exceeded):
K, S = map(int, input().split())
n = 0
for i in range(K + 1):
    for j in range(K + 1):
        for k in range(K + 1):
            if (i + j + k) == S:
                n += 1
print(str(n))


Fixed submission:
K, S = map(int, input().split())
n = 0
for x in range(K + 1):
    for y in range(K + 1):
        if (x + y) > S:
            break
        elif (S - (x + y)) <= K:
            n += 1
print(str(n))
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N = int(input())
    A = tuple(map(int, input().split()))

    i = N - 1
    while i >= 0:
        n = A.count(i)
        if i == 0 and n != 1:
            print('0')
            break
        elif i != 0 and n != 2:
            print('0')
            break
        i -= 2
    else:
        comb = (2 ** (N // 2)) % 1000000007
        print(str(comb))

main()


Fixed submission:
def main():
    N = int(input())
    A = list(map(int, input().split()))

    if N % 2 == 1:
        A.append(0)

    A.sort()
    ev = tuple(A[::2])
    od = tuple(A[1::2])

    if ev == od:
        comb = (2 ** (N // 2)) % 1000000007
        print(str(comb))
    else:
        print('0')

main()
Buggy python submission (verdict: Runtime Error):
def main():
    N = int(input())
    A = tuple(tuple(map(int, input().split())) for _ in [0] * N)

    before_t = A[0][0]
    before_a = A[0][1]
    for t, a in A[1:]:
        n1 = -(-before_t // t)
        n2 = -(-before_a // a)
        n = max(n1, n2)
        taka, aoki = t * n, a * n
        before_t, before_a = taka, aoki

    print(taka + aoki)

main()


Fixed submission:
def main():
    N = int(input())
    A = tuple(tuple(map(int, input().split())) for _ in [0] * N)

    if N == 1:
        print(sum(A[0]))
        return

    before_t = A[0][0]
    before_a = A[0][1]
    for t, a in A[1:]:
        n1 = -(-before_t // t)
        n2 = -(-before_a // a)
        n = max(n1, n2)
        taka, aoki = t * n, a * n
        before_t, before_a = taka, aoki

    print(taka + aoki)

main()
Buggy python submission (verdict: Runtime Error):
a = list(input())
b = list(input())
c = list(input())

n = a[0]
del a[0]
if len(a) == 0:
    print("A")
while True:
    if n == "a":
        n = a[0]
        del a[0]
        if len(a) == 0:
            print("A")
            break
    elif n == "b":
        n = b[0]
        del b[0]
        if len(b) == 0:
            print("B")
            break
    elif n == "c":
        n = c[0]
        del c[0]
        if len(c) == 0:
            print("C")
            break


Fixed submission:
a = list(input())
b = list(input())
c = list(input())

n = a[0]
if len(a) < 1:
    del a[0]

while True:
    if n == "a":
        n = a[0]
        del a[0]
        if len(a) == 0:
            print("A")
            break
    elif n == "b":
        n = b[0]
        del b[0]
        if len(b) == 0:
            print("B")
            break
    elif n == "c":
        n = c[0]
        del c[0]
        if len(c) == 0:
            print("C")
            break

Buggy python submission (verdict: Runtime Error):
a = list(input())
b = list(input())
c = list(input())

n = a[0]
del a[0]
if len(a) == 0:
    print("A")
    break
while True:
    if n == "a":
        n = a[0]
        del a[0]
        if len(a) == 0:
            print("A")
            break
    elif n == "b":
        n = b[0]
        del b[0]
        if len(b) == 0:
            print("B")
            break
    elif n == "c":
        n = c[0]
        del c[0]
        if len(c) == 0:
            print("C")
            break


Fixed submission:
a = list(input())
b = list(input())
c = list(input())

n = a[0]
if len(a) < 1:
    del a[0]

while True:
    if n == "a":
        n = a[0]
        del a[0]
        if len(a) == 0:
            print("A")
            break
    elif n == "b":
        n = b[0]
        del b[0]
        if len(b) == 0:
            print("B")
            break
    elif n == "c":
        n = c[0]
        del c[0]
        if len(c) == 0:
            print("C")
            break

Buggy python submission (verdict: Runtime Error):
a = list(input())
b = list(input())
c = list(input())

n = a[0]
del a[0]
while True:
    if n == "a":
        n = a[0]
        del a[0]
        if len(a) == 0:
            print("A")
            break
    elif n == "b":
        n = b[0]
        del b[0]
        if len(b) == 0:
            print("B")
            break
    elif n == "c":
        n = c[0]
        del c[0]
        if len(c) == 0:
            print("C")
            break


Fixed submission:
a = list(input())
b = list(input())
c = list(input())

n = a[0]
if len(a) < 1:
    del a[0]

while True:
    if n == "a":
        n = a[0]
        del a[0]
        if len(a) == 0:
            print("A")
            break
    elif n == "b":
        n = b[0]
        del b[0]
        if len(b) == 0:
            print("B")
            break
    elif n == "c":
        n = c[0]
        del c[0]
        if len(c) == 0:
            print("C")
            break
Buggy python submission (verdict: Runtime Error):
def main():
    N, K = map(int, input().split())
    D = set(map(int, input().split()))

    for i in range(10):
        if i not in D:
            min_ = i
            break

    ans = []
    apnd = ans.append
    num, i = N, 0
    while num > 0:
        while num % 10 in D:
            num += 1
            top = i
        num, m = divmod(num, 10)
        apnd(m)
        i += 1

    ans[0:top] = [min_] * top
    print(*ans[::-1], sep='')

main()


Fixed submission:
def main():
    N, K = map(int, input().split())
    D = set(map(int, input().split()))

    for i in range(10):
        if i not in D:
            min_ = i
            break

    ans = []
    apnd = ans.append
    num, top, i = N, 0, 0
    while num > 0:
        while num % 10 in D:
            num += 1
            top = i
        num, m = divmod(num, 10)
        apnd(m)
        i += 1

    ans[0:top] = [min_] * top
    print(*ans[::-1], sep='')

main()