Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
word = input()
if(word[-s] == 's'):
	print(word+'es')
else:
	print(word+'s')

Fixed submission:
word = input()
if(word[-1] == 's'):
	print(word+'es')
else:
	print(word+'s')

Buggy python submission (verdict: Runtime Error):
word = input()
	if(word[-s] == 's'):
    	print(word+'es')
    else:
    	print(word+'s')

Fixed submission:
word = input()
if(word[-1] == 's'):
	print(word+'es')
else:
	print(word+'s')

Buggy python submission (verdict: Runtime Error):
word = input()
	if(word[-s] == 's'):
    	print(word+'es')
    else:
    	print(word+'s')

Fixed submission:
word = input()
if(word[-1] == 's'):
	print(word+'es')
else:
	print(word+'s')

Buggy python submission (verdict: Runtime Error):
word = input()
	if(word[-1] == 's'):
  		print(word+'es')
 	else:
      print(word+'s')

Fixed submission:
word = input()
if(word[-1] == 's'):
	print(word+'es')
else:
	print(word+'s')

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
"""
Created on Sat Sep 19 13:14:17 2020

@author: Admin
"""


n,x,m=input().split()
m=int(m)
a=[int(x)]
for i in range(1,int(n)):
    zp=a[i-1]
    z=zp**2
    a.append(z%m)
    
print(sum(a))

Fixed submission:
# -*- coding: utf-8 -*-
"""
Created on Sat Sep 19 13:03:22 2020

@author: Admin
"""

a=input()
if a[-1]=='s':
    print(a+'es')
else:
    print(a+'s')

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

if word[-1] == 's': 
	print(word + 'es')
else:
	print(word + 's')

Fixed submission:
word = input()
 
if word[-1] == 's':
	print(word + 'es')
