Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n = int(input())

info = []
for i in range(n):
    pre = list(map(int,input().split(" ")))
    info.append(pre)
    
end = 0
if n >=3:
    for x in range(101):
        for y in range(101):
            H = info[0][2] + abs(x-info[0][0]) + abs(y-info[0][1])
            if H <= 10**9
                for i in range(1,n):
                    if info[i][2] != H - abs(x-info[i][0]) - abs(y- info[i][1]):
                        break
                else:
                    print(x,y,H)
                    end = 1
                
                if end == 1:
                    break
            if end == 1:
                break
elif n ==2:
    info = sorted(info, key = lambda x:x[2])
    if info[0][0] > info[1][0]:
        h = info[1][2] + info[1][0]
        x = 0
    else:
        h = info[1][2] + 100- info[1][0]
        x = 100
    if info[0][1] > info[1][1]:
        h += info[1][1]
        y = 0
    else:
        h += 100 - info[1][1]
        y =100
    ans = list(map(str,(x,y,h)))
    print(" ".join(ans))

Fixed submission:
n = int(input())

info = []
for i in range(n):
    pre = list(map(int,input().split(" ")))
    info.append(pre)

info = sorted(info,key = lambda x: x[2])
end = 0

for x in range(101):
    for y in range(101):
        H = info[n-1][2] + abs(x-info[n-1][0]) + abs(y-info[n-1][1])
        for i in range(n-1):
            if info[i][2] != max(0,H - abs(x-info[i][0]) - abs(y- info[i][1])):
                break
        else:
            print(x,y,H)
            end = 1
            
        if end == 1:
            break
    if end == 1:
        break
Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int,input().split(" "))

for i in range(0,m-n+1):
    if m%(n+i) == 0:
        print(int(m/(n+i)))
        break

Fixed submission:
n,m = map(int,input().split(" "))

i_m = m
import math
root_m = int(math.sqrt(m))

m_s = []
for i in range(2,root_m+1):
    while m%i == 0:
        m_s.append(i)
        m = int(m/i)
        if m == 1:
            break
    if m ==1:
        break

if m_s == []:
    if n == 1:
        print(i_m)
    else:
        print(1)

else:
    for i in range(0,i_m-n+1):
        if i_m%(n+i) == 0:
            print(int(i_m/(n+i)))
            break
Buggy python submission (verdict: Time Limit Exceeded):
s = input()
t = input()
import string
for i in range(len(s)):
    if s[i:i+1] != t[i:i+1]:
        s = s.translate(str.maketrans(s[i:i+1]+t[i:i+1],t[i:i+1]+s[i:i+1]))
if s == t:
    print("Yes")
else:
    print("No")

Fixed submission:
s = input()
t = input()
        
dic = "abcdefghijklmnopqrstuvwxyz"
s_dic = {}
t_dic = {}
for i in dic:
    s_dic[i] = []
    t_dic[i] = []

for i in range(len(s)):
    s_dic[s[i:i+1]].append(i)
    t_dic[t[i:i+1]].append(i)

s_list = s_dic.values()
t_list = t_dic.values()

if sorted(s_list) == sorted(t_list):
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
n,x = map(int,input().split(" "))

def minus_x(t):
    return int(t) - x
cities = list(map(minus_x,input().split(" ")))

import math
if n == 1:
    ans = cities[0]
else:
    ans = math.gcd(cities[0],cities[1])
    for i in range(2,n-1):
        ans = math.gcd(cities[i],ans)

print(ans)

Fixed submission:
n,x = map(int,input().split(" "))

def minus_x(t):
    return abs(int(t) - x)
cities = sorted(list(map(minus_x,input().split(" "))))

def gcd(a,b):
    while b>0:
        a,b = b,a%b
    return a

if n == 1:
    ans = cities[0]
else:
    ans = gcd(cities[0],cities[1])
    for i in range(2,n-1):
        ans = gcd(cities[i],ans)

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n,m,q = map(int,input().split(" "))
LR_2d = [[0 for i in range(n)] for i in range(n)]
for i in range(m):
    L,R = map(int,input().split(" "))
    LR_2d[L-1][R-1] += 1
