Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n=int(input())
t=list(map(int,input().split()))
m=int(input())
p,x=[],[]
for _ in range(m):
  _p,_x=map(int,input().split())
  p.append(_p)
  x.append(_x)
s=sum(t)
for i in range(m):
  print(s-t[p[i]-1]+x[p[i]-1])


Fixed submission:
n=int(input())
t=list(map(int,input().split()))
m=int(input())
p,x=[],[]
for _ in range(m):
  _p,_x=map(int,input().split())
  p.append(_p-1)
  x.append(_x)
s=sum(t)
for i in range(m):
  print(s-t[p[i]]+x[i])

Buggy python submission (verdict: Runtime Error):
n=int(input())
t=list(map(int,input().split()))
m=int(input())
p,x=[],[]
for _ in range(m):
  _p,_x=map(int,input().split())
  p.append(_p)
  x.append(_x)
s=sum(t)
for i in range(m):
  print(s-t[p[i]]+x[p[i]])


Fixed submission:
n=int(input())
t=list(map(int,input().split()))
m=int(input())
p,x=[],[]
for _ in range(m):
  _p,_x=map(int,input().split())
  p.append(_p-1)
  x.append(_x)
s=sum(t)
for i in range(m):
  print(s-t[p[i]]+x[i])

Buggy python submission (verdict: Runtime Error):
n=int(input())
t=list(map(int,input().split()))
m=int(input())
p,x=[],[]
for _ in range(m):
  _p,_x=map(int,input().split())
  p.append(_p)
  x.append(_x)
s=sum(t)
ans=s
for i in range(m):
  ans=min(ans,s-t[p[i]]+x[p[i]])
print(ans)


Fixed submission:
n=int(input())
t=list(map(int,input().split()))
m=int(input())
p,x=[],[]
for _ in range(m):
  _p,_x=map(int,input().split())
  p.append(_p-1)
  x.append(_x)
s=sum(t)
for i in range(m):
  print(s-t[p[i]]+x[i])

Buggy python submission (verdict: Runtime Error):
n=int(input())
t=list(map(int,input().split()))
m=int(input())
p,x=[],[]
for _ in range(m):
  _p,_x=map(int,input().split())
  p.append(_p)
  x.append(_x)
s=sum(t)
ans=s
for i in range(m):
  ans=min(ans,s-t[p[i]]+x[p[i]])
print(ans)

Fixed submission:
n=int(input())
t=list(map(int,input().split()))
m=int(input())
p,x=[],[]
for _ in range(m):
  _p,_x=map(int,input().split())
  p.append(_p-1)
  x.append(_x)
s=sum(t)
for i in range(m):
  print(s-t[p[i]]+x[i])
Buggy python submission (verdict: Runtime Error):
W, H, N = map(int, input().split())
x_b, x_u, y_l, y_r = 0, H, 0, W
for _ in range(N):
  x, y, a = map(int, input().split())
  if a == 1:
    x_l = max(x_l, x)
  elif a == 2:
    x_r = min(x_r, x)
  elif a == 3:
    y_b = max(y_b, y)
  else:
    y_u = min(y_u, y)
print((x_r - x_l) * (y_u - y_b))
  

Fixed submission:
W, H, N = map(int, input().split())
x_l, x_r, y_b, y_u = 0, W, 0, H
for _ in range(N):
  x, y, a = map(int, input().split())
  if a == 1:
    x_l = max(x_l, x)
  elif a == 2:
    x_r = min(x_r, x)
  elif a == 3:
    y_b = max(y_b, y)
  else:
    y_u = min(y_u, y)
print(max(x_r - x_l, 0) * max(y_u - y_b, 0))
Buggy python submission (verdict: Runtime Error):
A = list(input())
B = list(input())
C = list(input())
next = A.pop(0)
while 1:
  if next == 'a':
    next = A.pop(0)
  elif next == 'b':
    next = B.pop(0)
  else:
    next = C.pop(0)
  if len(A) == 0:
    print("A")
    break
  elif len(B) == 0:
    print("B")
    break
  elif len(C) == 0:
    print("C")
    break
    
          

