Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
s=input()
n=int(input())
ans=0
flg=0
if len(s) == 1:
  print(-(-n//2))
else:
  for i in range(1,len(s)):
    if flg == 0 and s[i] == s[i-1]:
      flg = 1
    elif flg != 0 and s[i] == s[i-1]:
      flg += 1
    elif flg != 0:
      ans += -(-flg//2)
      flg = 0
ans += -(-flg//2)
ans *= n
if s[-1] != s[-2] and s[0] == s[-1]:
  ans += -(-n//2)
print(ans)

Fixed submission:
s=input()
n=int(input())
ans=0
tmp=1
for i in range(len(s)-1):
  if s[i]==s[i+1]:
    tmp+=1
  else:
    ans+=tmp//2
    tmp=1
if tmp!=0:
  ans+=tmp//2
ans*=n
if len(s)!=1 and s[0]==s[-1]:
  top=0
  bottom=0
  for i in range(len(s)):
    if s[:i].count(s[0])==i:
      top=i
    if s[-i:].count(s[-1])==i:
      bottom=i
  if top!=len(s)-1:
    ans-=(top//2+bottom//2-(top+bottom)//2)*(n-1)
  elif len(s)%2==1:
    ans+=n//2
if len(s)==1:
  print(n//2)
else:
  print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
res = []
for i in range(1,n+1):
  res.append(a.index(i)+1)
print(*res)


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

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
res = []
for i in range(1,n+1):
  res.append(a.index(i)+1)
print(*res)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
res = [0] * n
for i,val in enumerate(a):
  res[val-1] = i+1
print(*res)
Buggy python submission (verdict: Time Limit Exceeded):
n,m=map(int,input().split())
a=list(map(int,input().split()))
for _ in range(m):
  a.sort()
  a[-1]=a[-1]//2
print(sum(a))

Fixed submission:
import heapq
n,m=map(int,input().split())
a=list(map(lambda x:int(x)*(-1),input().split()))
heapq.heapify(a)
for _ in range(m):
  b=heapq.heappop(a)
  heapq.heappush(a,-(-b//2))
print(-sum(a))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = []
b = []
for i in range(n):
  tmp = "".join(sorted(input()))
  if tmp in a:
    b[a.index(tmp)] += 1
  else:
    a.append(tmp)
    b.append(1)
res = [i*(i-1)//2 for i in b]
print(sum(res))


Fixed submission:
n = int(input())
a = {}
for i in range(n):
  tmp = "".join(sorted(input()))
  if tmp in a:
    a[tmp] += 1
  else:
    a[tmp] = 1
res = [i*(i-1)//2 for i in a.values()]
print(sum(res))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = []
b = []
for i in range(n):
  tmp = sorted(input())
  if tmp in a:
    b[a.index(tmp)] += 1
  else:
    a.append(tmp)
    b.append(1)
res = [i*(i-1)//2 for i in b]
print(sum(res))

Fixed submission:
n = int(input())
a = {}
for i in range(n):
  tmp = "".join(sorted(input()))
  if tmp in a:
    a[tmp] += 1
  else:
    a[tmp] = 1
res = [i*(i-1)//2 for i in a.values()]
print(sum(res))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = []
b = []
for i in range(n):
  tmp = sorted(input())
  if tmp in a:
    b[a.index(tmp)] += 1
  else:
    a.append(tmp)
    b.append(1)
res = [i*(i-1)//2 for i in b]
print(sum(res))

Fixed submission:
n = int(input())
a = {}
for i in range(n):
  tmp = "".join(sorted(input()))
  if tmp in a:
    a[tmp] += 1
  else:
    a[tmp] = 1
res = [i*(i-1)//2 for i in a.values()]
print(sum(res))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [0]
for i in range(n):
  a.append(int(input()))
a.append(0)
for i in range(1,n+1):
  print(max(max(a[:i]),max(a[i+1:])))

Fixed submission:
n = int(input())
a = []
for i in range(n):
  a.append(int(input()))
max_1 = max(a)
a[a.index(max_1)] = -1
max_2 = max(a)
a[a.index(-1)] = max_1
for i in range(0,n):
  if a[i] == max_1:
    print(max_2)
  else:
    print(max_1)
Buggy python submission (verdict: Runtime Error):
s = input()
if s = "A":
  print("T")
elif s = "C":
  print("G")
elif s = "G":
  print("C")
elif s = "T":
  print("A")

Fixed submission:
s = input()
if s == "A":
  print("T")
elif s == "C":
  print("G")
elif s == "G":
  print("C")
elif s == "T":
  print("A")
Buggy python submission (verdict: Time Limit Exceeded):
import bisect
n,q=map(int,input().split())
s = input()
a=[]
for i in range(n-1):
  if s[i:i+2]=='AC':
    a.append(i)
for _ in range(q):
  b=list(a)
  l,r=map(int,input().split())
  l-=1.5
  r-=1.5
  bisect.insort(b,l)
  bisect.insort(b,r)
  print(b.index(r)-b.index(l)-1)

Fixed submission:
import bisect
n,q=map(int,input().split())
s=input()
a=[]
for i in range(n-1):
  if s[i:i+2]=='AC':
    a.append(i)
for _ in range(q):
  l,r=map(int,input().split())
  print(bisect.bisect(a,r-1.5)-bisect.bisect(a,l-1.5))

Buggy python submission (verdict: Time Limit Exceeded):
import bisect
n,q=map(int,input().split())
s = input()
a=[]
for i in range(n-1):
  if s[i:i+2]=='AC':
    a.append(i)
for _ in range(q):
  b=list(a)
  l,r=map(int,input().split())
  l-=1.5
  r-=1.5
  bisect.insort(b,l)
  bisect.insort(b,r)
  print(b.index(r)-b.index(l)-1)

Fixed submission:
import bisect
n,q=map(int,input().split())
s=input()
a=[]
for i in range(n-1):
  if s[i:i+2]=='AC':
    a.append(i)
for _ in range(q):
  l,r=map(int,input().split())
  print(bisect.bisect(a,r-1.5)-bisect.bisect(a,l-1.5))
Buggy python submission (verdict: Runtime Error):
n,m,c = map(int, input().split())
b = list(map(int, input().split()))
res = 0
for i in range(n):
  a = list(map(int, input().split()))
  if sum(a * b) + c > 0:
    res += 1
print(res)

Fixed submission:
import numpy as np
n,m,c = map(int, input().split())
b = np.array(list(map(int, input().split())))
res = 0
for i in range(n):
  a = np.array(list(map(int, input().split())))
  if sum(a * b) + c > 0:
    res += 1
print(res)
Buggy python submission (verdict: Runtime Error):
n,k=map(int,input())
if (n+1)//2>=k:
  print('YES')
else:
  print('NO')

Fixed submission:
n,k=map(int,input().split())
if (n+1)//2>=k:
  print('YES')
else:
  print('NO')
Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int,input().split())
if k > n:
  k = n
a = list(map(int, input().split()))
dp = [0]*n
for i in range(1,n):
  if i <= k:
    dp[i] = abs(a[i]-a[0])
  else:
    dp[i] = min([abs(a[i]-a[i-j])+dp[i-j] for j in range(1,k+1)])
print(dp[-1])

Fixed submission:
n,k = map(int,input().split())
if k > n:
  k = n
a = list(map(int, input().split()))
dp = [0]*n
for i in range(1,n):
  if i <= k:
    dp[i] = abs(a[i]-a[0])
  else:
    dp[i] = min([abs(a[i]-a[i-j])+dp[i-j] for j in range(1,k+1)])
print(dp[-1])
Buggy python submission (verdict: Time Limit Exceeded):
n,m=map(int,input().split())
dp = [[0]*(m+1) for i in range(n+1)]
for i in range(1,n+1):
  w,v=map(int,input().split())
  for j in range(m+1):
    if j < w:
      dp[i][j] = dp[i-1][j]
    else:
      dp[i][j] = max(dp[i-1][j-w]+v,dp[i-1][j])
print(dp[n][m])

Fixed submission:
n,m=map(int,input().split())
dp = [[0]*(m+1) for i in range(n+1)]
for i in range(1,n+1):
  w,v=map(int,input().split())
  for j in range(m+1):
    if j < w:
      dp[i][j] = dp[i-1][j]
    else:
      dp[i][j] = max(dp[i-1][j-w]+v,dp[i-1][j])
print(dp[n][m])
Buggy python submission (verdict: Time Limit Exceeded):
s1=input()
s2=input()
a=[[0]*(len(s2)+1) for i in range(len(s1)+1)]
res=''
for i in range(1,len(s1)+1):
  for j in range(1,len(s2)+1):
    if s1[i-1] == s2[j-1]:
      a[i][j] = a[i-1][j-1] + 1
    elif a[i-1][j] >= a[i][j-1]:
      a[i][j] = a[i-1][j]
    else:
      a[i][j] = a[i][j-1]
i=len(s1)
j=len(s2)
while i>0 and j>0:
  if a[i][j] == a[i-1][j]:
    i -= 1
  elif a[i][j] == a[i][j-1]:
    j -= 1
  else:
    res = s1[i-1] + res
    i -= 1
    j -= 1   
print(res)

Fixed submission:
s1=input()
s2=input()
a=[[0]*(len(s2)+1) for i in range(len(s1)+1)]
res=''
for i in range(1,len(s1)+1):
  for j in range(1,len(s2)+1):
    if s1[i-1] == s2[j-1]:
      a[i][j] = a[i-1][j-1] + 1
    elif a[i-1][j] >= a[i][j-1]:
      a[i][j] = a[i-1][j]
    else:
      a[i][j] = a[i][j-1]
i=len(s1)
j=len(s2)
while i>0 and j>0:
  if a[i][j] == a[i-1][j]:
    i -= 1
  elif a[i][j] == a[i][j-1]:
    j -= 1
  else:
    res = s1[i-1] + res
    i -= 1
    j -= 1   
print(res)
Buggy python submission (verdict: Time Limit Exceeded):
s = input()
res = 0
while True:
  if 'BW' in s:
    s = s[:s.index('BW')] + 'WB' + s[s.index('BW')+2:]
    res += 1
  else:
    break
print(res)

Fixed submission:
s = input()
res = 0
B = 0
for i in range(len(s)):
  if s[i] == 'B':
    B += 1
  else:
    res += B
print(res)
Buggy python submission (verdict: Runtime Error):
s = input()
tmp = 700
if s[0] == o:
  tmp += 100
if s[1] == o:
  tmp += 100
if s[2] == o:
  tmp += 100
print(tmp)

Fixed submission:
s = input()
tmp = 700
if s[0] == "o":
  tmp += 100
if s[1] == "o":
  tmp += 100
if s[2] == "o":
  tmp += 100
print(tmp)
Buggy python submission (verdict: Runtime Error):
n,x = int(input())
a = []
for i in range(n):
  a.append(int(input()))
print(n + (x-sum(a))//min(a))

Fixed submission:
n,x = map(int,input().split())
a = []
for i in range(n):
  a.append(int(input()))
print(n + (x-sum(a))//min(a))
Buggy python submission (verdict: Runtime Error):
a,b,k=map(int,input().split())
arr=list(range(a,b+1))
for i in range(b-a+1):
  if i < k or i >= len(arr) - k:
    print(arr[i])

Fixed submission:
a,b,k=map(int,input().split())
if 2*k >= b-a+1:
  print(*list(range(a,b+1)),sep='\n')
else:
  print(*list(range(a,a+k)),sep='\n')
  print(*list(range(b-k+1,b+1)),sep='\n')

Buggy python submission (verdict: Runtime Error):
a,b,k=map(int,input().split())
arr=list(range(a,b+1))
for i in range(b-a+1):
  if i <= k or len(arr)-i >= k:
    print(arr[i])

Fixed submission:
a,b,k=map(int,input().split())
if 2*k >= b-a+1:
  print(*list(range(a,b+1)),sep='\n')
else:
  print(*list(range(a,a+k)),sep='\n')
  print(*list(range(b-k+1,b+1)),sep='\n')
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
if a.count('Y') == 0:
  print('Three')
else:
  print('Four')

Fixed submission:
n = int(input())
a = list(map(str, input().split()))
if a.count('Y') == 0:
  print('Three')
else:
  print('Four')
Buggy python submission (verdict: Runtime Error):
n,m = map(int, input().split())
s = input()
num = '0123456789'
flg = 0
for i in range(len(s)):
  if i < n-1:
    if s[i] not in num:
      flg = 1
  elif i == a:
    if s[i] != '-':
      flg = 1
  else:
    if s[i] not in num:
      flg = 1
if flg == 0:
  print('Yes')
else:
  print('No')

Fixed submission:
n,m = map(int, input().split())
s = input()
num = '0123456789'
flg = 0
for i in range(len(s)):
  if i < n-1:
    if s[i] not in num:
      flg = 1
  elif i == n:
    if s[i] != '-':
      flg = 1
  else:
    if s[i] not in num:
      flg = 1
if flg == 0:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int, input().split())
a = list(map(int, input().split()))
b = list(set(a))
res = 0
if len(b) <= k:
  print(0)
else:
  if k <= n / 2:
    tmp = [0] * k
    for i in b:
      a_count = a.count(i)
      if a_count > tmp[0]:
        tmp.pop(0)
        tmp.append(a_count)
        tmp.sort()
    for i in range(k):
      res = res + tmp[i]
    print(n - res)
  else:
    tmp = [200000] * (n - k)
    for i in b:
      a_count = a.count(a)
      if a_count < tmp[0]:
        tmp.pop(0)
        tmp.append(a_count)
        tmp.sort(reverse=True)
    for i in range(n - k):
      res = res + tmp[i]
    print(res)

Fixed submission:
from collections import Counter
n,k = map(int, input().split())
a = list(map(int, input().split()))
b = list(set(a))
if len(b) <= k:
  print(0)
else:
  c = sorted(Counter(a).values(), reverse=True)
  print(sum(c[k:]))

Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int, input().split())
a = list(map(int, input().split()))
b = list(set(a))
tmp = []
res = 0
if len(b) <= k:
  print(0)
else:
  for i in b:
    tmp.append(a.count(i))
  tmp.sort()
  for i in range(len(b) - k):
    res = res + tmp[i]
  print(res)

Fixed submission:
from collections import Counter
n,k = map(int, input().split())
a = list(map(int, input().split()))
b = list(set(a))
if len(b) <= k:
  print(0)
else:
  c = sorted(Counter(a).values(), reverse=True)
  print(sum(c[k:]))
Buggy python submission (verdict: Runtime Error):
n = int(input())
tmp = 0
for i in range(len(str(n))):
  tmp += str(n)[i]
if n % tmp == 0:
  print('Yes')
else:
  print('No')

Fixed submission:
n = int(input())
tmp = 0
for i in range(len(str(n))):
  tmp += int(str(n)[i])
if n % tmp == 0:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
n = int(input())
ans = 0
for i in range(pow(n,1/2)+1):
  if i**2 <= n:
    ans = i**2
print(ans)

Fixed submission:
n = int(input())
ans = 0
for i in range(int(pow(n,1/2))+1):
  if i**2 <= n:
    ans = i**2
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(intput())
k = int(input())
ans = 1
for i in range(n):
  if ans <= k:
    ans *= 2
  else:
    ans += k
print(ans)

Fixed submission:
n = int(input())
k = int(input())
ans = 1
for i in range(n):
  if ans <= k:
    ans *= 2
  else:
    ans += k
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = []
for i in range(n):
  x = int(input())
  if x in a:
    a.remove(x)
  else:
    a.append(x)
print(len(a))

Fixed submission:
n = int(input())
a = []
flag = 0
d = 0
for i in range(n):
  a.append(int(input()))
a.sort()
for i in range(n - 1):
  if flag == 1:
    flag = 0
  elif a[i] == a[i + 1]:
    d = d + 2
    flag = 1
print(len(a) - d)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
b = [0] * pow(10,5)
for i in range(n):
  if a[i] == 0:
    b[0] += 1
    b[1] += 1
  elif a[i] == pow(10,5):
    b[pow(10,5) - 1] += 1
    b[pow(10,5)] += 1
  else:
    b[a[i]] += 1
    b[a[i] - 1] += 1
    b[a[i] + 1] += 1
print(max(b))

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
b = [0] * (pow(10,5) + 1)
for i in range(n):
  if a[i] == 0:
    b[0] += 1
    b[1] += 1
  elif a[i] == pow(10,5):
    b[pow(10,5) - 1] += 1
    b[pow(10,5)] += 1
  else:
    b[a[i]] += 1
    b[a[i] - 1] += 1
    b[a[i] + 1] += 1
print(max(b))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
a.sort()
max_a = 0
for i in a:
  tmp = a.count(i - 1) +a.count(i) + a.count(i + 1)
  if tmp > max_a:
    max_a = tmp
  tmp = a.count(i) +a.count(i + 1) + a.count(i + 2)
  if tmp > max_a:
    max_a = tmp
print(max_a)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
b = [0] * (pow(10,5) + 1)
for i in range(n):
  if a[i] == 0:
    b[0] += 1
    b[1] += 1
  elif a[i] == pow(10,5):
    b[pow(10,5) - 1] += 1
    b[pow(10,5)] += 1
  else:
    b[a[i]] += 1
    b[a[i] - 1] += 1
    b[a[i] + 1] += 1
print(max(b))
Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int, input().split())
tmp = 0
flg = 0
a = []
for i in range(m):
  x,y = map(int, input().split())
  if x == 1:
    tmp = y
  elif y == n:
    tmp = x
  if tmp != 0 and a.count(tmp) == 0:
    a.append(tmp)
  elif tmp != 0 and a.count(tmp) >= 1:
    flg = 1
  tmp = 0
if flg == 1:
  print("POSSIBLE")
else:
  print("IMPOSSIBLE")

Fixed submission:
n,m=map(int,input().split())
a=[0]*(n+1)
b=[0]*(n+1)
flg=0
for i in range(m):
  p,q=map(int,input().split())
  if (p==1 and q==n) or (p==n and q==1):
    flg=1
  elif p==1:
    a[q]=1
  elif q==1:
    a[p]=1
  elif p==n:
    b[q]=1
  elif q==n:
    b[p]=1
for i in range(1,n+1):
  if a[i]==1 and b[i]==1:
    flg=1
if flg==1:
  print('POSSIBLE')
else:
  print('IMPOSSIBLE')

Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int, input().split())
tmp = 0
flg = 0
a = []
for i in range(m):
  x,y = map(int, input().split())
  if x == 1:
    tmp = y
  elif y == n:
    tmp = x
  if tmp != 0 and a.count(tmp) == 0:
    a.append(tmp)
  elif tmp != 0 and a.count(tmp) >= 1:
    flg = 1
  tmp = 0
if flg == 1:
  print("POSSIBLE")
else:
  print("IMPOSSIBLE")

Fixed submission:
n,m=map(int,input().split())
a=[0]*(n+1)
b=[0]*(n+1)
flg=0
for i in range(m):
  p,q=map(int,input().split())
  if (p==1 and q==n) or (p==n and q==1):
    flg=1
  elif p==1:
    a[q]=1
  elif q==1:
    a[p]=1
  elif p==n:
    b[q]=1
  elif q==n:
    b[p]=1
for i in range(1,n+1):
  if a[i]==1 and b[i]==1:
    flg=1
if flg==1:
  print('POSSIBLE')
else:
  print('IMPOSSIBLE')
Buggy python submission (verdict: Runtime Error):
s = input()
for i in range(len(s)):
  s.pop(-1)
  if len(s) % 2 == 0:
    if s[:len(s)//2] == s[len(s)//2:]:
      print(len(s))
      break


Fixed submission:
s = input()
for i in range(len(s)):
  s = s[:-1]
  if len(s) % 2 == 0:
    if s[:len(s)//2] == s[len(s)//2:]:
      print(len(s))
      break
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
res = []
if n % 2 == 0:
  for i in range(n):
    if i % 2 == 0:
      res.append(a[i])
    else:
      res.insert(0,a[i])
  print(*res)
else:
  for i in range(n):
    if i % 2 == 0:
      res.insert(0,a[i])
    else:
      res.append(a[i])
  print(*res)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
res1 = []
res2 = []
if n % 2 == 1:
  res1.append(a.pop(-1))
  n = n -1
  for i in range(n//2):
    res1.append(a[n-2-2*i])
    res2.append(a[1+i*2])
  res1.extend(res2)
  print(*res1)
else:
  for i in range(n//2):
    res1.append(a[n-1-2*i])
    res2.append(a[i*2])
  res1.extend(res2)
  print(*res1)
Buggy python submission (verdict: Runtime Error):
n,m = map(int, input().split())
a = [0]*n
for i in range(m):
  b,c = map(int, input().split())
  a[b] += 1
  a[c] += 1
[print(i) for i in a]

Fixed submission:
n,m = map(int, input().split())
a = [0]*n
for i in range(m):
  b,c = map(int, input().split())
  a[b-1] += 1
  a[c-1] += 1
[print(i) for i in a]
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(intpu())
if a > b:
  print('GREATER')
elif a < b:
  print('LESS')
else:
  print('EQUAL')

Fixed submission:
a = int(input())
b = int(input())
if a > b:
  print('GREATER')
elif a < b:
  print('LESS')
else:
  print('EQUAL')
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input()))
odd=0
even=0
for i in range(n):
  if a[i]%2 == 0:
    even += 1
  else:
    odd += 1
if odd % 2 == 0:
  if (even + odd//2) % 2 == 0:
    print('YES')
  else:
    print('NO')
else:
  print('NO')

Fixed submission:
n = int(input())
arr = list(map(int, input().split()))
tmp = 0
for i in range(n):
  if arr[i] % 2 == 1:
    tmp += 1
if tmp % 2 == 0:
  print('YES')
else:
  print('NO')
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
m=int(input())
sum_a=sum(a)
for i in range(m):
  s,t=map(int,input().split())
  print(sum_a+t-a[s])

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
m=int(input())
sum_a=sum(a)
for i in range(m):
  s,t=map(int,input().split())
  print(sum_a+t-a[s-1])
Buggy python submission (verdict: Runtime Error):
h,w = map(int, input().split())
l = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
for i in range(w):
  tmp = list(map(str, input().split()))
  if tmp.count('snuke') == 1:
    a = l[tmp.index('snuke')]
    b = str(i + 1)
print(a + b)

Fixed submission:
h,w = map(int, input().split())
l = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
for i in range(h):
  tmp = list(map(str, input().split()))
  if tmp.count('snuke') == 1:
    a = l[tmp.index('snuke')]
    b = str(i + 1)
print(a + b)
Buggy python submission (verdict: Runtime Error):
print(input().insert(4,' '))

Fixed submission:
s = input()
print(s[:4] + ' ' + s[4:])
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = [int(x) for x in input().split()]

# M以下の整数の素因数分解を高速に
# 前処理O(MloglogM)
# 一計算O(logK)
def mae_syori(M):
    D = [0] * (M + 1)
    for i in range(2, M+1):
        if D[i] != 0: continue
    #     print(i, list(range(i*2, M + 1, i)))
        for j in range(i*2, M+1, i):
            if D[j] == 0:
                D[j] = i
    return D

def p_bunkai(K):
    assert 2 <= K <= len(D)-1
    k = K
    ret = []
    while True:
        if k == 1:
            break
        if D[k] == 0:
            ret.append((k, 1))
            break
        else:
            p = D[k]
            count = 0
            while k % p == 0:
                count += 1
                k //= p
            ret.append((p, count))
    return ret
 

# 最大公約数
# ユークリッドの互除法
def my_gcd(a, b):
    if b == 0:
        return a
    else:
        return my_gcd(b, a%b)

c_gcd = A[0]
for a in A:
    c_gcd = my_gcd(c_gcd, a)

if c_gcd == 1:
    max_A = max(A)
    D = mae_syori(max_A)
    yakusu = set()
    ok = True
    for a in A:
        p_bunkai_result = p_bunkai(a)
        p_list = [p[0] for p in p_bunkai_result]
        for p in p_list:
            if p not in yakusu:
                yakusu.add(p)
            else:
                ok = False
        if not ok:
            break
    if ok:
        print('pairwise coprime')
    else:
        print('setwise coprime')
else:
    print('not coprime')

Fixed submission:
N = int(input())
A = [int(x) for x in input().split()]

# M以下の整数の素因数分解を高速に
# 前処理O(MloglogM)
# 一計算O(logK)
def mae_syori(M):
    D = [0] * (M + 1)
    for i in range(2, M+1):
        if D[i] != 0: continue
    #     print(i, list(range(i*2, M + 1, i)))
        for j in range(i*2, M+1, i):
            if D[j] == 0:
                D[j] = i
    return D

def p_bunkai(K):
    assert 2 <= K <= len(D)-1
    k = K
    ret = []
    while True:
        if k == 1:
            break
        if D[k] == 0:
            ret.append((k, 1))
            break
        else:
            p = D[k]
            count = 0
            while k % p == 0:
                count += 1
                k //= p
            ret.append((p, count))
    return ret
 

# 最大公約数
# ユークリッドの互除法
def my_gcd(a, b):
    if b == 0:
        return a
    else:
        return my_gcd(b, a%b)

c_gcd = A[0]
for a in A:
    c_gcd = my_gcd(c_gcd, a)

if c_gcd == 1:
    max_A = max(A)
    D = mae_syori(max_A)
    yakusu = set()
    ok = True
    for a in A:
        if a == 1: continue
        p_bunkai_result = p_bunkai(a)
        p_list = [p[0] for p in p_bunkai_result]
        for p in p_list:
            if p not in yakusu:
                yakusu.add(p)
            else:
                ok = False
        if not ok:
            break
    if ok:
        print('pairwise coprime')
    else:
        print('setwise coprime')
else:
    print('not coprime')