Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
# coding:utf-8

import sys
from collections import deque, defaultdict

INF = float('inf')
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 LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return input()


def main():
    n, m = LI()

    G = defaultdict(list)
    deg = [0] * n
    for _ in range(m):
        a, b = LI_()
        G[a].append(b)
        G[b].append(a)
        deg[a] += 1
        deg[b] += 1

    ss = []
    for i in range(n):
        if deg[i] == 1:
            s = i
            ss = []
            break
        if deg[i] % 2 == 0:
            ss.append(i)

    if not ss:
        print(2)
        print(*[s + 1, G[s][0] + 1])
        exit()

    def DFS(v: int, res: list, visited: set, needs: set) -> None:
        res.append(v + 1)
        visited.add(v)
        needs -= set([v])
        if not needs:
            print(len(res))
            print(*res)
            exit()

        for to in G[v]:
            if to in visited:
                continue
            DFS(to, res, visited, needs)

    for s in ss:
        DFS(G[s][0], [s+1], set([s]), set(G[s][1:]))


main()


Fixed submission:
# coding:utf-8

import sys
from collections import deque, defaultdict

INF = float('inf')
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 LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return input()


def main():
    n, m = LI()

    G = defaultdict(list)
    S = defaultdict(set)
    for _ in range(m):
        a, b = LI_()
        G[a].append(b)
        G[b].append(a)
        S[a].add(b)
        S[b].add(a)

    res = deque([0, G[0][0]])
    visited = set(res)
    needs = S[res[0]] | S[res[-1]] - visited
    while needs:
        v = needs.pop()
        if v in visited:
            continue
        visited.add(v)
        if v in S[res[0]]:
            res.appendleft(v)
        else:
            res.append(v)
        needs = (S[res[0]] | S[res[-1]]) - visited

    print(len(res))
    print(*[v + 1 for v in res])


main()
Buggy python submission (verdict: Time Limit Exceeded):
N = int(raw_input())
x = 1
for i in xrange(N):
    x *= i+1

print x%1000000007

Fixed submission:
# coding:utf-8

import sys
# from collections import Counter, defaultdict

INF = float('inf')
MOD = 10 ** 9 + 7

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return input()


n = II()

ans = 1
for i in range(1, n + 1):
    ans *= i
    ans %= MOD

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
# coding:utf-8

INF = float('inf')


def inpl(): return list(map(int, input().split()))


N, x = inpl()
A = inpl()

min_index = A.index(min(A))
B = A[min_index:] + A[:min_index]

cost = [[INF] * N for i in range(N)]
for i in range(N):
    cost[i][0] = B[i]

for i in range(N):
    for magic in range(1, N):
        cost[i][magic] = min(cost[i][magic], min(B[max(0, i - magic)], cost[i][magic - 1]))

ans = INF
for magic in range(N):
    tmp = 0
    for i in range(N):
        tmp += cost[i][magic]
    ans = min(ans, tmp + magic * x)

print(ans)

Fixed submission:
# coding:utf-8

INF = float('inf')


def inpl(): return list(map(int, input().split()))


N, x = inpl()
A = inpl()

min_cost_s = 0
tmp = INF
for i in range(N):
    if A[i] < tmp:
        min_cost_s = i
        tmp = A[i]

A = A[min_cost_s:] + A[:min_cost_s]
B = [A[i] for i in range(N)]

ans = INF
for shift in range(N):
    for i in range(N):
        if i - shift >= 0:
            B[i] = min(B[i], A[i - shift])
    # print(B)

    ans = min(ans, shift * x + sum(B))

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

import sys
from collections import defaultdict, deque


INF = float('inf')
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 II(): return int(sys.stdin.readline())
def SI(): return input()