Fixed submission:
A = list(input())
B = list(input())
C = list(input())
next = A.pop(0)
while 1:
  if next == 'a':
    if len(A) == 0:
      print("A")
      break
    next = A.pop(0)
  elif next == 'b':
    if len(B) == 0:
      print("B")
      break
    next = B.pop(0)
  else:
    if len(C) == 0:
      print("C")
      break
    next = C.pop(0)
Buggy python submission (verdict: Time Limit Exceeded):
from copy import deepcopy
N, A = map(int, input().split())
x = list(map(int, input().split()))
dp = [[0] * (A*N+1) for i in range(N+1)]
dp[0][0] = 1
for i in range(N):
    _x = x[i]
    dpc = deepcopy(dp)
    for j in range(i+1):
        for a in range(A*N+1):
            if a >= _x:
                dp[j+1][a] += dpc[j][a-_x]
ans = 0
for i in range(1, N+1):
    ans += dp[i][i*A]
print(ans)


Fixed submission:
from copy import deepcopy
N, A = map(int, input().split())
x = list(map(int, input().split()))
dp = [[0] * (A*N+1) for i in range(N+1)]
dp[0][0] = 1
for i in range(N):
    _x = x[i]
    dpc = deepcopy(dp)
    for j in range(i+1):
        for a in range(A*N+1):
            if a >= _x:
                dp[j+1][a] += dpc[j][a-_x]
ans = 0
for i in range(1, N+1):
    ans += dp[i][i*A]
print(ans)
Buggy python submission (verdict: Runtime Error):
S = set(input())
n = 'N' in S
s = 'S' in S
e = 'E' in S
w = 'W' in S
if n^s or e^w:
    print('No')
else:
    print('Yes')

n = int(input())
l = list(map(int, input().split()))
l.sort()
print(sum([l[i] for i in range(2*n) if i%2==0]))

Fixed submission:
S = set(input())
n = 'N' in S
s = 'S' in S
e = 'E' in S
w = 'W' in S
if n^s or e^w:
    print('No')
else:
    print('Yes')
Buggy python submission (verdict: Runtime Error):
a=str(input())
b=str(input())

ans=[]
ans.append(len(b))
for i in range(len(a)-len(b)+1):
    dif=0
    k=a.find(b[i])
    for j in range(len(b)):
        if a[i+j]!=b[j]:
            dif+=1
            ans.append(dif)
print(min(ans))

Fixed submission:
D,T,S=map(int,input().split())
if D/S<=T:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
n=int(input())
s=str(n)
array = list(map(int,s))
if array%9==0:
    print("Yes")
else:
    print("No")

Fixed submission:
n=int(input())
s=str(n)
array = list(map(int,s))
if sum(array)%9==0:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
n=int(input())
str(n)
array = list(map(int,s))
if array%9==0:
    print("Yes")
else:
    print("No")

Fixed submission:
n=int(input())
s=str(n)
array = list(map(int,s))
if sum(array)%9==0:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
nums=input().split()
t=int(nums[1])/int(nums[3])
if t<=int(nums[2]):
  print("Yes")
else:
  print("No")


Fixed submission:
nums=input().split()
t=int(nums[0])/int(nums[2])
if t<=int(nums[1]):
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
nums=input().split()
t=int(nums[1])/int(nums[3])
if t<int(nums[2]):
  print("Yes")
else:
  print("No")


Fixed submission:
nums=input().split()
t=int(nums[0])/int(nums[2])
if t<=int(nums[1]):
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
nums=input().split()
t=int(nums[1])/int(nums[2])
if t<int(nums[3]):
  print("Yes")
else:
  print("No")

Fixed submission:
nums=input().split()
t=int(nums[0])/int(nums[2])
if t<=int(nums[1]):
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
init=input().split()
num=init[0]
snacks=init[1]
ceck=[]
for i in range(snacks):
  sNum=input()
  if sNum>1:
    whos=input().split()
    for j in range(sNum):
      check.append()=whos[j]
  else:
    who=input()
    check.append()=who

for i in range(num):
  if not str(num[i]) in check:
    print(num)

    
    
  

Fixed submission:
init=input().split()
num=int(init[0])
snacks=int(init[1])
check=[]
 
