Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n=input()
graph=[[] for i in range(n+1)]
for i in range(n-1):
    v,u=list(map(int,raw_input().split()))
    graph[v].append(u)
    graph[u].append(v)

dist= [-1 for i in range(n+1)]
dist[1]=0
son=[[] for i in range(n+1)]
queue=[1]
father=[0 for i in range(n+1)]
def bfs(u):
    for v in graph[u]:
        if dist[v]==-1:
            dist[v]=dist[u]+1
            son[u].append(v)
            father[v]=u
            queue.append(v)
    queue.pop(0)
    if len(queue)!=0:
        bfs(queue[0])

bfs(1)
road=[n]
tempfather=n
for i in range(dist[n]):
    road.append(father[tempfather])
    tempfather=father[tempfather]

di=len(road)
k=road[(di-2)/2]

def countson(u):
  count=0
  if len(son[u])==0:return 1
  for v in son[u]:
      count+=countson(v)
  return count+1

cs=countson(k)
cf=n-cs

if cs>=cf:print 'Snuke'
else:
    print 'Fennec'


Fixed submission:
import sys
sys.setrecursionlimit(1000000)
n=input()
graph=[[] for i in range(n+1)]
for i in range(n-1):
    v,u=list(map(int,raw_input().split()))
    graph[v].append(u)
    graph[u].append(v)

dist= [-1 for i in range(n+1)]
dist[1]=0
son=[[] for i in range(n+1)]
queue=[1]
father=[0 for i in range(n+1)]
def bfs(u):
    for v in graph[u]:
        if dist[v]==-1:
            dist[v]=dist[u]+1
            son[u].append(v)
            father[v]=u
            queue.append(v)
    queue.pop(0)
    if len(queue)!=0:
        bfs(queue[0])

bfs(1)
road=[n]
tempfather=n
for i in range(dist[n]):
    road.append(father[tempfather])
    tempfather=father[tempfather]

di=len(road)
k=road[(di-2)/2]

def countson(u):
  count=0
  if len(son[u])==0:return 1
  for v in son[u]:
      count+=countson(v)
  return count+1

cs=countson(k)
cf=n-cs

if cs>=cf:print 'Snuke'
else:
    print 'Fennec'
Buggy python submission (verdict: Runtime Error):
if (a+b)%3 or a%3 or b%3==0:
    print ('Possible')
else: print('Impossible')

Fixed submission:
c= [int (i) for i in input().split()]
if sum(c)%3==0 or c[0]%3==0 or c[1]%3 ==0:
	print('Possible')
else: print('Impossible')

Buggy python submission (verdict: Runtime Error):
if __name__=='__main__':
    alls = int(input())
    num_src = input().split(' ')
    num_cards = []
    ans = 0
    for i in num_src:
        num_cards.append(int(i))
        ans += abs(int(i))
    x = 0
    y = 0
    for i in range(0,alls-1):
        x=0
        y=0
        for j in range(0,alls):
            if j <= i:
                x += num_cards[j]
            else:
                y += num_cards[j]
        if y<x:
            tmp = abs(x-y)
        else:
            tmp = abs(y-x)
        if tmp < ans:
            ans = tmp
    print(ans)

Fixed submission:
if __name__=='__main__':
    in_src = input()
    in_str = in_src.split(' ')
    in_num = []
    for i in in_str:
        in_num.append(int(i))
    if in_num[0]%3==0:
        print('Possible')
    elif in_num[1]%3==0:
        print('Possible')
    elif (in_num[0]+in_num[1])%3==0:
        print('Possible')
    else:
        print('Impossible')

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import sys

A, B = map(int, input().split())

C = A + B

if A%3 == 0:
    print('Possible')
else if B%3 == 0:
    print('Possible')
else if C%3 == 0:
    print('Possible')
else:
    print('Impossible')

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

A, B = map(int, input().split())

C = A + B

if A%3 == 0:
    print('Possible')
elif B%3 == 0:
    print('Possible')
elif C%3 == 0:
    print('Possible')
else:
    print('Impossible')
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import sys

N, K = map(int, input().split())
l = list(map(int, input().split()))

l.sort()

X = range(K, -1, -1)

s = 0
for i in range(K, K-N+1, -1):
    s += l[i]

print(l, s, X)

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

N, K = map(int, input().split())
l = list(map(int, input().split()))