def main():
    n, k = LI()
    A = LI_()

    D = defaultdict(list)
    for i in range(1, n):
        D[A[i]].append(i)

    q = deque([(0, 0)])
    # 首都は必ず自己ループでなければならない
    global res
    res = 0 if A[0] == 0 else 1

    def DFS(v, par):
        global res
        h = 0
        for to in D[v]:
            # print('dfs {} -> {}'.format(v+1, to+1))
            # h: 葉からの距離の最大値
            h = max(h, DFS(to, v))
            
        # 根が首都ではなく，高さがk - 1の場合は首都につなぎ直す
        if h == k - 1 and par != 0:
            res += 1
            h = -1
        # print('Finish {} <- {}'.format(par+1, v+1))
        return h + 1

    DFS(0, 0)

    return res


print(main())


Fixed submission:
# coding:utf-8

import sys
from collections import defaultdict

sys.setrecursionlimit(10**7)
INF = float('inf')
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 II(): return int(sys.stdin.readline())
def SI(): return input()


def main():
    n, k = LI()
    A = LI_()

    D = defaultdict(list)
    for i in range(1, n):
        D[A[i]].append(i)

    # 首都は必ず自己ループでなければならない
    global res
    res = 0 if A[0] == 0 else 1

    def DFS(v, par):
        global res
        h = 0
        for to in D[v]:
            # print('dfs {} -> {}'.format(v+1, to+1))
            # h: 葉からの距離の最大値
            h = max(h, DFS(to, v))

        # 根が首都ではなく，高さがk - 1の場合は首都につなぎ直す
        if h == k - 1 and par != 0:
            res += 1
            h = -1
        # print('Finish {} <- {}'.format(par+1, v+1))
        return h + 1

    DFS(0, 0)

    return res


print(main())
Buggy python submission (verdict: Time Limit Exceeded):
# coding:utf-8

INF = float('inf')


def inpl(): return list(map(int, input().split()))


N = int(input())
A = [int(input()) for _ in range(N)]
B = sorted(A)

count = 0
for i in range(N):
    tmp = B.index(A[i])
    diff = abs(i - tmp)
    if diff % 2 == 1:
        count += 1