for i in range(snacks):
  sNum=int(input())
  if sNum>1:
    whos=input().split()
    for j in range(sNum):
      check.append(whos[j])
  else:
    who=input()
    check.append(who)
   
count=0
for i in range(1,num+1):
  if str(i) not in check:
    count=count+1
print(count)
Buggy python submission (verdict: Runtime Error):
import numpy as np
N = int(input())
for i in range(1, N+1):
    count = 0
    for j in range(1, int(np.sqrt(i))+2):
        for k in range(j, int(np.sqrt(i))+2):
            for l in range(k, int(np.sqrt(i))+2):
                n = j*j + k*k + l*l + j*k + k*l + l*j
                #print(i, j, k, l)
                if n == i:
                    if j == k == l:
                        count += 1
                    elif j==k or k==l or l==j:
                        count += 3
                    else:
                        count += 6
    print(count)

Fixed submission:
L, R, d = map(int, input().split())
count_1 = (R - L) // d 
count_2 = 0
if L % d == 0 or R % d == 0:
    count_2 += 1
ans = count_1 + count_2
print(ans)
Buggy python submission (verdict: Runtime Error):
from fractions import Fraction
a, b = input().split()
b = Fraction(b)
ans = Fraction(a*b)
ans = ans // 1
print(int(ans))

Fixed submission:
from fractions import Fraction
a, b = input().split()
A = int(a)
B = Fraction(b)
ans = A*B
ans = ans // 1
print(int(ans))
Buggy python submission (verdict: Runtime Error):
h=list(map(int,input().split()))
x=[[] for _ in range(n+1)]
for i in range(m):
  a,b=map(int,input().split())
  x[a].append(h[b-1])
  x[b].append(h[a-1])
count=0
for j in range(1,n+1):
  if x[j]==[]:
    count+=1
  else:
    if h[j-1]>max(x[j]):
      count+=1
print(count)
  

Fixed submission:
n,m=map(int,input().split())
h=list(map(int,input().split()))
x=[[] for _ in range(n+1)]
for i in range(m):
  a,b=map(int,input().split())
  x[a].append(h[b-1])
  x[b].append(h[a-1])
count=0
for j in range(1,n+1):
  if x[j]==[]:
    count+=1
  else:
    if h[j-1]>max(x[j]):
      count+=1
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S_list = [input() for i in range(N)]
count = 0
while len(S_list) > 0:
    S_list = [s for s in S_list if s != S_list[0]]
    count += 1
print(count)


Fixed submission:
import collections

N = int(input())
S_list = [input() for i in range(N)]
c = collections.Counter(S_list)
print(len(c))
Buggy python submission (verdict: Runtime Error):
import.math
R = int(input())
print(2*R * math.pi)

Fixed submission:
import numpy as np

R = int(input())
print(2 * R * np.pi)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A_list = list(map(int, input().split()))
ans_list = [0] * (N + 1)
for i in range(N-1):
    ans_list[A_list[i]] += 1
for j in range(N+1):
    print(ans_list[j + 1])


Fixed submission:
N = int(input())
A_list = list(map(int, input().split()))
ans_list = [0] * (N + 1)
for i in range(N-1):
    ans_list[A_list[i]] += 1
for j in range(N):
    print(ans_list[j + 1])

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

N = int(input())
A_list = list(map(int, input().split()))
A_np_list = np.array(A_list)
for i in range(1, N):
    print(np.count_nonzero(A_np_list == i))
print(0)


Fixed submission:
N = int(input())
A_list = list(map(int, input().split()))
ans_list = [0] * (N + 1)
for i in range(N-1):
    ans_list[A_list[i]] += 1
for j in range(N):
    print(ans_list[j + 1])

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A_list = list(map(int, input().split()))
for i in range(1, N):
    print(A_list.count(i))
print(0)


Fixed submission:
N = int(input())
A_list = list(map(int, input().split()))
ans_list = [0] * (N + 1)
for i in range(N-1):
    ans_list[A_list[i]] += 1
for j in range(N):
    print(ans_list[j + 1])

Buggy python submission (verdict: Runtime Error):
N = int(input())
A_list = list(map(int, input().split()))
B_list = [0]* n
for i in range(1, N):
    print(A_list.count(i))
print(0)