LR_2dsum = [[0 for i in range(n)] for i in range(n)]
for i in range(n):
    LR_2dsum[i][0] = LR_2d[i][0]
    for j in range(1,n):
        LR_2dsum[i][j] = LR_2dsum[i][j-1] + LR_2d[i][j]
for i in range(q):
    ans = 0
    p_i,q_i = map(int,input().split(" "))
    for j in range(p_i-1,q_i):
        if p_i == 1:
            ans_j = LR_2dsum[j][q_i-1]
        else:
            ans_j = LR_2dsum[j][q_i-1] - LR_2dsum[j][p_i-2]
        ans += ans_j
    print(ans)

Fixed submission:
n,m,q = map(int,input().split(" "))
LR_2d = [[0 for i in range(n+1)] for i in range(n+1)]
for i in range(m):
    L,R = map(int,input().split(" "))
    LR_2d[L][R] += 1

LR_2dsum = [[0 for i in range(n+1)] for i in range(n+1)]
for j in range(1,n):
    LR_2dsum[0][j] = LR_2dsum[0][j-1] + LR_2d[0][j]
for i in range(1,n+1):
    for j in range(1,n+1):
        LR_2dsum[i][j] = LR_2dsum[i-1][j] + LR_2dsum[i][j-1] - LR_2dsum[i-1][j-1] + LR_2d[i][j]

for i in range(q):
    p_i,q_i = map(int,input().split(" "))
    ans = LR_2dsum[p_i-1][p_i-1] - LR_2dsum[p_i-1][q_i] - LR_2dsum[q_i][p_i-1] + LR_2dsum[q_i][q_i]
    print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n,m,q = map(int,input().split(" "))
LRs =[]
for i in range(m):
    LR_i = list(map(int,input().split(" ")))
    LRs.append(LR_i)
for i in range(q):
    ans = 0
    p_i,q_i = map(int,input().split(" "))
    for j in LRs:
        if p_i <= j[0] and j[1] <= q_i:
            ans = ans + 1
    print(ans)

Fixed submission:
n,m,q = map(int,input().split(" "))
LR_2d = [[0 for i in range(n+1)] for i in range(n+1)]
for i in range(m):
    L,R = map(int,input().split(" "))
    LR_2d[L][R] += 1

LR_2dsum = [[0 for i in range(n+1)] for i in range(n+1)]
for j in range(1,n):
    LR_2dsum[0][j] = LR_2dsum[0][j-1] + LR_2d[0][j]
for i in range(1,n+1):
    for j in range(1,n+1):
        LR_2dsum[i][j] = LR_2dsum[i-1][j] + LR_2dsum[i][j-1] - LR_2dsum[i-1][j-1] + LR_2d[i][j]

for i in range(q):
    p_i,q_i = map(int,input().split(" "))
    ans = LR_2dsum[p_i-1][p_i-1] - LR_2dsum[p_i-1][q_i] - LR_2dsum[q_i][p_i-1] + LR_2dsum[q_i][q_i]
    print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int,input().split(" "))
def bar_M(t):
    return int(t)%m
array = list(map(bar_M,input().split(" ")))

array_sum = [0 for i in range(n+1)]
for i in range(1,n+1):
    array_sum[i] = (array_sum[i-1] + array[i-1])%m

nums = set(array_sum)
sums = []
for i in nums:
    p = array_sum.count(i)
    if p > 1:
        sums.append(p)
ans = 0
for i in sums:
    ans+=int((i-1)*i/2)
print(ans)

Fixed submission:
n,m = map(int,input().split(" "))
array = list(map(int,input().split(" ")))

array_sum,sums = [0,0],{0:1}
for i in range(1,n+1):
    array_sum[0] = array_sum[1]
    array_sum[1] = (array_sum[0] + array[i-1])%m
    sums[array_sum[1]] = sums.get(array_sum[1],0) + 1

ans = 0
for i in sums.values():
    ans+=int((i-1)*i/2)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int,input().split(" "))
def bar_M(t):
    return int(t)%m
array = list(map(bar_M,input().split(" ")))

array_sum = [0 for i in range(n+1)]
for i in range(1,n+1):
    array_sum[i] = (array_sum[i-1] + array[i-1])%m