l.sort()
s = 0
for i in range(K):
    s += l[N-K+i]

print(s)

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import sys

N, K = map(int, input().split())
l = list()
for i in range(N):
    l.append( map( int, input().split() ) )

l.reverse()

for i in range(K)
    sum += a[i]

print(sum)

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

N, K = map(int, input().split())
l = list(map(int, input().split()))

l.sort()
s = 0
for i in range(K):
    s += l[N-K+i]

print(s)
Buggy python submission (verdict: Runtime Error):
#coding:utf-8

input_line1 = raw_input()
input_line2 = raw_input()

if input_line1 + input_line2 >= 10:
	print 'error'

else:
	print input_line1 + input_line2


Fixed submission:
#coding:utf-8

l = map(int, raw_input().split())

if l[0] + l[1] >= 10:
	print 'error'

else:
	print l[0] + l[1]
Buggy python submission (verdict: Runtime Error):
i = int(raw_input().split())
if i[0] <= i[2] <= i[1]:
 print("Yes")
else:
 print("No")

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

Buggy python submission (verdict: Runtime Error):
i = raw_input().split()
if i[0] <= i[2] <= i[1]:
 print("Yes")
else:
 print("No")

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

Buggy python submission (verdict: Runtime Error):
i = int(input().split())
if (i[0] <= i[2]) and (i[1] >= i[2]):
    print("Yes")
else:
    print("No")

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

Buggy python submission (verdict: Runtime Error):
i = int(input().split())
if (i[0] <= i[2]) && (i[1] >= i[2]):
    print("Yes")
else:
    print("No")

Fixed submission:
i = input().split()
if int(i[0]) <= int(i[2]) <= int(i[1]):
 print("Yes")
else:
 print("No")
Buggy python submission (verdict: Runtime Error):
right_list=[] #右に進む
left_list=[] #左に進む
diff_list=[] #差分

right_list.append(l[0])
left_list.append(l[n-1])

for i in range(1,n):
    right_list.append(right_list[i-1]+l[i])
    left_list.append(left_list[i-1]+l[n-1-i])

left_list.reverse()

for i in range(0,n-1):
    diff_list.append(abs(right_list[i]-left_list[i+1]))

print(min(diff_list))

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

right_list=[] #右に進む
left_list=[] #左に進む
diff_list=[] #差分

right_list.append(l[0])
left_list.append(l[n-1])

for i in range(1,n):
    right_list.append(right_list[i-1]+l[i])
    left_list.append(left_list[i-1]+l[n-1-i])

left_list.reverse()

for i in range(0,n-1):
    diff_list.append(abs(right_list[i]-left_list[i+1]))

print(min(diff_list))
Buggy python submission (verdict: Runtime Error):
w=input()
list=w.spilt()
YN="Yes"

for i in list:
  if w.count(i)%2!=0:
    YN="No"
    break

print(YN)


Fixed submission:
w=list(input())
YN=True
 
for i in w:
  if w.count(i)%2!=0:
    YN=False
    break
 
print("Yes" if YN else "No")
Buggy python submission (verdict: Time Limit Exceeded):
import sys

stdin = sys.stdin

ns = lambda: stdin.readline()
ni = lambda: int(ns())
na = lambda: list(map(int,stdin.readline().split()))

n = ni()
a = na()

ret = []
for i, x in enumerate(a):
    ret.append(x)
    ret.reverse()

ans = ""
for i, x in enumerate(ret):
    ans += str(x)
    if (i!=n-1): ans += " "
    
print (ans)

Fixed submission:
import sys

stdin = sys.stdin

ns = lambda: stdin.readline()
ni = lambda: int(ns())
na = lambda: list(map(int,stdin.readline().split()))

n = ni()
a = na()

l = []
m = []
for i, x in enumerate(a):
    if (i%2==1):
        l.append(x)
    else:
        m.append(x)

if (n%2==0):
    l.reverse()
    l.extend(m)
    ret = l
else:
    m.reverse()
    m.extend(l)
    ret = m

ans = ""
for i, x in enumerate(ret):
    ans += str(x)
    if (i!=n-1): ans += " "
    
print (ans)
Buggy python submission (verdict: Runtime Error):
import sys

stdin = sys.stdin

ns = lambda: stdin.readline()
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))