Fixed submission:
N = int(input())
A_list = list(map(int, input().split()))
ans_list = [0] * (N + 1)
for i in range(N-1):
    ans_list[A_list[i]] += 1
for j in range(N):
    print(ans_list[j + 1])

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A_list = list(map(int, input().split()))
B_list = []
for i in range(1, N):
    B_i = A_list.count(i)
    print(B_i)
print(0)


Fixed submission:
N = int(input())
A_list = list(map(int, input().split()))
ans_list = [0] * (N + 1)
for i in range(N-1):
    ans_list[A_list[i]] += 1
for j in range(N):
    print(ans_list[j + 1])

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A_list = list(map(int, input().split()))
B_list = []
for i in range(1, N):
    B_i = A_list.count(i)
    print(B_i)
print(0)


Fixed submission:
N = int(input())
A_list = list(map(int, input().split()))
ans_list = [0] * (N + 1)
for i in range(N-1):
    ans_list[A_list[i]] += 1
for j in range(N):
    print(ans_list[j + 1])
Buggy python submission (verdict: Time Limit Exceeded):
from math import gcd

def gcd_3(a, b, c):
    g = gcd(a, b)
    return gcd(g, c)

K = int(input())
ans = 0

for i in range(1, K+1):
    for j in range(1, K+1):
        for k in range(1, K+1):
            ans += gcd_3(i, j, k)

print(ans)


Fixed submission:
from math import gcd

def gcd_3(a, b, c):
    g = gcd(a, b)
    return gcd(g, c)

K = int(input())
ans = 0

for i in range(1, K+1):
    for j in range(1, K+1):
        for k in range(1, K+1):
            ans += gcd_3(i, j, k)

print(ans)

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

def gcd(a, b, c):
    g = gcd(a, b)
    return gcd(g, c)

K = int(input())
ans = 0

for i in range(1, K+1):
    for j in range(1, K+1):
        for k in range(1, K+1):
            ans += gcd(i, j, k)

print(ans)


Fixed submission:
from math import gcd

def gcd_3(a, b, c):
    g = gcd(a, b)
    return gcd(g, c)

K = int(input())
ans = 0

for i in range(1, K+1):
    for j in range(1, K+1):
        for k in range(1, K+1):
            ans += gcd_3(i, j, k)

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
def gcd(a, b):
    if a < b:
        a, b = b, a
    while b:
        a, b = b, a%b
    return a

def gcd_3(a, b, c):
    g = gcd(a, b)
    return gcd(g, c)

K = int(input())
ans = 0

for i in range(1, K+1):
    for j in range(1, K+1):
        for k in range(1, K+1):
            ans += gcd_3(i, j, k)

print(ans)


Fixed submission:
from math import gcd

def gcd_3(a, b, c):
    g = gcd(a, b)
    return gcd(g, c)

K = int(input())
ans = 0

for i in range(1, K+1):
    for j in range(1, K+1):
        for k in range(1, K+1):
            ans += gcd_3(i, j, k)

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import math

def gcd(a, b, c):
    g = math.gcd(a, b)
    return math.gcd(g, c)

K = int(input())
sum = 0

for i in range(1, K+1):
    for j in range(1, K+1):
        for k in range(1, K+1):
            sum += gcd(i, j, k)
print(sum)


Fixed submission:
from math import gcd

def gcd_3(a, b, c):
    g = gcd(a, b)
    return gcd(g, c)

K = int(input())
ans = 0

for i in range(1, K+1):
    for j in range(1, K+1):
        for k in range(1, K+1):
            ans += gcd_3(i, j, k)

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
def abs(n, k):
    if n - k >= 0:
        return n-k
    else:
        return k-n

N, K = map(int, input().split())
while N > abs(N, K):
    N, K = abs(N, K), K
print(N)


Fixed submission:
N, K = map(int, input().split())
r = N % K
print(min(r, K-r))

Buggy python submission (verdict: Runtime Error):
def abs(n, k):
    if n - k >= 0:
        return n-k
    else:
        return k-n
        
N, K = map(int, input().split())
while N > abs(N-K):
    N, K = abs(N-K), K
print(N)


Fixed submission:
N, K = map(int, input().split())
r = N % K
print(min(r, K-r))

Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
while N > abs(N-K):
    N, K = abs(N-K), K