nums = set(array_sum)
sums = []
for i in nums:
    p = array_sum.count(i)
    if p > 1:
        sums.append(array_sum.count(i))
ans = 0
for i in sums:
    ans+=int((i-1)*i/2)
print(ans)

Fixed submission:
n,m = map(int,input().split(" "))
array = list(map(int,input().split(" ")))

array_sum,sums = [0,0],{0:1}
for i in range(1,n+1):
    array_sum[0] = array_sum[1]
    array_sum[1] = (array_sum[0] + array[i-1])%m
    sums[array_sum[1]] = sums.get(array_sum[1],0) + 1

ans = 0
for i in sums.values():
    ans+=int((i-1)*i/2)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int,input().split(" "))
def bar_M(t):
    return int(t)%m
array = list(map(bar_M,input().split(" ")))

array_sum = [0 for i in range(n+1)]
for i in range(1,n+1):
    array_sum[i] = (array_sum[i-1] + array[i-1])%m

nums = set(array_sum)
sums = []
for i in nums:
    sums.append(array_sum.count(i))
ans = 0
for i in sums:
    ans+=int((i-1)*i/2)
print(ans)

Fixed submission:
n,m = map(int,input().split(" "))
array = list(map(int,input().split(" ")))

array_sum,sums = [0,0],{0:1}
for i in range(1,n+1):
    array_sum[0] = array_sum[1]
    array_sum[1] = (array_sum[0] + array[i-1])%m
    sums[array_sum[1]] = sums.get(array_sum[1],0) + 1

ans = 0
for i in sums.values():
    ans+=int((i-1)*i/2)
print(ans)

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

def bar_M(t):
    return t%m

array = list(map(bar_M,array))
array_sum = [0 for i in range(n+1)]
for i in range(1,n+1):
    array_sum[i] = (array_sum[i-1] + array[i-1])%m

nums = set(array_sum)
sums = []
for i in nums:
    sums.append(array_sum.count(i))
ans = 0
for i in sums:
    ans+=int((i-1)*i/2)
print(ans)

Fixed submission:
n,m = map(int,input().split(" "))
array = list(map(int,input().split(" ")))

array_sum,sums = [0,0],{0:1}
for i in range(1,n+1):
    array_sum[0] = array_sum[1]
    array_sum[1] = (array_sum[0] + array[i-1])%m
    sums[array_sum[1]] = sums.get(array_sum[1],0) + 1

ans = 0
for i in sums.values():
    ans+=int((i-1)*i/2)
print(ans)
Buggy python submission (verdict: Runtime Error):
s = input()
k = int(input())
idx = 0
while idx < len(s) and s[idx] == '1':
    idx += 1
if k < idx:
    print(1)
else:
    print(s[idx])


Fixed submission:
s = input()
k = int(input())
idx = 0
while idx < len(s) and s[idx] == '1':
    idx += 1
if k <= idx or idx == len(s):
    print(1)
else:
    print(s[idx])
Buggy python submission (verdict: Runtime Error):
a=input().split()
if a[1]=='+':
  print(a[0]+a[2])
else:
  print(a[0]-a[2])

Fixed submission:
a=input().split()
if a[1]=='+':
  print(int(a[0])+int(a[2]))
else:
  print(int(a[0])-int(a[2]))
Buggy python submission (verdict: Runtime Error):
a=map(int,input().split())
a.sort()
if a[0]+a[1]==a[2]:
  print("Yes")
else:
  print("No")

Fixed submission:
a=map(int,input().split())
a=list(a)
a.sort()
if a[0]+a[1]==a[2]:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
A = int(input())
B = int(input())

ans1 = A + B


if ans1 >= 24:
    ans2 = ans1 - 24
    print(ans2)
else:
    print(ans1)
    
    
    

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

ans1 = A + B


if ans1 >= 24:
    ans2 = ans1 - 24
    print(ans2)
else:
    print(ans1)
Buggy python submission (verdict: Runtime Error):
N,L = list(map(int,input().split()))

Iloha = []

for i in range(N):
    S = input()
    Iloha.append(S)

Iloha.sort()

print("".join(Iloha))


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

if x == [5, 5, 7]:
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Runtime Error):

n,t =  (int(x) for x in input().split())