else:print(word + 's')
Buggy python submission (verdict: Runtime Error):
x = int(input())
print([360*n//x for n in range(1, 500) if 360 % x == 0][0])

Fixed submission:
import math
x=int(input())
print(360//math.gcd(360,x))

Buggy python submission (verdict: Runtime Error):
x = int(input())
print([360*n//x for n in range(1, 1000) if 360 % x == 0][0])

Fixed submission:
import math
x=int(input())
print(360//math.gcd(360,x))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
num_list = list(map(int, input().split()))

ans = 1

for e in num_list:
    ans *= e

if ans > 1000000000000000000:
    print("-1")
else:
    print(ans)


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

ans = 1

for e in num_list:
    if e == 0:
        ans = 0

for e in num_list:
    ans *= e
    if ans > 1000000000000000000:
        ans = -1
        break
    if ans == 0:
        break

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
def factorization(n):
    if n == 1:
        return 1
    arr = 1
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr *= (cnt + 1)

    if temp!=1:
        arr *= 2

    if arr==[]:
        arr *= 2

    return n * arr
n = int(input())
res = 0
for i in range(1, n + 1):
  res += factorization(i)
print(res)

Fixed submission:
n = int(input())
res = 0
for i in range(1, n + 1):
  y = n // i
  res += ((y * (y + 1) * i) // 2)
print(res)
Buggy python submission (verdict: Runtime Error):
import sys
if n == 0:
  print(x)
  sys.exit()
x, n = map(int, input().split())
lst = list(map(int, input().split()))
for i in range(250):
  if x - i not in lst:
    print(x + i)
    sys.exit()
  if x + i not in lst:
    print(x + i)
    sys.exit()

Fixed submission:
import sys
x, n = map(int, input().split())
if n == 0:
  print(x)
  sys.exit()
lst = list(map(int, input().split()))
for i in range(250):
  if x - i not in lst:
    print(x - i)
    sys.exit()
  if x + i not in lst:
    print(x + i)
    sys.exit()

Buggy python submission (verdict: Runtime Error):
import sys
x, n = map(int, input().split())
lst = list(map(int, input().split()))
for i in range(250):
  if x - i not in lst:
    print(x + i)
      sys.exit()
  if x + i not in lst:
      print(x + i)
      sys.exit()

Fixed submission:
import sys
x, n = map(int, input().split())
if n == 0:
  print(x)
  sys.exit()
lst = list(map(int, input().split()))
for i in range(250):
  if x - i not in lst:
    print(x - i)
    sys.exit()
  if x + i not in lst:
    print(x + i)
    sys.exit()
Buggy python submission (verdict: Runtime Error):
n = int(input())
mul = 1
for i in range(n):
  ai = int(input())
  mul = mul * ai
  if mul > 10 ** 18:
    print('-1')
    exit()

Fixed submission:
n = int(input())
lst = list(map(int, input().split()))
mul = 1
thr = 10 ** 18
if 0 in lst:
  print('0')
  exit()
for i in range(n):
  mul = mul * lst[i]
  if mul > thr:
    print('-1')
    exit()
print(mul)
Buggy python submission (verdict: Time Limit Exceeded):
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

ozo = set([-1, 0, 1])
x = int(input())
for j in range(10 ** 7):
  c = x + j ** 5 # プラス
  f = factorization(c)
  if c in ozo:
    print(c, j)
    exit()
  if len(f) == 1 and f[0][1] == 5:
    print(f[0][0], j)
    exit()
  c = x - j ** 5 # マイナス
  if c in ozo:
    print(c, j)
    exit()
  if c < 0:
    c *= -1
    f = factorization(c)
    if len(f) == 1 and f[0][1] == 5:
      print(-f[0][0], -j)
      exit()
  else:
    f = factorization(c)
    if len(f) == 1 and f[0][1] == 5:
      print(f[0][0], -j)
      exit()

Fixed submission:
x = int(input())
for i in range(-150, 150):
  for j in range(-150, 150):
    if i ** 5 - j ** 5 == x:
      print(i, j)
      exit()

Buggy python submission (verdict: Time Limit Exceeded):
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

ozo = set([-1, 0, 1])
x = int(input())
for j in range(10 ** 7):
  c = x + j ** 5 # プラス
  f = factorization(c)
  if c in ozo:
    print(c, j)
    exit()
  if len(f) == 1 and f[0][1] == 5:
    print(f[0][0], j)
    exit()
  c = x - j ** 5 # マイナス
  if c in ozo:
    print(c, j)
    exit()
  if c < 0:
    c *= -1
    f = factorization(c)
    if len(f) == 1 and f[0][1] == 5:
      print(-f[0][0], -j)
      exit()
  else:
    f = factorization(c)
    if len(f) == 1 and f[0][1] == 5:
      print(f[0][0], -j)
      exit()

Fixed submission:
x = int(input())
for i in range(-150, 150):
  for j in range(-150, 150):
    if i ** 5 - j ** 5 == x:
      print(i, j)
      exit()
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
lst1 = list(map(int, input().split()))
for i in range(1, n + 1):
  res = 0
  for j in range(n - 1):
    if lst1[j] == i:
      res += 1
  print(res)

Fixed submission:
n = int(input())
lst1 = list(map(int, input().split()))
reslst = [0] * n
for i in range(n - 1):
  reslst[lst1[i] - 1] += 1
for i in range(n):
  print(reslst[i])
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = input()
cnt = s.count('R') * s.count('G') * s.count('B')
for i in range(n - 1):
  for j in range(i + 1, n):
    try:
      if len(set([s[i], s[j], s[2 * j - i]])) == 3:
        cnt -= 1
    except IndexError:
      pass
print(cnt)

Fixed submission:
n = int(input())
s = input()
cnt = s.count('R') * s.count('G') * s.count('B')
for i in range(n - 1):
  for j in range(i + 1, n):
    if 2 * j - i <= n - 1 and len(set([s[i], s[j], s[2 * j - i]])) == 3:
      cnt -= 1
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
import itertools
n = int(input())
s = input()
itr = itertools.combinations(range(n), 3)
cnt = 0
for tpl in itr:
  if (tpl[2] - tpl[1] != tpl[1] - tpl[0] and 
      len(set([s[tpl[0]], s[tpl[1]], s[tpl[2]]])) == 3):
    cnt += 1
print(cnt)

Fixed submission:
n = int(input())
s = input()
cnt = s.count('R') * s.count('G') * s.count('B')
for i in range(n - 1):
  for j in range(i + 1, n):
    if 2 * j - i <= n - 1 and len(set([s[i], s[j], s[2 * j - i]])) == 3:
      cnt -= 1
print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
s = input()
q = int(input())
for i in range(q):
  z = input()
  if z[0] == '1':
    s = s[::-1]
  elif z[2] == '1':
    s = z[4] + s
  else:
    s = s + z[4]
print(s)

Fixed submission:
from collections import deque
s = input()
q = int(input())
d = deque()
for i in s:
  d.append(i)
rv = 0
lst = [1, 0]
for i in range(q):
  z = input()
  if z[0] == '1':
    rv = lst[rv]
  elif z[2] == '1':
    if rv == 1:
      d.append(z[4])
    else:
      d.appendleft(z[4])
  else:
    if rv == 0:
      d.append(z[4])
    else:
      d.appendleft(z[4])
if rv == 1:
  print(''.join(d)[::-1])
else:
  print(''.join(d))

Buggy python submission (verdict: Time Limit Exceeded):
s = input()
q = int(input())
for i in range(q):
  z = input()
  if z[0] == '1':
    s = s[::-1]
  elif z[2] == '1':
    s = z[4] + s
  else:
    s = s + z[4]
print(s)

Fixed submission:
from collections import deque
s = input()
q = int(input())
d = deque()
for i in s:
  d.append(i)
rv = 0
lst = [1, 0]
for i in range(q):
  z = input()
  if z[0] == '1':
    rv = lst[rv]
  elif z[2] == '1':
    if rv == 1:
      d.append(z[4])
    else:
      d.appendleft(z[4])
  else:
    if rv == 0:
      d.append(z[4])
    else:
      d.appendleft(z[4])
if rv == 1:
  print(''.join(d)[::-1])
else:
  print(''.join(d))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
freq = []
slst = []
sset = set()
for i in range(n):
  temp = input()
  if temp not in sset:
    slst.append(temp)
    sset.add(temp)
    freq.append(0)
  else:
    freq[slst.index(temp)] += 1
fmax = max(freq)
for i in range(len(freq)):
  if freq[i] < fmax:
    sset.discard(slst[i])
mflst = list(sset)
mflst.sort()
for i in range(len(mflst)):
  print(mflst[i])

Fixed submission:
n = int(input())
#freq = []
#slst = []
dic1 = {}
for i in range(n):
  temp = input()
  dic1.setdefault(temp, 0)
  dic1[temp] += 1
fmax = max(dic1.values())
mflst = []
ks = list(dic1.keys())
for i in dic1:
  if dic1[i] == fmax:
    mflst.append(i)
    
mflst.sort()
for i in range(len(mflst)):
  print(mflst[i])

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
freq = []
slst = []
sset = set()
for i in range(n):
  temp = input()
  if temp not in sset:
    slst.append(temp)
    sset.add(temp)
    freq.append(0)
  else:
    freq[slst.index(temp)] += 1
fmax = max(freq)
mflst = []
for i in range(len(freq)):
  if freq[i] == fmax:
    mflst.append(slst[i])
mflst.sort()
for i in range(len(mflst)):
  print(mflst[i])

Fixed submission:
n = int(input())
#freq = []
#slst = []
dic1 = {}
for i in range(n):
  temp = input()
  dic1.setdefault(temp, 0)
  dic1[temp] += 1
fmax = max(dic1.values())
mflst = []
ks = list(dic1.keys())
for i in dic1:
  if dic1[i] == fmax:
    mflst.append(i)
    
mflst.sort()
for i in range(len(mflst)):
  print(mflst[i])

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
freq = []
slst = []
for i in range(n):
  temp = input()
  if temp not in slst:
    slst.append(temp)
    freq.append(0)
  else:
    freq[slst.index(temp)] += 1
fmax = max(freq)
mflst = []
for i in range(len(freq)):
  if freq[i] == fmax:
    mflst.append(slst[i])
mflst.sort()
for i in range(len(mflst)):
  print(mflst[i])

Fixed submission:
n = int(input())
#freq = []
#slst = []
dic1 = {}
for i in range(n):
  temp = input()
  dic1.setdefault(temp, 0)
  dic1[temp] += 1
fmax = max(dic1.values())
mflst = []
ks = list(dic1.keys())
for i in dic1:
  if dic1[i] == fmax:
    mflst.append(i)
    
mflst.sort()
for i in range(len(mflst)):
  print(mflst[i])
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
lst = [0] * n
for i in range(n):
  s = input()
  for j in s:
    lst[i] += (12 ** (ord(j) - ord('a') + 1))
res = 0
for i in range(n - 1):
  for j in range(i + 1, n):
    if lst[i] == lst[j]:
      res += 1
print(res)

Fixed submission:
n = int(input())
dic = {}
for i in range(n):
  temp = 0
  s = input()
  for j in s:
    temp += (12 ** (ord(j) - ord('a') + 1))
  dic.setdefault(temp, 0)
  dic[temp] += 1
#print(dic)
res = 0
for i in dic:
  if dic[i] >= 2:
    res += ((dic[i] * (dic[i] - 1)) // 2)
print(res)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
diclst = [{} for i in range(n)]
for i in range(n):
  s = input()
  for j in s:
    diclst[i].setdefault(j, 0)
    diclst[i][j] += 1
res = 0
for i in range(n - 1):
  for j in range(i + 1, n):
    if diclst[i] == diclst[j]:
      res += 1
print(res)

Fixed submission:
n = int(input())
dic = {}
for i in range(n):
  temp = 0
  s = input()
  for j in s:
    temp += (12 ** (ord(j) - ord('a') + 1))
  dic.setdefault(temp, 0)
  dic[temp] += 1
#print(dic)
res = 0
for i in dic:
  if dic[i] >= 2:
    res += ((dic[i] * (dic[i] - 1)) // 2)
print(res)
Buggy python submission (verdict: Runtime Error):
s = input()
k = int(input())
for i in range(len(s)):
  if s[i] != '1':
    idx = i
    num = s[i]
    break
if idx >= k:
  print(1)
else:
  print(num)

Fixed submission:
s = input()
k = int(input())
if s == '1' * len(s):
  print(1)
  exit()
for i in range(len(s)):
  if s[i] != '1':
    idx = i
    num = s[i]
    break
if idx >= k:
  print(1)
else:
  print(num)
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input(.split()))
c = a * b
def f(n):
  if n % 2 == 0:
    return 'Even'
  else:
    return 'Odd'
f(c)

Fixed submission:
a, b = map(int, input().split())
c = int(a * b)
def f(n):
  if n % 2 == 0:
    return 'Even'
  else:
    return 'Odd'
print(f(c))

Buggy python submission (verdict: Runtime Error):
b = map(int, input().split())
a = b[0] * b[1]
	if a % 2 == 0:
	  print('Even')
	else:
	  print('Odd')

Fixed submission:
a, b = map(int, input().split())
c = int(a * b)
def f(n):
  if n % 2 == 0:
    return 'Even'
  else:
    return 'Odd'
print(f(c))
Buggy python submission (verdict: Runtime Error):
import sys
n = int(input())
lst = list(map(int, input().split()))
res = 0
for p in range(200):
  for i in range(n):
    if lst[i] % 2 == 1:
      print(res)
      sys.exit()
  lst = [int(j / 2) for j in lst]
  res += 1

Fixed submission:
lst = [int(i) for i in str(input())]
print(sum(lst))

Buggy python submission (verdict: Runtime Error):
import sys
n = int(input())
lst = list(map(int, input().split()))
res = 0
while True:
  for i in range(n):
    if lst[i] % 2 == 1:
      print(res)
      sys.exit()
  lst = [int(j / 2) for j in lst]
  res += 1

Fixed submission:
lst = [int(i) for i in str(input())]
print(sum(lst))

Buggy python submission (verdict: Runtime Error):
n = int(input())
lst = map(str, input().split())
res = 0
def f(l):
  while True:
    for i in l:
      if int(i[-1]) % 2 == 1:
        return res
    l = [str(int(j) / 2) for j in l]
    res += 1
f(lst)

Fixed submission:
lst = [int(i) for i in str(input())]
print(sum(lst))
Buggy python submission (verdict: Runtime Error):
n = int(input())
lst = map(str, input().split())
res = 0
while True:
  for i in lst:
    if int(i[-1]) % 2 == 1:
      return res
  lst = [int(j) / 2 for j in lst]
  res += 1

Fixed submission:
import sys
n = int(input())
lst = list(map(int, input().split()))
res = 0
for p in range(200):
  for i in range(n):
    if lst[i] % 2 == 1:
      print(res)
      sys.exit()
  lst = [int(j / 2) for j in lst]
  res += 1
Buggy python submission (verdict: Time Limit Exceeded):
k, s = map(int, input().split())
res = 0
for x in range(k + 1):
  for y in range(x, k + 1):
    for z in range(y, k + 1):
      if x + y + z == s:
        if x == y and y == z:
          res += 1
        elif x == y or y == z or z == x:
          res += 3
        else:
          res += 6
print(res)

Fixed submission:
k, s = map(int, input().split())
res = 0
for x in range(k + 1):
  for y in range(k + 1):
    z = s - x - y
    if 0 <= z <= k:
      res += 1
print(res)

Buggy python submission (verdict: Time Limit Exceeded):
k, s = map(int, input().split())
res = 0
for x in range(k + 1):
  for y in range(x, k + 1):
    for z in range(y, k + 1):
      if x + y + z == s:
        if x == y and y == z:
          res += 1
        elif x == y or y == z or z == x:
          res += 3
        else:
          res += 6
print(res)

Fixed submission:
k, s = map(int, input().split())
res = 0
for x in range(k + 1):
  for y in range(k + 1):
    z = s - x - y
    if 0 <= z <= k:
      res += 1
print(res)
Buggy python submission (verdict: Time Limit Exceeded):
import itertools
import math
from functools import reduce

n, k = map(int, input().split())
mod = 10 ** 9 + 7

cnt = 0
for i in range(k, n + 1):
    sum_list = set()
    for pattern in list(itertools.combinations(range(n + 1), i)):
        result = reduce(lambda sum, val : sum + val, pattern, 0)
        sum_list.add(result)
    cnt += len(sum_list)

print(cnt + 1)

Fixed submission:
import itertools
import math
from functools import reduce

n, k = map(int, input().split())

pattern = 0

for i in range(k, n + 2):
    min = i * (0 + i - 1) // 2
    max = i * (n + n - i + 1) // 2
    pattern += max - min + 1
    
pattern %= 10 ** 9 + 7
    
print(pattern)
Buggy python submission (verdict: Runtime Error):
N=int(input())
lst=[]
for i in range(N):
    lst.append(str(input()))

acn = 0
wan = 0
tlen = 0
ren = 0

for a in lst:
    if a == 'AC':
        acn += 1
    elif a == 'WA':
        wan += 1
    elif a == 'TLE':
        tlen += 1
    elif a == 'RE':
        ren += 1
    else:
        continue

print('AC x ' + str(acn))
print('WA x ' + str(wan))
print('TLE x ' + str(tlen))
print('RE x ' + str(ren))

Fixed submission:
n = int(input())

if n >= 1000:
  siharai = n % 1000
  if siharai == 0:
    print(0)
  else:
    otsuri = 1000 - siharai
    print(otsuri)
  
else:
  otsuri = 1000 - n
  print(otsuri)
Buggy python submission (verdict: Runtime Error):
monster, skill = map(int,input().split())

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

monster_hp.sort()

attack_count = 0

while(skill>0):
    skill -= 1
    if len(monster_hp) > 0:    
        monster_hp.pop(-1)
    print(monster_hp)

for hp in monster_hp:
    attack_count += hp

print(attack_count)

Fixed submission:
monster, skill = map(int,input().split())

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

monster_hp.sort()

attack_count = 0

while(skill>0):
    skill -= 1
    if len(monster_hp) > 0:    
        monster_hp.pop(-1)
    

for hp in monster_hp:
    attack_count += hp

print(attack_count)

Buggy python submission (verdict: Runtime Error):
monster, skill = map(int,input().split())

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

monster_hp.sort()

attack_count = 0

while(skill>0):
    skill -= 1
    monster_hp.pop(-1)

for hp in monster_hp:
    attack_count += hp

print(attack_count)

Fixed submission:
monster, skill = map(int,input().split())

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

monster_hp.sort()

attack_count = 0

while(skill>0):
    skill -= 1
    if len(monster_hp) > 0:    
        monster_hp.pop(-1)
    

for hp in monster_hp:
    attack_count += hp

print(attack_count)

Buggy python submission (verdict: Runtime Error):
monster, skill = map(int,input().split())

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

monster_hp.sort()

attack_count = 0

while(skill>0):
    skill -= 1
    monster_hp.pop(-1)

for hp in monster_hp:
    attack_count += hp

print(hp)

Fixed submission:
monster, skill = map(int,input().split())

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

monster_hp.sort()

attack_count = 0

while(skill>0):
    skill -= 1
    if len(monster_hp) > 0:    
        monster_hp.pop(-1)
    

for hp in monster_hp:
    attack_count += hp

print(attack_count)

Buggy python submission (verdict: Runtime Error):
monster, skill = map(int,input().split())

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

sorted_monster_hp = monster_hp.sort()

attack_count = 0

while(skill>0):
    skill -= 1
    sorted_monster_hp.pop(-1)

for hp in sorted_monster_hp:
    attack_count += hp

print(hp)

Fixed submission:
monster, skill = map(int,input().split())

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

monster_hp.sort()

attack_count = 0

while(skill>0):
    skill -= 1
    if len(monster_hp) > 0:    
        monster_hp.pop(-1)
    

for hp in monster_hp:
    attack_count += hp

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

monster_hp_list = []
monster_hp_list.append(int(input()))

count = 0

def floor_divide(hp_list):    
    return math.floor(hp_list/2)

while(monster_hp_list[0] != 1): 
    count += len(monster_hp_list)
    monster_hp_list = list(map(floor_divide,monster_hp_list))*2
    
    

count += len(monster_hp_list)
print(count)

Fixed submission:
import math

monster_hp = int(input())
attack_count = 0

def attack_count_calc(monster_hp):
    if monster_hp == 1:                
        return attack_count + 1
    return attack_count + (2 * attack_count_calc(monster_hp//2) + 1)

print(attack_count_calc(monster_hp))
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())

answer_list = [1,2,3]
pop_list = []

for i in answer_list:
    if i == a:
        answer_list.pop(i)


for i in answer_list:
    if i == b:
        answer_list.pop(i)


print(answer_list[0])

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

answer_list = [1,2,3]

answer_list.remove(a)
answer_list.remove(b)

print(answer_list[0])
Buggy python submission (verdict: Runtime Error):
a, b = map(int,input().split())

if a + b >= a - b and a + b >= a * b:
    print(a+b)
elif a-b >= a+b and a-b >= a*b:
    print(a-b)
else:
    print(a*b)

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

if a > b:
   c = c - (a - b)

if c >= 0:
    print(c)
else:
    print('0')
Buggy python submission (verdict: Runtime Error):
k=int(input())
s=input()
if(len(s)<=k):
    print(s)
else:
    print(s[0:k]+'...')

Fixed submission:
n,m=list(map(int, input().split()))
root = [[] for _ in range(n)]
answer=[-1]*n
answer[0]=1
for i in range(m):
    c=list(map(int, input().split()))
    root[c[1]-1].append(c[0]-1)
    root[c[0]-1].append(c[1]-1)
count=1#最初から1の部屋はOKにしとく
queue=[0]
#print(root)
newqueue=[]
while(count<n and len(queue)!=0):
    for j in queue:
        for rootnum in root[j]:
            if(answer[rootnum]==-1):
                answer[rootnum]=j
                newqueue.append(rootnum)
                count+=1
    queue=newqueue
    #print(newqueue)
    newqueue=[]
if(count<n):
    print('No')
else:
    print('Yes')
    for l in range(n-1):
        print(answer[l+1]+1)
Buggy python submission (verdict: Runtime Error):
n=int(input())
nlist=make_divisors(n)
n1list=make_divisors(n-1)
# print(nlist)
# print(n1list)
answer=len(n1list)-1#1を除きます
for i in nlist[1:len(nlist)]:
    pra=n
    while (pra%i==0):
        pra=pra/i
    if pra%i==1:
        answer+=1
print(answer)


Fixed submission:
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors
n=int(input())
nlist=make_divisors(n)
n1list=make_divisors(n-1)
# print(nlist)
# print(n1list)
answer=len(n1list)-1#1を除きます
for i in nlist[1:len(nlist)]:
    pra=n
    while (pra%i==0):
        pra=pra/i
    if pra%i==1:
        answer+=1
print(answer)

Buggy python submission (verdict: Runtime Error):
n=int(input())
nlist=make_divisors(n)
n1list=make_divisors(n-1)
# print(nlist)
# print(n1list)
answer=len(n1list)-1#1を除きます
for i in nlist[1:len(nlist)]:
    pra=n
    while (pra%i==0):
        pra=pra/i
    if pra%i==1:
        answer+=1
print(answer)


Fixed submission:
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors
n=int(input())
nlist=make_divisors(n)
n1list=make_divisors(n-1)
# print(nlist)
# print(n1list)
answer=len(n1list)-1#1を除きます
for i in nlist[1:len(nlist)]:
    pra=n
    while (pra%i==0):
        pra=pra/i
    if pra%i==1:
        answer+=1
print(answer)