print(N)


Fixed submission:
N, K = map(int, input().split())
r = N % K
print(min(r, K-r))
Buggy python submission (verdict: Runtime Error):
N = int(input())
P_list = list(map(int, input().split()))
count_i = 1
for i in range(1, N):
    if P_list[i] <= min(P_list[:i+1]):
        count_i += 1
print(count_i)


Fixed submission:
N, M = map(int, input().split())
if N == M:
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
N = int(input())
P_list = list(map(int, input().split()))
count_i = 0
for i in range(N):
    if P_list[i] <= min(P_list[:i+1]):
        count_i += 1
print(count_i)


Fixed submission:
N, M = map(int, input().split())
if N == M:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
import math
a = (int)(input())
b = int(input())
h = int(input())
m = int(input())
t1 = h/6 * math.pi
t2 = m/30 * math.pi
dellt = abs(t2 - t1)
ans = b*b + a*a - 2*a*b*math.cos(dellt)
print(ans**0.5)


Fixed submission:
import math
s = input()
a,b,h,m = s.split(' ')
a = int(a)
b = (int)(b)
h = int(h)
m = int(m)
t1 = h/6 * math.pi + math.pi/6*m/60
t2 = m/30 * math.pi
dellt = abs(t2 - t1)
ans = b*b + a*a - 2*a*b*math.cos(dellt)
print(ans**0.5)

Buggy python submission (verdict: Runtime Error):
import math
a = float(input())
b = float(input())
h = float(input())
m = float(input())
t1 = h/12 * math.PI
t2 = m/60 * math.PI
dellt = abs(t2 - t1)
ans = b*b + a*a - 2*a*b*math.cos(dellt)
print(ans**0.5)

Fixed submission:
import math
s = input()
a,b,h,m = s.split(' ')
a = int(a)
b = (int)(b)
h = int(h)
m = int(m)
t1 = h/6 * math.pi + math.pi/6*m/60
t2 = m/30 * math.pi
dellt = abs(t2 - t1)
ans = b*b + a*a - 2*a*b*math.cos(dellt)
print(ans**0.5)
Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())
N, M = map(int, input().split())
uf = UnionFind(N)
for i in range(M):
    a, b = map(int, input().split())
    uf.union(a-1, b-1)
ans = 0
mem = uf.all_group_members()
for k in mem.keys():
    ans = max(ans, len(mem[k]))
print(ans)

Fixed submission:
# coding: utf-8
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        # xの根を探索
        if self.parents[x] < 0:
            return x
        else:
            # 再帰的に根を探索
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        # 2つの木をマージする。
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return
        
        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def are_same(self, x, y):
        # 2つの要素の根が同じかどうかを調べる
        return self.find(x) == self.find(y)

    def members(self, x):
        # xと同じ根の要素をリストで出力
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == self.n]

    def roots(self):
        # 根である要素をリストで出力
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return "\n".join("{} {}".format(r, self.members(r)) for r in self.roots())

N, M = map(int, input().split())
uf = UnionFind(N)
for i in range(M):
    a, b = map(int, input().split())
    uf.union(a-1, b-1)
ans = 0
for v in uf.parents:
    if v < 0:
        ans = max(ans, abs(v))
print(ans)
Buggy python submission (verdict: Runtime Error):
import streams, sequtils, strutils, algorithm, math, future, sets, tables, hashes
proc `ceilDiv`*[T](x, y: T): T = x div y + ord(x mod y != 0)
proc `//=`*(x: var SomeInteger; y: SomeInteger) = x = x div y
proc `%=`*(x: var SomeInteger; y: SomeInteger) = x = x mod y
var
    X = stdin.readLine.split.map(parseInt)
    ans:int
for i in 0..4:
    if X[i] == 0:
        ans = i.int + 1
echo ans

Fixed submission:
# coding: utf-8
X = list(map(int, input().split()))
for i in range(5):
    if X[i] == 0:
        ans = i + 1
print(ans)
Buggy python submission (verdict: Runtime Error):
# coding: utf-8
N = int(input())
li = [True for _ in range(0, 2*10**5 + 1)]
A = list(map(int, input().split()))
A.sort()
ans = 0
for i in range(N):
    if li[A[i]]:
        ans += 1
    for j in range(A[i], 2*10**5 + 1, A[i]):
        li[j] = False