print(count // 2)


Fixed submission:
# coding:utf-8

INF = float('inf')


def inpl(): return list(map(int, input().split()))


N = int(input())
A = [int(input()) for _ in range(N)]
B = sorted(A)
C = A[::2] + B[1::2]
D = set(C)

print(N - len(D))
Buggy python submission (verdict: Runtime Error):
n, x = map(int, input().split())

def func(a, b):
    if a < b:
        if b%a == 0:
            return (b//a*2 - 1)*a
        else:
            return 2*a + func(a, b-a)
    elif a > b:
        if a%b == 0:
            return (a//b*2 - 1)*b
        else:
            return 2*b + func(a-b, b)
    else:
        return a

if x == n/2:
    print(3*x)
else:
    print(x+(n-x)+func(x,n-x))

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

def func(a, b):
    if a < b:
        if b%a == 0:
            return (b//a*2 - 1)*a
        else:
            q, mod = divmod(b,a)
            return 2*q*a + func(a, mod)
    elif a > b:
        if a%b == 0:
            return (a//b*2 - 1)*b
        else:
            q, mod = divmod(a,b)
            return 2*q*b + func(mod, b)
    else:
        return a

if x == n/2:
    print(3*x)
else:
    print(x+(n-x)+func(x,n-x))

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

def func(a, b):
    if a < b:
        if b%a == 0:
            return b//a*2 - 1
        else:
            return 2*a + func(a, b-a)
    else:
        if a%b == 0:
            return a//b*2 - 1
        else:
            return 2*b + func(a-b, b)

print(x+(n-x)+func(x,n-x))

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

def func(a, b):
    if a < b:
        if b%a == 0:
            return (b//a*2 - 1)*a
        else:
            q, mod = divmod(b,a)
            return 2*q*a + func(a, mod)
    elif a > b:
        if a%b == 0:
            return (a//b*2 - 1)*b
        else:
            q, mod = divmod(a,b)
            return 2*q*b + func(mod, b)
    else:
        return a

if x == n/2:
    print(3*x)
else:
    print(x+(n-x)+func(x,n-x))

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

def func(a, b):
    if a < b:
        if b%a == 0:
            return b/a*2 - 1
        else:
            return 2*a + func(a, b-a)
    else:
        if a%b == 0:
            return a/b*2 - 1
        else:
            return 2*b + func(a-b, b)
            
if x == n/2:
    print(3*x)
else:
    print(x+(n-x)+func(x,n-x))

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

def func(a, b):
    if a < b:
        if b%a == 0:
            return (b//a*2 - 1)*a
        else:
            q, mod = divmod(b,a)
            return 2*q*a + func(a, mod)
    elif a > b:
        if a%b == 0:
            return (a//b*2 - 1)*b
        else:
            q, mod = divmod(a,b)
            return 2*q*b + func(mod, b)
    else:
        return a

if x == n/2:
    print(3*x)
else:
    print(x+(n-x)+func(x,n-x))
Buggy python submission (verdict: Time Limit Exceeded):
# coding:utf-8

import sys
from collections import defaultdict, deque

INF = float('inf')
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 II(): return int(sys.stdin.readline())
def SI(): return input()


def main():
    n, k = LI()

    G = defaultdict(list)
    AB = [LI_() for _ in range(n - 1)]
    for a, b in AB:
        G[a].append(b)
        G[b].append(a)

    def DFS(ss: list, t: int):
        # print([s + 1 for s in ss])
        q = deque()
        for s in ss:
            q.append((s, 0))
        visited = set(ss)
        cnt = 0
        while q:
            v, d = q.pop()
            visited.add(v)
            # print(v + 1, d)
            for to in G[v]:
                if to in visited:
                    continue
                if d + 1 > t:
                    cnt += 1
                q.append((to, d + 1))

        # print(cnt)
        return cnt

    # 木の性質
    # 直径をdとした時
    # dが偶数ならば，ある頂点vから他の頂点への距離がD/2となる頂点vが存在する
    # dが奇数ならば，ある辺eから他の頂点への距離が(D-1)/2となる辺eが存在する
    res = INF
    if k % 2:
        for a, b in AB:
            res = min(res, DFS([a, b], (k - 1) // 2))
    else:
        for i in range(n):
            res = min(res, DFS([i], k // 2))

    return res


print(main())


Fixed submission:
# coding:utf-8

import sys
from collections import defaultdict, deque

INF = float('inf')
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 II(): return int(sys.stdin.readline())
def SI(): return input()


def main():
    n, k = LI()

    G = defaultdict(list)
    AB = [LI_() for _ in range(n - 1)]
    for a, b in AB:
        G[a].append(b)
        G[b].append(a)

    def DFS(ss: list, t: int):
        q = deque()
        for s in ss:
            q.append((s, 0))
        visited = [0] * n
        visited[ss[0]] = visited[ss[-1]] = 1
        while q:
            v, d = q.pop()
            if d >= t:
                continue
            for to in G[v]:
                if visited[to]:
                    continue
                visited[to] = 1
                q.append((to, d + 1))
        
        return n - sum(visited)

    # 木の性質
    # 直径をdとした時
    # dが偶数ならば，ある頂点vから他の頂点への距離がD/2となる頂点vが存在する
    # dが奇数ならば，ある辺eから他の頂点への距離が(D-1)/2となる辺eが存在する
    res = INF
    if k % 2:
        for a, b in AB:
            res = min(res, DFS([a, b], (k - 1) // 2))
    else:
        for i in range(n):
            res = min(res, DFS([i], k // 2))

    return res


print(main())
Buggy python submission (verdict: Runtime Error):
n,m,x,y=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
print("No War" if min(a)<=x<=max(a) and min(b)<=y<=max(b) and max(a) =<min(b) else "War")

Fixed submission:
n,m,x,y=map(int,input().split())
a=list(map(int,input().split()))
a.append(x)
b=list(map(int,input().split()))
b.append(y)
print("No War" if max(a)<min(b) else "War")
Buggy python submission (verdict: Runtime Error):
#coding: utf-8

N = str(input())
sum = 0

for i in range(len(S)):
    sum += int(N[i])

if(int(N)%sum==0):
    print('Yes')
else:
    print('No')

Fixed submission:
#coding: utf-8

N = str(input())
sum = 0

for i in range(len(N)):
    sum += int(N[i])

if(int(N)%sum==0):
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
#coding: utf-8
 
N, K = map(int, input().split())
A = list(map(int, input().split()))
 
if(N==K):
    ans = 1
 
print(ans)

Fixed submission:
#coding: utf-8

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

for i in range(N):
    if(A[i] == 1):
        one = i
        #print('1は',one + 1,'番目')

ans = []

for i in range(K):
    start = one - (K - 1) + i
    end = one + i

    before = start
    after = N - (end+1)

    before_num = before//(K-1)
    if(before%(K-1) != 0):
        before_num += 1

    after_num = after//(K-1)
    if(after%(K-1) != 0):
        after_num += 1

    answer = before_num + after_num + 1
    ans.append(answer)

print(min(ans))

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

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

for i in range(K):
    if(A[i] == 1):
        one = i
        #print('1は',one + 1,'番目')

ans = []

for i in range(K):
    start = one - (K - 1) + i
    end = one + i
    
    before = start
    after = N - (end+1)
    
    before_num = before//(K-1)
    if(before%(K-1) != 0):
        before_num += 1
        
    after_num = after//(K-1)
    if(after%(K-1) != 0):
        after_num += 1
    
    answer = before_num + after_num + 1
    ans.append(answer)

print(min(ans))

Fixed submission:
#coding: utf-8

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

for i in range(N):
    if(A[i] == 1):
        one = i
        #print('1は',one + 1,'番目')

ans = []

for i in range(K):
    start = one - (K - 1) + i
    end = one + i

    before = start
    after = N - (end+1)

    before_num = before//(K-1)
    if(before%(K-1) != 0):
        before_num += 1

    after_num = after//(K-1)
    if(after%(K-1) != 0):
        after_num += 1

    answer = before_num + after_num + 1
    ans.append(answer)

print(min(ans))

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

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

for i in range(K):
    if(A[i] == 1):
        one = i
        #print('1は',one + 1,'番目')

ans = []

for i in range(K):
    start = one - (K - 1) + i
    end = one + i
    
    before = start
    after = N - (end+1)
    
    before_num = before//(K-1)
    if(before%(K-1) != 0):
        before_num += 1
        
    after_num = after//(K-1)
    if(after%(K-1) != 0):
        after_num += 1
    
    answer = before_num + after_num + 1
    ans.append(answer)

print(min(ans))

Fixed submission:
#coding: utf-8

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

for i in range(N):
    if(A[i] == 1):
        one = i
        #print('1は',one + 1,'番目')

ans = []

for i in range(K):
    start = one - (K - 1) + i
    end = one + i

    before = start
    after = N - (end+1)

    before_num = before//(K-1)
    if(before%(K-1) != 0):
        before_num += 1

    after_num = after//(K-1)
    if(after%(K-1) != 0):
        after_num += 1

    answer = before_num + after_num + 1
    ans.append(answer)

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

N = int(sys.stdin)
a = []
for i in range(N):
    a.append(int(sys.stdin))

start = 0
count = 0

for i in range(N):
    count += 1
    next = a[start]
    if(next == 2):
        print(count)
        break
    start = next - 1
else:
    print(-1)

Fixed submission:
#coding: utf-8

N = int(input())
a = []
for i in range(N):
    a.append(int(input()))

start = 0
count = 0

for i in range(N):
    count += 1
    next = a[start]
    if(next == 2):
        print(count)
        break
    start = next - 1
else:
    print(-1)

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

N = sys.stdin
a = []
for i in range(N):
    a.append(int(input()))

start = 0
count = 0

for i in range(N):
    count += 1
    next = a[start]
    if(next == 2):
        print(count)
        break
    start = next - 1
else:
    print(-1)

Fixed submission:
#coding: utf-8

N = int(input())
a = []
for i in range(N):
    a.append(int(input()))

start = 0
count = 0

for i in range(N):
    count += 1
    next = a[start]
    if(next == 2):
        print(count)
        break
    start = next - 1
else:
    print(-1)

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

N = map(int, sys.stdin)
a = []
for i in range(N):
    a.append(int(input()))

start = 0
count = 0

for i in range(N):
    count += 1
    next = a[start]
    if(next == 2):
        print(count)
        break
    start = next - 1
else:
    print(-1)

Fixed submission:
#coding: utf-8

N = int(input())
a = []
for i in range(N):
    a.append(int(input()))

start = 0
count = 0

for i in range(N):
    count += 1
    next = a[start]
    if(next == 2):
        print(count)
        break
    start = next - 1
else:
    print(-1)

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

N = int(sys.stdin)
a = []
for i in range(N):
    a.append(int(input()))

start = 0
count = 0

for i in range(N):
    count += 1
    next = a[start]
    if(next == 2):
        print(count)
        break
    start = next - 1
else:
    print(-1)

Fixed submission:
#coding: utf-8

N = int(input())
a = []
for i in range(N):
    a.append(int(input()))

start = 0
count = 0

for i in range(N):
    count += 1
    next = a[start]
    if(next == 2):
        print(count)
        break
    start = next - 1
else:
    print(-1)
Buggy python submission (verdict: Time Limit Exceeded):
#coding: utf-8

sunuke_pow = 1
N = int(input())
for i in range(N):
    sunuke_pow  *= i+1
ans = sunuke_pow % (10**9 + 7)
print(ans)

Fixed submission:
#coding: utf-8

sunuke_pow = 1
N = int(input())
for i in range(N):
    sunuke_pow *= i+1
    sunuke_pow = sunuke_pow % (10**9 + 7)
print(sunuke_pow)
Buggy python submission (verdict: Runtime Error):
from statistics import mean
import math
x = mean(list(map(int, input().split()))
print(math.ceil(x))

Fixed submission:
import math
a, b = map(int, input().split())
x = (a+b)/2
print(math.ceil(x))
Buggy python submission (verdict: Runtime Error):
r, g, b = input().split()
rgb = map(int, r+g+b)
if rgb%4==0:
  print("YES")
else:
  print("NO")

Fixed submission:
r, g, b = input().split()
rgb = int(r+g+b)
if rgb%4==0:
  print("YES")
else:
  print("NO")
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
h=list(map(int,input().split()))
a=0
for i in range(1,max(h)+1):
    s=0
    while s<n:
        if h[s]>=i:
            a+=1
            while s<n and h[s]>=i:
                s+=1
    s+=1
print(a)

Fixed submission:
n=int(input())
h=list(map(int,input().split()))
print(sum(max(0,h[i]-h[i+1]) for i in range(n-1)) +h[-1])
Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
h=list(int(input()) for _ in range(n))
a=[]
h.sort(reverse=True)
for i in range(n-k+1):
    a.append(h[i]-h[i+k-1])
    if 0 in a:
        print(0)
        exit()
print(min(a))

Fixed submission:
D = int(input())
if D == 25:
    print('Christmas')
elif D == 24:
    print('Christmas Eve')
elif D == 23:
    print('Christmas Eve Eve')
else :
    print('Christmas Eve Eve Eve')
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=0
for i in range(1,n+1):
    s=[]
    if "3" in str(i) and "5" in str(i) and "7" in str(i):
        for j in str(i):
            s.append(j)
        if len(set(s)) == 3:
                a+=1
print(a)


Fixed submission:
n=int(input())

def dfs(s):
    if int(s)>n:
        return 0
    if all(s.count(c)>0 for c in "753"):
        a=1
    else:
        a=0

    for c in "753":
        a=a+dfs(s+c)

    return a

print(dfs("0"))
Buggy python submission (verdict: Runtime Error):
n = int(input())
t,a = map(int,input().split())
s = []
f = 1
for i in range(1,n+1):
    h = int(input())
    d = int(abs(a-t-h*0.006))
    s.append(d)
    if d == min(s):
       f = i
print(f)


Fixed submission:
n = int(input())
t,a = map(int,input().split())
h = list(map(int,input().split()))
s = []

for i in h:
    s.append(abs(t-i*0.006-a))

print(s.index(min(s))+1)

Buggy python submission (verdict: Runtime Error):
n = int(input())
a,t = map(int,input().split())
s = 0
t = 1
for i in range(1,n+1):
    h = int(input())
    if a-t-h*0.006 <= s:
        t = i 
print(i)   

Fixed submission:
n = int(input())
t,a = map(int,input().split())
h = list(map(int,input().split()))
s = []

for i in h:
    s.append(abs(t-i*0.006-a))

print(s.index(min(s))+1)
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=[]

x,y,k=-1,-1,-1
n=-1
for _ in range(n):
    a.append(list(map(int,input().split())))
    if a[_][2] != 0:
        n=i
for i in range(101):
    for j in range(101):
        h=a[0][2]+abs(a[0][0]-i)+abs(a[0][1]-j)
        d=True

        for l in range(n):
            if a[l][2] > 0 and h != a[l][2]+abs(a[l][0]-i)+abs(a[l][1]-j):
                d=False
            if a[l][2]==0 and h>abs(a[l][0]-i)+abs(a[l][1]-j):
                d=False
            
        if d:
            x,y,k=i,j,h
            print(x,y,k)
            exit()



Fixed submission:
N = int(input())

if N == 1:
    print('Hello World')
else:
    A=int(input())
    B=int(input())
    print(A+B)
Buggy python submission (verdict: Runtime Error):
n,t = map(int,input().split())
d = []

for i in range(n):
    c,s = map(int,input().split())
    if s <= t:
        d.append(c)
if d == 0:
    print("TLE")
else:
    print(min(d))

Fixed submission:
n,t = map(int,input().split())
d = []

for i in range(n):
    c,s = map(int,input().split())
    if s <= t:
        d.append(c)
if d== []:
    print("TLE")
else:
    print(min(d))
Buggy python submission (verdict: Runtime Error):
n,m,X,Y = map(int,input().split())
x = list(map(int,input().split()))
y = list(map(int,input().split()))

print(["War","No War"][X<min(y) and max(x)<Y and max(x)<min(y)])



Fixed submission:
abc = list(map(int,input().split()))
abc.sort()
print(abc[0]+int(str(abc[2])+str(abc[1])))

Buggy python submission (verdict: Runtime Error):
A = input()
B = input()
C = input()

if A>=B and B>=C:
    print(int(A+B)+int(C))
elif B>A and A>C:
    print(int(B+A)+int(C))
elif A>C and C>B:
    print(int(A+C)+int(B))
elif C>B and B>A:
    print(int(C+B)+int(A))
elif B>C and B>A:
    print(int(B+C)+int(A))
else:
    print(int(C+A)+int(B))

Fixed submission:
abc = list(map(int,input().split()))
abc.sort()
print(abc[0]+int(str(abc[2])+str(abc[1])))

Buggy python submission (verdict: Runtime Error):
A = int(input())
B = int(input())
C = int(input())

if A>=B and B>=C:
    print(int(str(A)+str(B))+C)
elif B>A and A>C:
    print(int(str(B)+str(A))+C)
elif A>C and C>B:
    print(int(str(A)+str(C))+B)
elif C>B and B>A:
    print(int(str(C)+str(B))+A)
elif B>C and B>A:
    print(int(str(B)+str(C))+A)
else:
    print(int(str(C)+str(A))+B)

Fixed submission:
abc = list(map(int,input().split()))
abc.sort()
print(abc[0]+int(str(abc[2])+str(abc[1])))
Buggy python submission (verdict: Runtime Error):
n,m,X,Y = map(int,input().split())
x = map(int,input().split())
y = map(int,input().split())

print(["War","No War"][X<min(y) and max(x)<Y and max(x)<min(y)])



Fixed submission:
n,m,X,Y = map(int,input().split())
x = list(map(int,input().split()))
y = list(map(int,input().split()))

print(["War","No War"][X<min(y) and max(x)<Y and max(x)<min(y)])