class UnionFind:
    def __init__(self, size):
        self.table = [-1 for _ in range(size)]

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

    def union(self, x, y):
        s1 = self.find(x)
        s2 = self.find(y)
        if s1 != s2:
            if self.table[s1] <= self.table[s2]:
                self.table[s1] += self.table[s2]
                self.table[s2] = s1
            else:
                self.table[s1] = s2
                self.table[s2] += self.table[s1]
            return True
        return False

N = ni()
a = []
b = []
for i in range(N):
    x, y = na()
    a.append((x, i))
    b.append((y, i))

a.sort()
b.sort()
t = []
for i in range(1, N):
    t.append((a[i][0]-a[i-1][0], a[i][1], a[i-1][1]))
    t.append((b[i][0]-b[i-1][0], b[i][1], b[i-1][1]))

t.sort()
ans = 0
uf = UnionFind(N)
for c, d, e in t:
    if uf.union(d,e):
        ans += c

print(ans)
    

Fixed submission:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
 
sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7
 
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
 
 
class UnionFind:
    def __init__(self, size):
        self.table = [-1 for _ in range(size)]
 
    def find(self, x):
        if self.table[x] < 0:
            return x
        else:
            self.table[x] = self.find(self.table[x])
            return self.table[x]
 
    def union(self, x, y):
        s1 = self.find(x)
        s2 = self.find(y)
        if s1 != s2:
            if self.table[s1] <= self.table[s2]:
                self.table[s1] += self.table[s2]
                self.table[s2] = s1
            else:
                self.table[s2] += self.table[s1]
                self.table[s1] = s2
            return True
        return False
 
    def subsetall(self):
        a = []
        for i in range(len(self.table)):
            if self.table[i] < 0:
                a.append((i, -self.table[i]))
        return a
 
def main():
    N = I()
    a = []
    b = []
    for i in range(N):
        x,y = LI()
        a.append((x,i))
        b.append((y,i))
    a.sort()
    b.sort()
    t = []
    for i in range(1,N):
        t.append((a[i][0]-a[i-1][0], a[i][1], a[i-1][1]))
        t.append((b[i][0]-b[i-1][0], b[i][1], b[i-1][1]))
    t.sort()
    r = 0
    uf = UnionFind(N)
    for c,d,e in t:
        if uf.union(d,e):
            r += c
 
    return r
 
print(main())
Buggy python submission (verdict: Runtime Error):
import sys
 
stdin = sys.stdin
 
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()
 