ans -= len(A) - len(set(A))
print(max(0, ans))

Fixed submission:
# coding: utf-8
N = int(input())
li = [True for _ in range(0, 10**6 + 1)]
A = list(map(int, input().split()))
A.sort()
used = {}
for i in range(N):
    if A[i] not in used.keys():
        used[A[i]] = 1
    else:
        used[A[i]] += 1
ans = 0
for k in used.keys():
    if used[k] > 1:
        for j in range(k, 10**6 + 1, k):
            li[j] = False
for i in range(N):
    if li[A[i]] and used[A[i]] == 1:
        ans += 1
    else:
        continue
    for j in range(A[i], 10**6 + 1, A[i]):
        li[j] = False
print(ans)
Buggy python submission (verdict: Runtime Error):
import streams, sequtils, strutils, algorithm, math, future, sets, tables, hashes
proc `ceilDiv`*[T](x, y: T): T = x div y + ord(x mod y != 0)
proc `//=`*(x: var SomeInteger; y: SomeInteger) = x = x div y
proc `%=`*(x: var SomeInteger; y: SomeInteger) = x = x mod y


var
    N = stdin.readLine
    s = parseInt($N[^1])
if s in [2,3,4,7,9]:
    echo "hon"
elif s in [0,1,6,8]:
    echo "pon"
else:
    echo "bon"

Fixed submission:
# coding: utf-8
N = input()
if int(N[-1]) in [2,4,5,7,9]:
    print("hon")
elif int(N[-1]) in [0, 1, 6, 8]:
    print("pon")
else:
    print("bon")
Buggy python submission (verdict: Runtime Error):
#coding: utf-8
from math import ceil, floor
X = int(input())
a = 0
a2 = -a
def sign(v):
    if v < 0:
        return -1
    else:
        return 1
def counter(a):
    v = abs(a)
    for i in range(1, int(v**0.5)+2):
        if v % i == 0:
            if v == i**5:
                return True
    return False
while True:
    a2 = -a
    b = (a**5 - X)
    b2 = (a2**5 - X)
    if counter(b):
        if a**5 - b == X:
            print(a, int(abs(round(b))**(1/5))*sign(b))
            quit()
    if counter(b2):
        if a2 ** 5 - b2 == X:
            print(a2, int(abs(round(b))**(1/5))*sign(b2))
            quit()
    a += 1


Fixed submission:
#coding: utf-8
N, K = map(int, input().split())
A = [0 for _ in range(N)]
ans = 0
for i in range(K):
    d = int(input())
    tmp = list(map(int, input().split()))
    for j in range(d):
        A[tmp[j]-1] += 1
for i in range(N):
    if A[i] == 0:
        ans += 1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
#coding: utf-8
from math import ceil, floor
X = int(input())
a = floor(X**(1/5))
a2 = -a
while True:
    a2 = -a
    b = (a**5 - X)
    b2 = (a2**5 - X)
    if a**5 - b**5 == X:
        print(a,b)
        exit()
    elif a2**5 - b2**5 == X:
        print(a2, b2)
    a += 1



Fixed submission:
#coding: utf-8
X = int(input())
for a in range(-118, 120, 1):
    for b in range(-118, 120, 1):
        if a ** 5 - b ** 5 == X:
            print(a, b)
            exit()

Buggy python submission (verdict: Time Limit Exceeded):
#coding: utf-8
from math import ceil, floor
X = int(input())
a = floor(X**(1/5))
while True:
    b = (a**5 - X)
    if a**5 - b**5 == X:
        print(a,b)
        exit()
    # if (a**5 - X) < 0:
    #     pass
    # elif int((a**5 - X)**(1/5)) == (a**5 - X)**(1/5):
    #     print(a, int((a**5 - X)**(1/5)))
    #     exit()
    a += 1



Fixed submission:
#coding: utf-8
X = int(input())
for a in range(-118, 120, 1):
    for b in range(-118, 120, 1):
        if a ** 5 - b ** 5 == X:
            print(a, b)
            exit()