Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
x = list(map(int, input().split()))

X = []
for i in range(n):
    X.append([x[i],i])

X.sort(reverse=True)
ans = []
for i in range(n):
    sub = X.pop(i)
    ans.append([X[(n // 2) - 1][0],sub[1]])
    X.insert(i, sub)

ans.sort(key = lambda x: x[1])

for i in range(n):
    print(ans[i][0])

Fixed submission:
import bisect
n = int(input())
x = list(map(int, input().split()))

cp = sorted(x, reverse=False)
for i in range(n):
    s = bisect.bisect_left(cp, x[i])
    if s + 1 <= n // 2:
        print(cp[n // 2])
    else:
        print(cp[(n // 2) - 1])
Buggy python submission (verdict: Time Limit Exceeded):
a, b, k = map(int, input().split())

for i in range(a, b + 1):
    if i < a + k:
        print(i)
    elif i > b - k:
        print(i)

Fixed submission:
a, b, k = map(int, input().split())

ans = []
for i in range(a, min(b, a + k)):
    if i in ans:
        continue
    else:
        ans.append(i)
for i in range(max(a, b - k + 1), b + 1):
    if i in ans:
        continue
    else:
        ans.append(i)

for i in range(len(ans)):
    print(ans[i])
Buggy python submission (verdict: Runtime Error):
abc = list(map(int, input().split()))

abc.sort()
ans = 0

while True:
    if abc[0] == abc[1] and abc[1] == abc[2]:
        print(ans)
        break

    if abc[1] != abc[2]:
        abs[0] += 1
        abc[1] += 1
        ans += 1
    elif abc[1] == abc[2] and abc[1] + 1 == abc[0]:
        abc[1] += 1
        abc[2] += 1
        ans += 1
    else:
        abc[0] += 2
        ans += 1
    

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

abc.sort()
ans = 0

while True:
    if abc[0] == abc[1] and abc[1] == abc[2]:
        print(ans)
        break

    if abc[1] != abc[2]:
        abc[0] += 1
        abc[1] += 1
        ans += 1
    elif abc[1] == abc[2] and abc[1] + 1 == abc[0]:
        abc[1] += 1
        abc[2] += 1
        ans += 1
    else:
        abc[0] += 2
        ans += 1
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [int(input()) for i in range(n)]

ans = []
for i in range(n):
    if a[i] in ans:
        ans.remove(a[i])
    else:
        ans.append(a[i])

print(len(ans))

Fixed submission:
import collections
n = int(input())
a = [int(input()) for i in range(n)]

aa = collections.Counter(a)
ans = 0
for i in aa:
    if aa[i] % 2 == 1:
        ans += 1
    
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
t = [int(input()) for i in range(n)]

ma = max(t)
flag = True
while flag:
    for i in range(n):
        if ma % t[i] != 0:
            ma *= 2
            break
        if i == n - 1:
            flag = False

print(ma)

Fixed submission:
n = int(input())
t = [int(input()) for i in range(n)]

#最大公約数
def gcd(a, b):
    while b!=0:
        a,b=b,a%b
    return a

#最小公倍数
def lcm(a,b):
    return a * b // gcd(a, b)

ans = t[0]
for i in range(1,n):
    ans = lcm(ans, t[i])

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))

ans = []
for i in range(n):
    if i % 2 == 0:
        ans.append(str(a[i]))
    else:
        ans.insert(0, str(a[i]))

if n % 2 == 1:
    ans.reverse()

ans = ' '.join(ans)
print(ans)

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

if n % 2 == 0:
    for i in reversed(range(n)):
        if i % 2 == 1:
            print(a[i], end=" ")
    for i in range(n):
        if i % 2 == 0:
            print(a[i], end=" ")
else:
    for i in reversed(range(n)):
        if i % 2 == 0:
            print(a[i], end=" ")
    for i in range(n):
        if i % 2 == 1:
            print(a[i], end=" ")

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))

ans = []
for i in range(n):
    if i % 2 == 0:
        ans.append(a[i])
    else:
        ans.insert(0, a[i])

if n % 2 == 1:
    for i in range(n):
        print(ans[n - 1 - i], end=" ")
else:
    for i in range(n):
        print(ans[i], end=" ")


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

if n % 2 == 0:
    for i in reversed(range(n)):
        if i % 2 == 1:
            print(a[i], end=" ")
    for i in range(n):
        if i % 2 == 0:
            print(a[i], end=" ")
else:
    for i in reversed(range(n)):
        if i % 2 == 0:
            print(a[i], end=" ")
    for i in range(n):
        if i % 2 == 1:
            print(a[i], end=" ")
Buggy python submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(100000)
n = int(input())
a = [int(input()) for i in range(n)]

switch = [False] * (n + 1)
def button(x,cnt):
    if switch[x]:
        print(-1)
        return -1
    if x == 2:
        print(cnt)
        return
    switch[x] = True
    button(a[x - 1], cnt + 1)
    return cnt

ans = button(1, 0)

Fixed submission:
import sys
sys.setrecursionlimit(200000)
n = int(input())
a = [int(input()) for i in range(n)]

switch = [False] * (n + 1)
def button(x,cnt):
    if switch[x]:
        print(-1)
        return -1
    if x == 2:
        print(cnt)
        return
    switch[x] = True
    button(a[x - 1], cnt + 1)
    return cnt

ans = button(1, 0)

Buggy python submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(50000)
n = int(input())
a = [int(input()) for i in range(n)]

switch = [False] * (n + 1)
def button(x,cnt):
    if switch[x]:
        print(-1)
        return -1
    if x == 2:
        print(cnt)
        return
    switch[x] = True
    button(a[x - 1], cnt + 1)
    return cnt

ans = button(1, 0)

Fixed submission:
import sys
sys.setrecursionlimit(200000)
n = int(input())
a = [int(input()) for i in range(n)]

switch = [False] * (n + 1)
def button(x,cnt):
    if switch[x]:
        print(-1)
        return -1
    if x == 2:
        print(cnt)
        return
    switch[x] = True
    button(a[x - 1], cnt + 1)
    return cnt

ans = button(1, 0)

Buggy python submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10000)
n = int(input())
a = [int(input()) for i in range(n)]

switch = [False] * (n + 1)
def button(x,cnt):
    if switch[x]:
        print(-1)
        return -1
    if x == 2:
        print(cnt)
        return
    switch[x] = True
    button(a[x - 1], cnt + 1)
    return cnt

ans = button(1, 0)

Fixed submission:
import sys
sys.setrecursionlimit(200000)
n = int(input())
a = [int(input()) for i in range(n)]

switch = [False] * (n + 1)
def button(x,cnt):
    if switch[x]:
        print(-1)
        return -1
    if x == 2:
        print(cnt)
        return
    switch[x] = True
    button(a[x - 1], cnt + 1)
    return cnt

ans = button(1, 0)

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = [int(input()) for i in range(n)]

switch = [False] * (n + 1)
def button(x,cnt):
    if switch[x]:
        print(-1)
        return -1
    if x == 2:
        print(cnt)
        return
    switch[x] = True
    button(a[x - 1], cnt + 1)
    return cnt

ans = button(1, 0)

Fixed submission:
import sys
sys.setrecursionlimit(200000)
n = int(input())
a = [int(input()) for i in range(n)]

switch = [False] * (n + 1)
def button(x,cnt):
    if switch[x]:
        print(-1)
        return -1
    if x == 2:
        print(cnt)
        return
    switch[x] = True
    button(a[x - 1], cnt + 1)
    return cnt

ans = button(1, 0)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = [int(input()) for i in range(n)]

ans = 0
for i in range(2 ** n):
    switch = [0] * n
    for j in range(n):
        if((i >> j) & 1):
            switch[j] = 1
    
    sub = 0
    for k in range(n):
        if switch[k] == 1:
            sub += s[k]
    if sub % 10 != 0:
        ans = max(ans, sub)

print(ans)

Fixed submission:
n = int(input())
s = [int(input()) for i in range(n)]

ans = 0
sub = sum(s)
if sub % 10 != 0:
    print(sub)
else:
    l = []
    for i in range(n):
        if s[i] % 10 != 0:
            l.append(s[i])
    l.sort()
    for j in l:
        sub -= j
        if sub % 10 != 0:
            break
    
    if sub % 10 == 0:
        print("0")
    else:
        print(sub)
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
graph = {i: [] for i in range(1, m + 1)}
for _ in range(m):
    u, v = map(int, input().split())
    graph[u].append(v)
    graph[v].append(u)

def dfs(i):
    ret = 0
    if all(han):
        return 1
    for j in range(1, n + 1):
        if han[j] == False and j in graph[i]:
            han[j] = True
            ret += dfs(j)
            han[j] = False
    return ret

han = [False] * (n + 1)
han[0] = True
han[1] = True
ans = dfs(1)
    
print(ans)

Fixed submission:
n, m = map(int, input().split())
graph = {i: [] for i in range(1, n + 1)}
for _ in range(m):
    u, v = map(int, input().split())
    graph[u].append(v)
    graph[v].append(u)

def dfs(i):
    ret = 0
    if all(han):
        return 1
    for j in range(1, n + 1):
        if han[j] == False and j in graph[i]:
            han[j] = True
            ret += dfs(j)
            han[j] = False
    return ret

han = [False] * (n + 1)
han[0] = True
han[1] = True
ans = dfs(1)
    
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
def gcd(a,b):
	if b==0:
		return a
	else:
		return gcd(b,a%b)

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

n=int(input())
a=[int(i) for i in input().split()]
tmp=1
for i in a:
	tmp=lcm(i,tmp)
mod=1000000007
ans=0
for i in a:
	ans=(ans+tmp//i)%mod
print(ans)

Fixed submission:
def gcd(a,b):
	if b==0:
		return a
	else:
		return gcd(b,a%b)

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

n=int(input())
a=[int(i) for i in input().split()]
tmp=1
for i in a:
	tmp=lcm(i,tmp)
mod=1000000007
print(sum(tmp//i for i in a)%mod)

Buggy python submission (verdict: Runtime Error):
def gcd(a,b):
	if b==0:
		return a
	else:
		return gcd(b,a%b)

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

n=int(input())
a=[int(i) for i in input().split()]
tmp=1
for i in a:
	tmp=lcm(i,tmp)
mod=1e9+7
print(int(sum(tmp//i for i in a)%mod))


Fixed submission:
def gcd(a,b):
	if b==0:
		return a
	else:
		return gcd(b,a%b)

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

n=int(input())
a=[int(i) for i in input().split()]
tmp=1
for i in a:
	tmp=lcm(i,tmp)
mod=1000000007
print(sum(tmp//i for i in a)%mod)

Buggy python submission (verdict: Runtime Error):
def gcd(a,b):
	if b==0:
		return a
	else:
		return gcd(b,a%b)

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

n=int(input())
a=[int(i) for i in input().split()]
tmp=1
for i in a:
	tmp=lcm(i,tmp)
mod=1e9+7
ans=int(0)
for i in a:
	ans=(ans+tmp//i)%mod
print(int(ans))

Fixed submission:
def gcd(a,b):
	if b==0:
		return a
	else:
		return gcd(b,a%b)

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

n=int(input())
a=[int(i) for i in input().split()]
tmp=1
for i in a:
	tmp=lcm(i,tmp)
mod=1000000007
print(sum(tmp//i for i in a)%mod)

Buggy python submission (verdict: Runtime Error):
def gcd(a,b):
	if b==0:
		return a
	else:
		return gcd(b,a%b)

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

n=int(input())
a=[int(i) for i in input().split()]
tmp=1
for i in a:
	tmp=lcm(i,tmp)
mod=1e9+7
ans=int(0)
for i in a:
	ans=(ans+tmp/i)%mod
print(int(ans))









Fixed submission:
def gcd(a,b):
	if b==0:
		return a
	else:
		return gcd(b,a%b)

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

n=int(input())
a=[int(i) for i in input().split()]
tmp=1
for i in a:
	tmp=lcm(i,tmp)
mod=1000000007
print(sum(tmp//i for i in a)%mod)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
x = list(map(int, input().split()))
t = 1
for num in x:
    t = t * num

if (t > 10 ** 18): 
    print(-1)
else:
    print(t)

Fixed submission:
import sys
input = sys.stdin.readline
N = int(input())
x = sorted(list(map(int, input().split())))
t = 1
for num in x:
    t = t * num
    if t > 10 ** 18:
        print(-1)
        sys.exit()

if (t > 10 ** 18): 
    print(-1)
else:
    print(t)
Buggy python submission (verdict: Runtime Error):
a = list(map(int,input().split()))
plint(a)

Fixed submission:
a = list(map(int,input().split()))
b = [0, 0, 0, 0]

b[0] = a[0]*a[2]
b[1] = a[0]*a[3]
b[2] = a[1]*a[2]
b[3] = a[1]*a[3]

b.sort()

print(b[3])
Buggy python submission (verdict: Time Limit Exceeded):
n =int(input())
a = list(map(int, input().split()))
b = 1
for i in range(0,n):
  b *= a[i]
if b > 10**18:
  print(-1)
else:
  print(b)

Fixed submission:
n =int(input())
a = list(map(int, input().split()))
b = 1
if 0 in a:
  print(0)
else:
  for i in range(0,n):
    b *= a[i]
    if b > 10**18:
      print(-1)
      break
  if b <= 10**18:
    print(b)
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    n, k = map(int, input().split())
    a = list(map(int, input().split()))

    # ループしているところを見つける
    path = [1]
    current = 0
    looping = False
    loop_st = -1
    loop_ed = -1
    for i in range(n):
        _next = a[current]

        if _next in path:
            loop_st = path.index(_next)
            loop_ed = len(path)
            looping = True
            break
        path.append(_next)
        current = _next-1

    if looping:
        if loop_ed - 1 >= k:
            print(path[k])
        else:
            len_loop = loop_ed - loop_st
            z = (k - loop_st) % len_loop
            print(path[loop_st + z])
    else:
        print(path[k])


main()


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

    # ループしているところを見つける
    path = [1]
    dic = [0] * n
    dic[0] = 1
    current = 0
    looping = False
    loop_st = -1
    loop_ed = -1
    for i in range(n):
        _next = a[current]
        if dic[_next-1] == 1:
            loop_st = path.index(_next)
            loop_ed = len(path)
            looping = True
            break
        dic[_next-1] = 1
        # if _next in path:
        #     loop_st = path.index(_next)
        #     loop_ed = len(path)
        #     looping = True
        #     break
        path.append(_next)
        current = _next-1

    if looping:
        if loop_ed - 1 >= k:
            print(path[k])
        else:
            len_loop = loop_ed - loop_st
            z = (k - loop_st) % len_loop
            print(path[loop_st + z])
    else:
        print(path[k])


main()
Buggy python submission (verdict: Time Limit Exceeded):
import sys

sys.setrecursionlimit(1000000)


def main():
    n, m = map(int, input().split())
    h_list = list(map(int, input().split()))
    ll = []
    for i in range(m):
        a, b = map(int, input().split())
        ll.append((a-1, b-1))

    goods = list(range(n))
    for x, y in ll:
        if h_list[x] == h_list[y]:
            if y in goods:
                goods.remove(y)
            if x in goods:
                goods.remove(x)
        if h_list[x] > h_list[y]:
            if y in goods:
                goods.remove(y)
        else:
            if x in goods:
                goods.remove(x)

    print(len(goods))


main()


Fixed submission:
import sys

sys.setrecursionlimit(1000000)


def main():
    n, m = map(int, input().split())
    h_list = list(map(int, input().split()))
    not_good = set()
    for i in range(m):
        a, b = map(int, input().split())
        # ll.append((a-1, b-1))
        x = a-1
        y = b-1
        hx = h_list[x]
        hy = h_list[y]
        if hx == hy:
            not_good.add(x)
            not_good.add(y)
        elif hx > hy:
            not_good.add(y)
        else:
            not_good.add(x)

    print(n - len(not_good))


main()
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
# 整数の入力
a = int(input())
# # スペース区切りの整数の入力
# b, c = map(int, input().split())
# スペース区切りの整数の入力
strs = input().split()
zyousi = []
for s in strs:
    zyousi.append(int(s))

for i in range(a-1):
    buka_num = zyousi.count(i+1)
    # for j in range(i, a-1):
    #     # print(j)
    #     if i+1 == zyousi[j]:
    #         buka_num += 1
    print(buka_num)
print(0)

Fixed submission:
# -*- coding: utf-8 -*-
# 整数の入力
a = int(input())
# # スペース区切りの整数の入力
# b, c = map(int, input().split())
# スペース区切りの整数の入力
strs = input().split()

buka_nums = []
for i in range(a):
    buka_nums.append(0)

zyousi = []
for s in strs:
    zyousi_n = int(s)
    buka_nums[zyousi_n - 1] += 1

for i in buka_nums:
    print(i)

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
# 整数の入力
a = int(input())
# # スペース区切りの整数の入力
# b, c = map(int, input().split())
# スペース区切りの整数の入力
strs = input().split()
zyousi = []
for s in strs:
    zyousi.append(int(s))

for i in range(a-1):
    buka_num = 0
    for j in range(i, a-1):
        # print(j)
        if i+1 == zyousi[j]:
            buka_num += 1
    print(buka_num)
print(0)

Fixed submission:
# -*- coding: utf-8 -*-
# 整数の入力
a = int(input())
# # スペース区切りの整数の入力
# b, c = map(int, input().split())
# スペース区切りの整数の入力
strs = input().split()

buka_nums = []
for i in range(a):
    buka_nums.append(0)

zyousi = []
for s in strs:
    zyousi_n = int(s)
    buka_nums[zyousi_n - 1] += 1

for i in buka_nums:
    print(i)
Buggy python submission (verdict: Time Limit Exceeded):
def z(z_dic, v: int):
    if v in z_dic:
        return z_dic[v]
    z = 0
    if v == 2:
        z = 1
    elif v > 2:
        z = int(v*(v-1)/2)
    z_dic.setdefault(v, z)
    return z


def main():
    s = input()
    q = int(input())

    reverse = False
    for _ in range(q):
        line_ls = input().split()
        # 長さが1ならTi=1
        if len(line_ls) == 1:
            reverse = not reverse
            continue

        fi = line_ls[1]
        ci = line_ls[2]
        if fi == "1":
            if not reverse:
                s = ci + s
            else:
                s += ci
        else:
            if not reverse:
                s += ci
            else:
                s = ci + s

    if reverse:
        s = s[::-1]

    print(s)




main()


Fixed submission:
def main():
    s = input()
    q = int(input())

    reverse = False
    pre = ""
    post = ""
    for _ in range(q):
        line_ls = input().split()
        # 長さが1ならTi=1
        if len(line_ls) == 1:
            reverse = not reverse
            continue

        fi = line_ls[1]
        ci = line_ls[2]
        if fi == "1":
            if not reverse:
                pre += ci
            else:
                post += ci
        else:
            if not reverse:
                post += ci
            else:
                pre += ci

    if reverse:
        s = s[::-1]
        post = post[::-1]
        print(post + s + pre)
    else:
        pre = pre[::-1]
        print(pre + s + post)


main()
Buggy python submission (verdict: Runtime Error):
def dfs(g: {}, v: int, seen: [], current_color: int):
    seen[v] = current_color
    for (next_v, next_w) in g[v]:
        # next_v が探索済だったらスルー
        if seen[next_v] != -1:
            if current_color == seen[next_v] and next_w % 2 == 1:
                return False
            elif current_color != seen[next_v] and next_w % 2 == 0:
                return False
            continue
        next_color = current_color if next_w % 2 == 0 else 1 - current_color
        # 再帰的に探索
        return dfs(g, next_v, seen, next_color)
    return True


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

    g = {}
    for i in range(n-1):
        u, v, w = map(int, input().split())
        dic_a = g.setdefault(u-1, [])
        dic_a.append((v-1, w))
        dic_b = g.setdefault(v-1, [])
        dic_b.append((u-1, w))
    # -1:not clear, 0:white, 1:black
    seen = [-1] * n

    is_bipartite = True
    for i in range(n):
        if seen[i] != -1:
            continue
        if not dfs(g, i, seen, 0):
            is_bipartite = False
            break

    if is_bipartite:
        for i in range(n):
            print(seen[i])
    else:
        print("is not bipartite")

main()


Fixed submission:
import sys

sys.setrecursionlimit(1000000)


def dfs(g: {}, v: int, seen: [], current_color: int):
    seen[v] = current_color
    for (next_v, next_w) in g[v]:
        # next_v が探索済だったらスルー
        if seen[next_v] != -1:
            if current_color == seen[next_v] and next_w % 2 == 1:
                return False
            elif current_color != seen[next_v] and next_w % 2 == 0:
                return False
            continue
        next_color = current_color if next_w % 2 == 0 else 1 - current_color
        # 再帰的に探索
        if not dfs(g, next_v, seen, next_color):
            return False
    return True


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

    g = {}
    for i in range(n-1):
        u, v, w = map(int, input().split())
        dic_a = g.setdefault(u-1, [])
        dic_a.append((v-1, w))
        dic_b = g.setdefault(v-1, [])
        dic_b.append((u-1, w))
    # -1:not clear, 0:white, 1:black
    seen = [-1] * n

    is_bipartite = True

    for i in range(n):
        if seen[i] != -1:
            continue
        if not dfs(g, i, seen, 0):
            is_bipartite = False
            break

    if is_bipartite:
        for i in range(n):
            print(seen[i])
    else:
        print("is not bipartite")

main()
Buggy python submission (verdict: Runtime Error):
d = int(input())
t = int(input())
s = int(input())
if (t*s >= d):
  print("Yes")
else:
  print("No")

Fixed submission:
D, T, S = map(int, input().split())
if T*S >= D:
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
d = int(input())
t = int(input())
s = int(input())
if t*s >= d:
  print("Yes")
else:
  print("No")

Fixed submission:
D, T, S = map(int, input().split())
if T*S >= D:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Time Limit Exceeded):
n = input()
x = list(map(int,input().split()))
sum = 1
for i in x:
    sum = sum * i


if sum > 10**18:
    print(-1)
else:
    print(sum)

Fixed submission:
n = input()
x = list(map(int,input().split()))
x.sort()
sum = 1
done = False



for i in x:

    # if 0 sum must be 0
    if i == 0:
        sum = 0
        break

    sum = sum * i

    if sum > 10**18:
        break

    



if sum > 10**18:
    print(-1)
else:
    print(sum)
Buggy python submission (verdict: Runtime Error):
x  = input()


if x[-1] == "3":
    print("bon")
elif x[-1] = "0" or x[-1] = "1" or x[-1] = "6" or x[-1] = "8":
    print("pon")
else:
    print("hon")   

Fixed submission:
x  = input()


if x[-1] == "3":
    print("bon")
elif x[-1] == "0" or x[-1] =="1" or x[-1] == "6" or x[-1] == "8":
    print("pon")
else:
    print("hon")
Buggy python submission (verdict: Runtime Error):
k = int(input())
s = input()

if k > s:
  print(s[0:k+1] + "...")
else:
  print(s)



Fixed submission:
k = int(input())
s = input()
 
if k < len(s):
  print(s[0:k] + "...")
else:
  print(s)
Buggy python submission (verdict: Runtime Error):
x=int(input())
print(!x)

Fixed submission:
x=int(input())
if x==0: print (1)
else:    print (0)
Buggy python submission (verdict: Runtime Error):
def gcd(m, n):
    x = max(m, n)
    y = min(m, n)
    if x%y == 0:
      	return y
    else:
      	while x%y!=0:
      	    z =	x%y
      	    x =	y
      	    y =	z
	else:
      	    return z

def lcm(m, n):
    return int(m * n/gcd(m, n))

AB=list(map(int, input().split()))

print(lcm(AB[0],AB[1]))

Fixed submission:
def gcd(m, n):
    x = max(m, n)
    y = min(m, n)
    if x%y == 0:
      	return y
    else:
      	while x%y!=0:
      	    z =	x%y
      	    x =	y
      	    y =	z
      	else:
      	    return z

def lcm(m, n):
    return int(m * n/gcd(m, n))

AB=list(map(int, input().split()))

print(lcm(AB[0],AB[1]))

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

AB=list(map(int, input().split()))

print((AB[0]*AB[1])//math.gcd(AB[0],AB[1]))

Fixed submission:
def gcd(m, n):
    x = max(m, n)
    y = min(m, n)
    if x%y == 0:
      	return y
    else:
      	while x%y!=0:
      	    z =	x%y
      	    x =	y
      	    y =	z
      	else:
      	    return z

def lcm(m, n):
    return int(m * n/gcd(m, n))

AB=list(map(int, input().split()))

print(lcm(AB[0],AB[1]))
Buggy python submission (verdict: Runtime Error):
N=int(input())
H=list(map(int, input().split()))

can_move = 0
move = 0

for i in range(N):
    if i == N-1:
        break
    elif H[i] >= H[i+1]:
        move += 1
        if can_move <= move:
            can_move = move
    else:
        move = 0

print(can_move)

Fixed submission:
i = input()
j = input()
cnt = 0
for k in range(3):
    if i[k]==j[k]:
       cnt+=1

print(cnt)