A = []
for i in range(n):
    c,ti  =  (int(x) for x in input().split())
    A.append([c,ti])

B = []
for i in A:
    if A[1] < t:
        B.append(i)

if len(B):
    B.sort(key=lambda x: x[0])
    print(B[0])
else:
    print("TLE")

Fixed submission:
# -*- coding: utf-8 -*-

n,t =  (int(x) for x in input().split())

A = []
for i in range(n):
    c,ti  =  (int(x) for x in input().split())
    A.append([c,ti])

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

if A[0][1] > t:
    print("TLE")
else:
    min = A[0][0]
    for i in A:
        if i[1] > t:
            break
        
        if min > i[0]:
            min = i[0]
        
    print(min)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [int(x) for x in input("").split()]

min = 0

for i in range(1,n):
    all = 0
    for j in range(0,i):
        all += a[j]

    for j in range(i,n):
        all -= a[j]

    if i == 1:
        min = abs(all)
    else:
        if min > abs(all):
            min = abs(all)

print(min)

Fixed submission:
n = int(input())
a = [int(x) for x in input("").split()]

min = 0

left = []
for i in range(n-1):
    left.append(a[i])
    if i > 0:
        left[i] += left[i-1]

a.reverse()

right = []
for i in range(n-1):
    right.append(a[i])
    if i > 0:
        right[i] += right[i-1]

right.reverse()

min = 0
for i in range(1,n):
    if i == 1:
        min = abs(left[i-1] - right[i-1])
    else:
        if min > abs(left[i-1] - right[i-1]):
            min = abs(left[i-1] - right[i-1])