n = ni()
a = na()
f = [0]*8
sp = 0
for v in a:
    if v >= 3200:
        sp += 1
    else:
        f[v//400] = 1

print(sum(f))
if sum(f) > 0:
    print("{} {}".format(sum(f), sum(f)+sp))
else:
    print("{} {}".format(sum(f)+min(sp,1), sum(f)+sp))

Fixed submission:
import sys

r, g, b = map(int, input().split())
if ((r*100+g*10+b)%4==0):
    print ("YES")
else:
    print ("NO")
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
As = [int(x) for x in input().split()]
S = sum(As)

ans = None
for i in range(1,N):
    subs = sum(As[:i])
    temp = abs(2 * subs - S)
    if ans is None or temp < ans:
        ans = temp
print(ans)


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

ans = None
subsum = 0
for i in range(1,N):
    subsum += As[i-1]
    temp = abs(2 * subsum - S)
    if ans is None or temp < ans:
        ans = temp
print(ans)

Buggy python submission (verdict: Runtime Error):
N = int(input())
As = [int(x) for x in input().split()]
S = sum(As)

print(S)
for i in range(1,N):
    subs = sum(As[:i])
    temp = abs(2 * subs - S)
    if ans is None or temp < ans:
        ans = temp
print(ans)


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

ans = None
subsum = 0
for i in range(1,N):
    subsum += As[i-1]
    temp = abs(2 * subsum - S)
    if ans is None or temp < ans:
        ans = temp
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = [int(x) for x in input().split()]
b = []
for i in range(n):
    b.append(a[i])
    b.reverse()
print(" ".join(map(str, b)))


Fixed submission:
a, b, c = map(int, input().split())
li = [a,b,c]
li.sort()
print(li[0] + li[1])
Buggy python submission (verdict: Time Limit Exceeded):
#coding: utf-8
import sys
import math
N, M = map(int, input().split())
if abs(N-M) > 1:
    print(0)
    sys.exit()
elif N == M:
    ans = math.factorial(N) * math.factorial(M) * 2
else:
    ans = math.factorial(N) * math.factorial(M)
print(ans)


Fixed submission:
#coding: utf-8
import sys

memo = {1:1}
def factorial(n):
    for i in range(len(memo)+1,n+1):
        if n not in memo:
            memo[i] = memo[i-1] * i % int(1e9+7)
    return memo[n]

N, M = map(int, input().split())
if abs(N-M) > 1:
    print(0)
    sys.exit()
elif N == M:
    ans = factorial(N) * factorial(M) * 2
else:
    ans = factorial(N) * factorial(M)
ans = ans % int(1e9+7)
print(ans)
Buggy python submission (verdict: Runtime Error):
import sys

def diff(N,A,B,C,D):
    mini = (B+(N-1)*D-A)/(C+D)
    for i in xrange(mini, N-1):
        lower_bound = A + i*C - (N-i-1)*D
        upper_bound = A + i*D - (N-i-1)*C
        print(lower_bound, upper_bound)
        if lower_bound <= B and B <= upper_bound:
            return True
        elif B < lower_bound:
            return False

str = sys.stdin.readline().strip() #"491995 412925347 825318103 59999126 59999339"
N,A,B,C,D = map(int,str.strip().split(" "))
print("YES" if diff(N,A,B,C,D) else "NO")


Fixed submission:
import sys

def diff(N,A,B,C,D):
    mini = (B+(N-1)*D-A)/(C+D)
    for i in range(int(mini), N-1):
        lower_bound = A + i*C - (N-i-1)*D
        upper_bound = A + i*D - (N-i-1)*C
        #print(lower_bound, upper_bound)
        if lower_bound <= B and B <= upper_bound:
            return True
        elif B < lower_bound:
            return False

str = sys.stdin.readline().strip() #"491995 412925347 825318103 59999126 59999339"
N,A,B,C,D = map(int,str.strip().split(" "))
print("YES" if diff(N,A,B,C,D) else "NO")
Buggy python submission (verdict: Time Limit Exceeded):
N=input()
a=map(int,raw_input().split())
check=[]
ans=0
for i,a_i in enumerate(a):
    if i in check:
        continue
    else:
        if i+1==a[a_i-1]:
            ans+=1
            check.append(a_i-1)
print ans


Fixed submission:
N=input()
a=map(int,raw_input().split())
ans=0
for i,a_i in enumerate(a):
    if i+1==a[a_i-1]:
        ans+=1
print ans/2
Buggy python submission (verdict: Runtime Error):
N = int(input())
s = input()
t = input()

for i in range(1, N):
    if s[i:] == t[:-i]:
        k = N - i
        break

if s == t:
    print(N)
else:
    print(2 * N - k)

Fixed submission:
N = int(input())
s = input()
t = input()

k = 0
for i in range(1, N):
    if s[i:] == t[:-i]:
        k = N - i
        break

if s == t:
    print(N)
else:
    print(2 * N - k)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [int(input()) for i in range(n)]

def three_change(i):
    a[i], a[i + 2] = a[i + 2], a[i]

def two_change(i):
    a[i],a[i + 1] = a[i + 1], a[i]

sorted_a = a[:]
sorted_a = sorted(sorted_a)


tar_ind = n - 1
count = 0
while (tar_ind >= 0):
    target = sorted_a[tar_ind]
    if(target != a[tar_ind]):
        cur_ind = a.index(target)
        tmp = tar_ind - cur_ind
        m2 = tmp // 2
        m1 = tmp % 2
        count += m1
        for i in range(m2):
            three_change(cur_ind)
            cur_ind += 2
        for i in range(m1):
            two_change(cur_ind)
            cur_ind += 1
    tar_ind -= 1

print(count)


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

even_num = set([a[i] for i in range(0,n) if i % 2 == 0])

a = sorted(a)

odd_num = set([a[i] for i in range(0, n) if i % 2 == 1])

count = len(even_num & odd_num)
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
k,s = map(int, input().split())

cnt = 0

for x in range(k+1):
    for y in range(k+1):
        for z in range(k+1):
            if s==x+y+z:
                cnt=cnt+1
            else:
                continue
    
print(cnt)
    

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

cnt = 0

for x in range(k+1):
    for y in range(k+1):
        z=s-x-y
        if 0<=z<=k:
            cnt=cnt+1
        else:
            continue
    
print(cnt)
Buggy python submission (verdict: Runtime Error):
s = {input() for i in range(3)}
N = len(s)
print(N)

Fixed submission:
s = set(input().split())
N = len(s)
print(N)
Buggy python submission (verdict: Runtime Error):
s = input().split()
s5 = s.count("5")
s7 = s.count("7")

if s5 == 2:
  if s7 == 1:
    print("YES")
    else:
      print("NO")
else:
    print("NO")

Fixed submission:
s = input().split()
s5 = s.count("5")
s7 = s.count("7")
 
if s5 == 2:
    if s7 == 1:
  	    print("YES")
    else:
        print("NO")
else:
    print("NO")

Buggy python submission (verdict: Runtime Error):
s = input().split()
s5 = s.count("5")
s7 = s.count("7")
    
if s5 = 2 :
    if s7 = 1 :
        print("YES")
    else :
        print("NO")
else:
    print("NO")

Fixed submission:
s = input().split()
s5 = s.count("5")
s7 = s.count("7")
 
if s5 == 2:
    if s7 == 1:
  	    print("YES")
    else:
        print("NO")
else:
    print("NO")
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
n = int(input())
a = list(map(int, input().split()))
b = []
for i in range(n):
    b.append(a[i])
    b.reverse()

for i in b:
    print('{} '.format(i), end='')
print()


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

n = int(input())
a = list(map(int, input().split()))
b = collections.deque()

for i in range(n):
    if i % 2 == 0:
        b.appendleft(a[i])
    else:
        b.append(a[i])

if n % 2 == 0:
    b.reverse()

for i in b:
    print('{} '.format(i), end='')
print()
Buggy python submission (verdict: Runtime Error):
s = input()

s = s[:-1]
if len(s) % 2 != 0:
    s = s[:-1]


while(True):
    s1, s2 = zip(*[iter(s)]*2)
    if s1 is s2:
        print(s1)
        break

    s = s[:-2]
    

Fixed submission:
s = input()

s = s[:-1]
if len(s) % 2 != 0:
    s = s[:-1]


while(True):
    s1, s2 = s[0:len(s)//2], s[len(s)//2:len(s)]
    if s1 == s2:
        print(len(s1)*2)
        break

    s = s[:-2]

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

s = a[:-1]
if len(s) % 2 != 0:
    s = s[:-1]


while(True):
    s1, s2 = zip(*[iter(s)]*2)
    if s1 is s2:
        print(s1)
        break

    s = s[:-2]

Fixed submission:
s = input()

s = s[:-1]
if len(s) % 2 != 0:
    s = s[:-1]


while(True):
    s1, s2 = s[0:len(s)//2], s[len(s)//2:len(s)]
    if s1 == s2:
        print(len(s1)*2)
        break

    s = s[:-2]
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
a = input().split()
b=[]
for i in range(N):
    b.append(a[i])
    b = b[::-1] #revese
print(" ".join(b))

Fixed submission:
N = int(input())
a = input().split()
if N%2==0:
    ans=a[::-2] + a[::2]
else:
    ans=a[::-2] + a[1::2]
print(" ".join(ans))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
m = [int(x) for x in input().strip().split()]
nm = []
for i in range(len(m)):
    nm.append(m[i])
    nm.reverse()
for i,x in enumerate(nm):
    if i == len(nm)-1:
        print(str(x), end='')
    else:
        print(str(x) + ' ', end='')

Fixed submission:
n = int(input())
m = [int(x) for x in input().strip().split()]
if n % 2 == 0:
    nm = m[::-2] + m[::2]
else:
    nm = m[::-2] + m[1::2]
for i,x in enumerate(nm):
    if i == n-1:
        print(str(x), end='')
    else:
        print(str(x) + ' ', end='')
Buggy python submission (verdict: Runtime Error):
l = raw_input().split()
w1 =  l[0].upper()
w2 =  l[1].upper()
w3 =  l[2].upper()
print w1[:1] + w2[:1] + w3[:1]

Fixed submission:
l = raw_input().split()
w1 =  l[0].upper()
w2 =  l[1].upper()
w3 =  l[2].upper()
print w1[:1] + w2[:1] + w3[:1]

Buggy python submission (verdict: Runtime Error):
l = raw_input().split()
w1 =  l[0].upper()
w2 =  l[1].upper()
w3 =  l[2].upper()
print w1[:1] + w2[:1] + w3[:1]

Fixed submission:
l = raw_input().split()
w1 =  l[0].upper()
w2 =  l[1].upper()
w3 =  l[2].upper()
print w1[:1] + w2[:1] + w3[:1]
Buggy python submission (verdict: Runtime Error):
A = int(input())
B = int(input())
if A == B:
	print "EQUAL"
elif A < B:
	print "LESS"
else:
	print "GREATER"

Fixed submission:
A = int(input())
B = int(input())
if A == B:
	print "EQUAL"
elif A < B:
	print "LESS"
else:
	print "GREATER"

Buggy python submission (verdict: Runtime Error):
A = int(input())
B = int(input())
if A == B:
	print "EQUAL"
elif A < B:
	print "LESS"
else:
	print "GREATER"

Fixed submission:
A = int(input())
B = int(input())
if A == B:
	print "EQUAL"
elif A < B:
	print "LESS"
else:
	print "GREATER"

Buggy python submission (verdict: Runtime Error):
A = int(input())
B = int(input())
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 "EQUAL"
elif A < B:
	print "LESS"
else:
	print "GREATER"
Buggy python submission (verdict: Runtime Error):
b=10**9+7
num = [-1]*(n+1)
temp=1
temp2=1
for i in range(len(a)):
        if num[a[i]] != -1:
                p1,p2=num[a[i]],i
        num[a[i]]=i
for k in range(1,len(a)+1):
        if k == 1:
                print(n)
        
        elif k == len(a):
                print(1)
        else:
                for l in range(k): 
                        temp=temp*(n+1-l)/(k-l) 
                        if k-l-1 > 0: 
                                temp2=temp2*(n-p2+p1-l)/(k-l-1) 
                print(int((temp-temp2)%b)) 
                temp = 1        
                temp2 =1 

Fixed submission:
data=list(map(int,input().split()))
data.sort()
print(data[1]+data[0])
Buggy python submission (verdict: Time Limit Exceeded):
from collections import deque

n = int(input())
l = list(map(int, input().split()))

b = deque()
for i in range(n):
    b.append(str(l[i]))
    b.reverse()

print(' '.join(b))

Fixed submission:
from collections import deque

n = int(input())
l = list(map(int, input().split()))

b = deque()
for i in range(n):
    if (n % 2 == 0 and (i+1) % 2 == 0) or (n % 2 != 0 and (i+1) % 2 != 0):
        b.appendleft(l[i])
    else:
        b.append(l[i])

print(' '.join(map(str, b)))

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

b = []
for i in range(n):
    if (n % 2 == 0 and (i+1) % 2 == 0) or (n % 2 != 0 and (i+1) % 2 != 0):
        b.insert(0, l[i])
    else:
        b.append(l[i])

print(' '.join(map(str, b)))

Fixed submission:
from collections import deque

n = int(input())
l = list(map(int, input().split()))

b = deque()
for i in range(n):
    if (n % 2 == 0 and (i+1) % 2 == 0) or (n % 2 != 0 and (i+1) % 2 != 0):
        b.appendleft(l[i])
    else:
        b.append(l[i])

print(' '.join(map(str, b)))

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

b = []
for i in range(n):
    b.append(str(l[i]))
    b.reverse()

print(' '.join(b))

Fixed submission:
from collections import deque

n = int(input())
l = list(map(int, input().split()))

b = deque()
for i in range(n):
    if (n % 2 == 0 and (i+1) % 2 == 0) or (n % 2 != 0 and (i+1) % 2 != 0):
        b.appendleft(l[i])
    else:
        b.append(l[i])

print(' '.join(map(str, b)))
Buggy python submission (verdict: Runtime Error):
l = list(map(int, input().split()))
if l[1]+l[2] < l[0]:
    print("delicious")
else:
    if l[2]-l[1] <= l[0]:
        print("safe")
    else:
        print("dangerous")
c


Fixed submission:
l = list(map(int, input().split()))
border = l[1] - l[2]
if border < 0:
    if l[0] >= abs(border):
        print("safe")
    else:
        print("dangerous")
else:
    print("delicious")