print(min)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
a1 = [a[x*2] for x in range(n//2+n%2)]
a2 = [a[x*2+1] for x in range(n//2)]
a1set = []
a2set = []

for k in set(a1):
    a1set.append([k,a1.count(k)])
for k in set(a2):
    a2set.append([k,a2.count(k)])

a1set.sort(key=lambda x:x[1],reverse=True)
a2set.sort(key=lambda x:x[1],reverse=True)

if a1set[0][0] != a2set[0][0]:
    print(n-a1set[0][1]-a2set[0][1])
elif len(a1set) > 1 and len(a2set) > 1:
    if a1set[0][1] + a2set[1][1] > a2set[0][1] + a1set[1][1]:
        print(n - a2set[2][1] - a1set[0][1])
    else:
        print(n - a2set[0][1] - a1set[1][1])
elif len(a1set) > 1:
    print(n - a2set[0][1] - a1set[1][1])
elif len(a2set) > 1:
    print(n - a2set[2][1] - a1set[0][1])
else:
    print(n - a1set[0][1])


Fixed submission:
from collections import Counter
n = int(input())
el = [int(i) for i in input().split()]
odd_l = Counter(el[::2])
even_l = Counter(el[1::2])
a1, b1 = odd_l.most_common(1)[0]
a2, b2 = even_l.most_common(1)[0]
if a1 != a2:
    ans = n - b1 - b2
else:
    if len(odd_l) > 1:
        b3 = odd_l.most_common(2)[1][1]
    else:
        b3 = 0
    if len(even_l) > 1:
        b4 = even_l.most_common(2)[1][1]
    else:
        b4 = 0
    ans = min(n - b1 - b4, n - b3 - b2)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
a1 = [a[x*2] for x in range(n//2+n%2)]
a2 = [a[x*2+1] for x in range(n//2)]
sa1 = set(a1)
sa2 = set(a2)
a1set = []
a2set = []

for k in sa1:
    a1set.append([k,a1.count(k)])
for k in sa2:
    a2set.append([k,a2.count(k)])

a1set.sort(key=lambda x:x[1],reverse=True)
a2set.sort(key=lambda x:x[1],reverse=True)
while True:
    if a1set[0][0] != a2set[0][0]:
        print(n-a1set[0][1]-a2set[0][1])
        exit(0)
    elif len(a1set) > 1 and len(a2set) > 1:
        if a1set[0][1] + a2set[1][1] > a2set[0][1] + a1set[1][1]:
            a2set.pop(0)
        else:
            a1set.pop(0)
    elif len(a1set) > 1:
        a1set.pop(0)
    elif len(a2set) > 1:
        a2set.pop(0)
    else:
        print(n - a1set[0][1])
        exit(0)




print(a1, a2)

Fixed submission:
from collections import Counter
n = int(input())
el = [int(i) for i in input().split()]
odd_l = Counter(el[::2])
even_l = Counter(el[1::2])
a1, b1 = odd_l.most_common(1)[0]
a2, b2 = even_l.most_common(1)[0]
if a1 != a2:
    ans = n - b1 - b2
else:
    if len(odd_l) > 1:
        b3 = odd_l.most_common(2)[1][1]
    else:
        b3 = 0
    if len(even_l) > 1:
        b4 = even_l.most_common(2)[1][1]
    else:
        b4 = 0
    ans = min(n - b1 - b4, n - b3 - b2)
print(ans)
Buggy python submission (verdict: Runtime Error):
#-*- coding:utf-8 -*-
"""
高橋くんは今日も1人でしりとりの練習をしています。

しりとりとは以下のルールで遊ばれるゲームです。

・はじめ、好きな単語を発言する
・以降、次の条件を満たす単語を発言することを繰り返す
　・その単語はまだ発言していない単語である
　・その単語の先頭の文字は直前に発言した単語の末尾の文字と一致する

高橋くんは、10秒間にできるだけ多くの単語を発言する練習をしています。
高橋くんが発言した単語の個数Nとi番目に発言した単語Wiが与えられるので、
どの発言もしりとりのルールを守っていたかを判定してください。
"""
def check(words):
    answer = "Yes"
    for i in range(0, len(words)):
        for j in range(i, len(words)):
            if(words[i] == words[j]):
                answer = "No"

    return answer


def main(str):
    words = str.split()
    answer = check(words)
    print(answer)


if __name__ == "__main__":
    num = int(input())  # 単語の個数の読み込み
    str = [input() for i in range(0, num)]  # 単語の読み込み
    main(str)

Fixed submission:
#-*- coding:utf-8 -*-
"""
高橋くんは今日も1人でしりとりの練習をしています。

しりとりとは以下のルールで遊ばれるゲームです。

・はじめ、好きな単語を発言する
・以降、次の条件を満たす単語を発言することを繰り返す
　・その単語はまだ発言していない単語である
　・その単語の先頭の文字は直前に発言した単語の末尾の文字と一致する

高橋くんは、10秒間にできるだけ多くの単語を発言する練習をしています。
高橋くんが発言した単語の個数Nとi番目に発言した単語Wiが与えられるので、
どの発言もしりとりのルールを守っていたかを判定してください。
"""
def check(words):
    answer = "Yes"

    # 同じ単語を使っていないか確認
    for i in range(0, len(words)):
        for j in range(i+1, len(words)):
            if(words[i] == words[j]):
                answer = "No"

    # 単語の最初と最後が一致しているか確認
    for i in range(0, len(words)-1):
        if(words[i][-1] != words[i+1][0]):
            answer = "No"

    return answer


def main(words):
    answer = check(words)
    print(answer)


if __name__ == "__main__":
    num = int(input())  # 単語の個数の読み込み
    str = [input() for i in range(0, num)]  # 単語の読み込み
    main(str)
Buggy python submission (verdict: Runtime Error):
import numpy as np


def num_even_odd(num):
  num_odd = np.ceil(num/2)
  num_even = num//2
  return num_odd, num_even


def main(num):
  odds, evens = num_even_odd(num)
  print(odds * evens)


if __name__ == "__main__":
  main(input())

Fixed submission:
import numpy as np


def num_even_odd(num):
    num_odd = np.ceil(num/2)
    num_even = num//2
    return num_odd, num_even


def main(num):
    odds, evens = num_even_odd(num)
    print(int(odds * evens))


if __name__ == "__main__":
    main(int(input()))
Buggy python submission (verdict: Runtime Error):
s = [int(input()) for i in range(3)]
s = list(set(s))
print(len(s))

Fixed submission:
s = list(map(int, input().split()))
s = list(set(s))
print(len(s))
Buggy python submission (verdict: Runtime Error):
s = list(map(int, input().split()))
if s[0] > s[1]:
    print((s[1] * s[2] + (s[0] - s[1]) * s[3]))
          
else:
    print(s[0]*s[2])

Fixed submission:
s = [int(input()) for i in range(4)]
if s[0] > s[1]:
    print((s[1] * s[2] + (s[0] - s[1]) * s[3]))
          
else:
    print(s[0]*s[2])

Buggy python submission (verdict: Runtime Error):
s = list(map(int, input().split()))
if s[0] > s[1]:
    print((s[1] * s[2] + (s[0] - s[1]) * s[3]))
          
else:
    print(s[0]*s[2])

Fixed submission:
s = [int(input()) for i in range(4)]
if s[0] > s[1]:
    print((s[1] * s[2] + (s[0] - s[1]) * s[3]))
          
else:
    print(s[0]*s[2])
Buggy python submission (verdict: Runtime Error):
#106a
a,b=map(int,input().split())
pritn((a-1)*(b-1))

Fixed submission:
#106a
a,b=map(int,input().split())
print((a-1)*(b-1))
Buggy python submission (verdict: Runtime Error):
#106b
n = int(input())
ans=0
for i in range(1,n+1,2):
    c=0
    for j in range(1,i+1):
        if i%j==0:
            c+=1
            
    if c==8:
        a+=1
print(ans)

Fixed submission:
#107b
n=int(input())


if n<105:
    print(0)
elif n<135:
    print(1)
elif n<165:
    print(2)
elif n<189:
    print(3)
elif n<195:
    print(4)
else:
    print(5)

Buggy python submission (verdict: Runtime Error):
#106b
n = int(input())
ans=0
for i in range(1,n+1,2):
    c=0
    for j in range(1,i+1):
        print(i,j)
        if i%j==0:
            c+=1
            
    if c==8:
        a+=1
print(ans)

Fixed submission:
#107b
n=int(input())


if n<105:
    print(0)
elif n<135:
    print(1)
elif n<165:
    print(2)
elif n<189:
    print(3)
elif n<195:
    print(4)
else:
    print(5)
Buggy python submission (verdict: Runtime Error):
#105b
n=int(input())
x = n//4
if n%4==0 or n%11==0:
    print('Yes')
    exit()
else:
    for i in range(x):
        for j in range(x):
            temp=4*i+7*j
            if temp==n:
                print('Yes')
                exit()
print('No')

Fixed submission:
n,k=map(int,input().split())
print(0 if n%k==0 else 1)
Buggy python submission (verdict: Runtime Error):
参りました

Fixed submission:
#103a
a=list(map(int,input().split()))
print(max(a)-min(a))
Buggy python submission (verdict: Runtime Error):
n = input()

s = sum([int(i) for i in n])

if int(n)%s==0:
    print('Yes')
else:
    print('No')


Fixed submission:
s = input()
ans = 0
for n in s:
    if n == '+': ans += 1
    else: ans -= 1
print(ans)

Buggy python submission (verdict: Runtime Error):
n = input()

s = sum((int(i) for i in n))

if int(n)%s==0:
    print('Yes')
else:
    print('No')





Fixed submission:
s = input()
ans = 0
for n in s:
    if n == '+': ans += 1
    else: ans -= 1
print(ans)

Buggy python submission (verdict: Runtime Error):
n = input()

s = sum((int(i) for i in n))

if int(n)%s==0:
    print('Yes')
else:
    print('No')





Fixed submission:
s = input()
ans = 0
for n in s:
    if n == '+': ans += 1
    else: ans -= 1
print(ans)
Buggy python submission (verdict: Runtime Error):
#97a
n = int(input())
array = []
for i in range(1,33):
    for j in range(2,10):
        a = i**j
        if a <= n:
            array.append(a)
print(array[-1])

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

if a<=b<=c or c<=b<=a:
    if abs(a-b)<=d and abs(c-b)<=d:
        print('Yes')

    else:
        print('No')
else:
    if abs(a-c)<=d:
        print('Yes')
    else:
        print('No')

Buggy python submission (verdict: Runtime Error):
#97a
a,b,,c,d=map(int,input().split())
print('Yes' if b-a>=d and c-b>=d else 'No')

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

if a<=b<=c or c<=b<=a:
    if abs(a-b)<=d and abs(c-b)<=d:
        print('Yes')

    else:
        print('No')
else:
    if abs(a-c)<=d:
        print('Yes')
    else:
        print('No')
Buggy python submission (verdict: Runtime Error):
#97b
x = int(input())
array = []
for i in range(1,33):
    for j in range(2,10):
        a = i**j
        if a <= n:
            array.append(a)
array.sort(reverse=True)
print(array[0])


Fixed submission:
#97b
x = int(input())
array = []
for i in range(1,33):
    for j in range(2,10):
        a = i**j
        if a <= x:
            array.append(a)
array.sort(reverse=True)
print(array[0])
Buggy python submission (verdict: Runtime Error):
#94b
n,m,x=map(int,input().split())
ans=[0 for i in range(n+2)]
a=map(int,input().split())
for i in a:
    i=i+
    ans[i]=1

if x==n:
    print(0)
else:
    print(min(sum(ans[:x+1]),sum(ans[-x:])))
    

Fixed submission:
#94b
n,m,x=map(int,input().split())
a=map(int,input().split())

up=0
down=0

for i in a:
    if i>x:
        up+=1
    else:
        down+=1
print(min(up,down))
Buggy python submission (verdict: Runtime Error):
#93b
a,b,k=map(int,input().split())
ans=range(a,b+1)
for i in sorted(set(ans[:k])):# set(ans[-k:])):
    print(i)
for i in sorted(set(ans[-k:])):
    print(i)
#print(sorted(set(ans[:k]) or set(ans[-k:])))

Fixed submission:
#93a
s=set(input())
x=set(list('abc'))


print('Yes' if s==x else 'No')

Buggy python submission (verdict: Runtime Error):
#93b
a,b,k=map(int,input().split())
ans=range(a,b+1)
for i in sorted(set(a[:k])):
    print(i)
for i in sorted(set(a[-k:])):
    print(i)

Fixed submission:
#93a
s=set(input())
x=set(list('abc'))


print('Yes' if s==x else 'No')

Buggy python submission (verdict: Runtime Error):
#93a
s=set(input())
x=set(lit('abc'))
print('Yes' if s-x==0 else 'No')


Fixed submission:
#93a
s=set(input())
x=set(list('abc'))


print('Yes' if s==x else 'No')
Buggy python submission (verdict: Runtime Error):
#93b
a,b,k=map(int,input().split())
ans=[]

if abs(a-b)<=k:
    for _ in range(b-a+1):
        print(a+i)
    exit()
else:
    for i in range(k):
        ans.append(a+i)
        
    for i in range(k):
        ans.append(b-k+i+1)
       
ans=set(ans)
for i in ans:
    print(i)

Fixed submission:
#93b
a,b,k=map(int,input().split())
c=min(a+k,b)
for i in range(a,c):print(i)
for i in range(max(c,b-k+1),b+1):print(i)
Buggy python submission (verdict: Runtime Error):
#91b
import collections as c

n=int(input())
b_l=sorted([input() for _ in range(n)])
b=c.Counter(b_l)
b=b.most_common()

m=int(input())
r_l=sorted([input() for _ in range(m)])
r=c.Counter(r_l)
r=r.most_common()
ans=0
i=0
while i<=m-1:
    if b[i][0]==r[i][0]:
        temp=b[0][1]-r[0][1]
        i+=1
        if temp>0:
            ans=max(temp,ans)
print(ans)




Fixed submission:
#91b
n=int(input())
s=[input() for _ in range(n)]

m=int(input())
t=[input() for _ in range(m)]
ans=0

st=set(s+t)
for i in st:
    ans = max(s.count(i) - t.count(i) , ans)
print(ans)
Buggy python submission (verdict: Runtime Error):
#89b
n=int(input())
a=list(input())
a=set(a)
c=['P','W','G','Y']
if c-a==0:
    print('Four')
else:
    print('Three')

Fixed submission:
#89b
n=int(input())
a=list(set(input()))
print('Three' if len(a)==4 else 'Four')
Buggy python submission (verdict: Runtime Error):
#85b
n=int(input())
d=set([int(input()) for i in range(n) ])
print(len(d))

Fixed submission:
#85a
s=input()
print('2018'+s[4:])