qyliang/CodeNanoFix huggingface dataset:
Buggy code:
N,M,X,Y=map(int,input().split())
x=[int(i) for i in input().split()]
y=[int(i) for i in input().split()]
for z in range(X,Y,1):
    if z>max(x):
        if z<=min(y):
            print('No War')
            break
else:
    print('War')

Fixed code:
N,M,X,Y=map(int,input().split())
x=[int(i) for i in input().split()]
y=[int(i) for i in input().split()]
for z in range(X+1,Y,1):
    if z>max(x):
        if z<=min(y):
            print('No War')
            break
else:
    print('War')
Buggy code:
n,m,x,y=map(int,input().split())
x_=list(map(int,input().split()))
y_=list(map(int,input().split()))
x_.append(x)
y_.append(y)
x_.sort()
y_.sort()
if min(y_)>max(x_):
            print('NoWar')
else:
            print('War')
            
            


Fixed code:
n,m,x,y=map(int,input().split())
x_=list(map(int,input().split()))
y_=list(map(int,input().split()))
x_.append(x)
y_.append(y)

if min(y_)>max(x_):
            print('No War')
else:
            print('War')
Buggy code:
N, M, X, Y = map(int, input().split())
x = list(map(int, input().split())).append(X)
y = list(map(int, input().split())).append(Y)
if max(x)<min(y):
	print('War')
else:
	print('No War') 

Fixed code:
N, M, X, Y = map(int, input().split())

x = list(map(int, input().split()))
y = list(map(int, input().split()))

if X < Y and max(x) < min(y)and X < min(y)and max(x) < Y:
    print("No War")
else:
    print("War")
Buggy code:
import sys
n,m,x,y=map(int,input().split())
listx=list(map(int,input().split()))
listy=list(map(int,input().split()))
listx.sort(reverse=True)
listy.sort()
for i in range(x,y):
    if listx[0]<i<=listy[0]:
        print('No War')
        sys.exit()
print('War')

Fixed code:
import sys
n,m,x,y=map(int,input().split())
listx=list(map(int,input().split()))
listy=list(map(int,input().split()))
listx.sort(reverse=True)
listy.sort()
for i in range(x+1,y+1):
    if listx[0]<i<=listy[0]:
        print('No War')
        sys.exit()
print('War')
Buggy code:
n,m,x,y = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]
b = [int(x) for x in input().split()]
max_x = max(a)
max_y = max(b)
max_x = max(max_x,x)
max_y = max(max_y,y)
 
if max_x < max_y:
  print("No War")
else:
  print("War")

Fixed code:
n,m,x,y = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]
b = [int(x) for x in input().split()]
max_x = max(a)
min_y = min(b)
max_x = max(max_x,x)
min_y = min(min_y,y)

if max_x < min_y:
  print("No War")
else:
  print("War")
Buggy code:
def solve():
    N, M, X, Y = map(int, input().split())
    x = list(map(int, input().split()))
    y = list(map(int, input().split()))
    
    max_x = max(X, max(x))
    min_y = min(Y, min(y))
    if max_x < min_y:
        print('NO War')
    else:
        print('War')


if __name__ == '__main__':
    solve()


Fixed code:
def solve():
    N, M, X, Y = map(int, input().split())
    x = list(map(int, input().split()))
    y = list(map(int, input().split()))
    
    max_x = max(X, max(x))
    min_y = min(Y, min(y))
    if max_x < min_y:
        print('No War')
    else:
        print('War')


if __name__ == '__main__':
    solve()
Buggy code:
N, M, X, Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))

max_x = max(x)
min_y = min(y)

print(max_x)
print(min_y)
if max_x <= Y and max_x < min_y and min_y > X:
    print("No War")
else:
    print("War")

Fixed code:
N, M, X, Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))

max_x = max(x)
min_y = min(y)

if max_x < Y and max_x < min_y and min_y > X:
    print("No War")
else:
    print("War")
Buggy code:
N,M,X,Y=map(int,input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
x2=max(x)
y2=min(y)
if X < y2 <= Y:
    print('No War')
else:
    print('War')

Fixed code:
N,M,X,Y=map(int,input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
x2=max(x)
y2=min(y)
if X <= x2 < y2 <= Y:
    print('No War')
else:
    print('War')
Buggy code:
n, m, X, Y = map(int,input().split())
x = list(map(int,input().split()))
y = list(map(int,input().split()))

if X < Y and max(x) < Y and Y <= min(y):
  print("No War")
else:
  print("War")

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

if X < Y and max(max(x), X) < min(y) and max(x) < min(min(y), Y):
  print("No War")
else:
  print("War")
Buggy code:
H, M, X, Y = map(int, input().split())
x = map(int, input().split())
y = map(int, input().split())

r = any(all(i < z for i in x) and all(i <= z for i in y) for z in range(X+1, Y+1))
print("No War" if r else "War")

Fixed code:
H, M, X, Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))
 
r = any(all(i < z for i in x) and all(i >= z for i in y) for z in range(X+1, Y+1))
print("No War" if r else "War")
Buggy code:
n, m, x, y = map(int, input().split())
x_list = [int(data) for data in input().split()]
y_list = [int(data) for data in input().split()]

if x < y and max(x_list) < min(y_list):
    print("No War")
else:
    print("War")


Fixed code:
n, m, x, y = map(int, input().split())
x_list = [int(data) for data in input().split()]
y_list = [int(data) for data in input().split()]

if x < y and max(x_list) < min(y_list) and max(x_list) > x and min(y_list) < y:
    print("No War")
else:
    print("War")
Buggy code:
n, m, x, y = map(int, input().split())
l = [list(map(int, input().split())) for i in range(2)]
if max(l[0]) - min(l[1]) > 0 and x >= max(l[0]) and min(l[1]) > y:
    print('No War')
else:
    print('War')

Fixed code:
n, m, x, y = map(int, input().split())
l = [list(map(int, input().split())) for i in range(2)]
if min(l[1]) - max(l[0])> 0 and max(l[0]) < y and x < min(l[1]):
    print('No War')
else:
    print('War')
Buggy code:
print("No War" if (lambda a:max(a[0][2],max(a[1]))<min(a[0][3],min(a[2])))([int(j) for j in input().split()] for i in range(3)]) else "War")

Fixed code:
print("No War" if (lambda a:max(a[0][2],max(a[1]))<min(a[0][3],min(a[2])))([list(map(int,input().split())) for i in range(3)]) else "War")
Buggy code:
n, m, x, y = map(int, input().split())
X = sorted(map(int, input().split()))
Y = sorted(map(int, input().split()))
for i in range(X[-1]:Y[0]):
  if x <= i < y:
    print("No War")
    exit()
print("War")

Fixed code:
n, m, x, y = map(int, input().split())
X = sorted(list(map(int, input().split())))
Y = sorted(list(map(int, input().split())))
for i in range(X[-1], Y[0]):
  if x <= i < y:
    print("No War")
    exit()
print("War")
Buggy code:
n,m,x,y = map(int, input().split())
x_list = list(map(int, input().split()))
y_list = list(map(int, input().split()))
x_list.sort()
y_list.sort()
if x_list[-1]+1 < y_list[0]:
  print("No War")
else:
  print("War")

Fixed code:
n,m,x,y = map(int, input().split())
x_list = list(map(int, input().split()))
y_list = list(map(int, input().split()))
x_list.sort()
y_list.sort()
if x_list[-1] < y_list[0]:
  if (y_list[0] > x) and (x_list[-1] < y):
    print("No War")
  else:
    print("War")
else:
  print("War")
Buggy code:
N,M,X,Y = map(int,input().split())
x = list(map(int,input().split()))
y = list(map(int,input().split()))
if max(x) <= min(y):
  print("No War")
else:
  print("War")

Fixed code:
N,M,X,Y = map(int,input().split())
x = list(map(int,input().split()))
y = list(map(int,input().split()))
if max(x) < min(y) and X < min(y) <= Y:
	print("No War")
else:
	print("War")
Buggy code:
N,M,X,Y = map(int,input().split())
x = list(map(int,input().split()))
y = list(map(int,input().split()))
if max(x) < min(y) and min(y) >= M and min(y) > N:
	print("No War")
else:
	print("War")


Fixed code:
N,M,X,Y = map(int,input().split())
x = list(map(int,input().split()))
y = list(map(int,input().split()))
Mx = max(x)
my = min(y)
if Mx < my and Mx < Y and my > X:
    print('No War')
else:
    print('War')
Buggy code:
N, M, X, Y = (int(i) for i in input().split()) 
x= [int(i) for i in input().split()] 
y= [int(i) for i in input().split()] 
x.sort()
y.sort()
z = X + 1
while z<Y:
    if(x[-1] < z and y[0] > z):
        print('No War')
        print(z)
        break
    else:
        z = z + 1
if (z>Y):
    print('War')
    

Fixed code:
N, M, X, Y = (int(i) for i in input().split()) 
x= [int(i) for i in input().split()] 
y= [int(i) for i in input().split()] 
x.sort()
y.sort()
z = X + 1
max_x = x[-1]
min_y = y[0]
while z<Y:
    if(max_x < z and min_y >=z):
        print('No War')
        #print(z)
        break
    else:
        z = z + 1
if (z>=Y):
    print('War')
Buggy code:
N,M,X,Y=map(int, input().split())
Xs=list(map(int, input().split()))
Ys=list(map(int, input().split()))
if max([X,Xs]) < min([Y,Ys]):
  print("No War")
else:
  print("War")

Fixed code:
N,M,X,Y=map(int, input().split())
Xs=list(map(int, input().split()))
Ys=list(map(int, input().split()))
if max([X,max(Xs)]) < min([Y,min(Ys)]):
  print("No War")
else:
  print("War")
Buggy code:
N, M, X, Y = map(int, input().split())
x = max(list(map(int, input().split())))
y = min(list(map(int, input().split())))
if x >= y or x <= Y or X <= y: print("War")
else: print("No War") 

Fixed code:
N, M, X, Y = map(int, input().split())
x = max(list(map(int, input().split())))
y = min(list(map(int, input().split())))
if x >= y or x >= Y or X >= y: print("War")
else: print("No War")
Buggy code:
n,m,x,y=map(int,input().split())
xi=[int(_) for _ in input().split()]
yi=[int(_) for _ in input().split()]
print('War' if max(xi) >= min(yi) else 'No War')

Fixed code:
n,m,x,y=map(int,input().split())
xi=[int(_) for _ in input().split()]
yi=[int(_) for _ in input().split()]
print('War' if max(xi) >= min(yi) or x >= y  or max(xi) >= y or min(yi) <= x else 'No War')
Buggy code:
N, M, X, Y = map(int, input().split())
list_x = list(map(int,input().split(' ')))
list_y = list(map(int,input().split(' ')))


min_range = max(list_x)
max_range = min(list_y)

ans = 0

for i in range(X+1, Y):
  if(i > min_range and i <= max_range):
    ans = 1

if (ans == 1):
  print("No war")
elif (ans == 0):
  print("War")


Fixed code:
N, M, X, Y = map(int, input().split())
list_x = list(map(int,input().split(' ')))
list_y = list(map(int,input().split(' ')))
 
 
min_range = max(list_x)
max_range = min(list_y)
 
ans = 0
 
for i in range(X+1, Y+1):
  if(i > min_range and i <= max_range):
    ans = 1
 
if (ans == 1):
  print("No War")
elif (ans == 0):
  print("War")
Buggy code:
a = input().split() 
n = int(a[0])
m = int(a[1])
x = int(a[2])
y = int(a[3])
a = input().split()
a = [int(s) for s in a]
x_max = max(a)
a = input().split()
a = [int(s) for s in a]
y_min = min(a)
print(y <= x_max , y_min <= x , x_max >= y_min)
if y <= x_max or y_min <= x or x_max >= y_min:
    print("War")
else:
    print("No War")

Fixed code:
a = input().split() 
n = int(a[0])
m = int(a[1])
x = int(a[2])
y = int(a[3])
a = input().split()
a = [int(s) for s in a]
x_max = max(a)
a = input().split()
a = [int(s) for s in a]
y_min = min(a)
if x_max >= y:
    print("War")
elif y_min <= x:
    print("War")
else:
    if x_max < y_min:print("No War")
    else:print("War")
Buggy code:


N, M, X, Y = list(map(int, input().split()))
a = []
for i in range(2):
    a.append(list(map(int, input().split())))

if X < Y:
    xs = sorted(a[0])
    ys = sorted(a[1])
    if xs[-1] < ys[0]:
        print('No War')
    else:
        print('War')
else:
    print('War')


Fixed code:


N, M, X, Y = list(map(int, input().split()))
a = []
for i in range(2):
    a.append(list(map(int, input().split())))

if X < Y:
    xs = sorted(a[0])
    ys = sorted(a[1])
    if xs[-1] < ys[0] and xs[-1] < Y and ys[0]>X:
        print('No War')
    else:
        print('War')
else:
    print('War')
Buggy code:
N,M,X,Y = map(int,input().split())
x = [X] + list(map(int,input().split()))
y = [Y] + list(map(int,input().split()))

if max(x) >= min(y):
    print("War")
else:
    print("NO War")

Fixed code:
N,M,X,Y = map(int,input().split())
x = [X] + list(map(int,input().split()))
y = [Y] + list(map(int,input().split()))

if max(x) >= min(y):
    print("War")
else:
    print("No War")
Buggy code:
n,m,x,y = map(int,input().split())
x_list = list(map(int,input().split()))
y_list = list(map(int,input().split()))
if max(x_list) < min(y_list):
  print('No War')
else:
  print('War')

Fixed code:
n,m,x,y = map(int,input().split())
x_list = list(map(int,input().split()))
y_list = list(map(int,input().split()))
x_list.append(x)
y_list.append(y)
if max(x_list) < min(y_list):
  print('No War')
else:
  print('War')
Buggy code:
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))
if max(b)<=min(c):
    for i in range(min(c)-max(b)):
        if a[2]<=max(b)+i+1<=a[3]:
            print("War")
else:
    print("No War")

Fixed code:
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))
d=""
if max(b)<min(c):
    for i in range(min(c)-max(b)):
        if a[2]<max(b)+i+1<=a[3]:
            d="No War"
            break
        else:
            d="War"
else:
    d="War"
print(d)
Buggy code:
N,M,X,Y=map(int, input().split())
x=list(map(int, input().split()))
y=list(map(int, input().split()))

if Y-X>=1:
    Z=range(X+1,Y+1)
    for z in Z:
        if max(x)<z and min(y)>=z:
            print("No War")
            #exit()
print("War")

Fixed code:
N,M,X,Y=map(int, input().split())
x=list(map(int, input().split()))
y=list(map(int, input().split()))

if Y-X>=1:
    Z=range(X+1,Y+1)
    for z in Z:
        if max(x)<z and min(y)>=z:
            print("No War")
            exit()
print("War")
Buggy code:
n,m,x,y=map(int,input().split())
xt=list(map(int,input().split()))
yt=list(map(int,input().split()))
xt.sort()
yt.sort()
if x<y and xt[len(xt)-1]<y[0]:
  print("No War")
else:
  print("War")

Fixed code:
n,m,x,y=map(int,input().split())
xt=list(map(int,input().split()))
yt=list(map(int,input().split()))
xt.sort()
yt.sort()
if max(x,xt[len(xt)-1])<min(y,yt[0]):
  print("No War")
else:
  print("War")
Buggy code:
n,m,x,y=map(int,input().split())
X=list(map(int,input().split()))
Y=list(map(int,input().split()))
max_X=max(X)
min_Y=min(Y)
print('No War' if max_x<min_Y else 'War')

Fixed code:
n,m,x,y=map(int,input().split())
X=list(map(int,input().split()))
Y=list(map(int,input().split()))
max_X=max(X)
min_Y=min(Y)
print('No War' if max_X<min_Y and max_X<y and x<min_Y else 'War')
Buggy code:
n, m, x, y = map(int, input().split())
xl = list(map(int, input().split()))
yl = list(map(int, input().split()))
xl.sort()
yl.sort()
if xl[-1] >= yl[0]:
  print('War')
for i in range(xl[-1]+1, yl[0]+1):
  if i>x and i<=y:
    print('No War')
    quit()
print('War')

Fixed code:
n, m, x, y = map(int, input().split())
xl = list(map(int, input().split()))
yl = list(map(int, input().split()))
xl.sort()
yl.sort()
if xl[-1] >= yl[0]:
  print('War')
  quit()
for i in range(xl[-1]+1, yl[0]+1):
  if i>x and i<=y:
    print('No War')
    quit()
print('War')
Buggy code:
N,M,X,Y=map(int,input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
 
if min(y)-max(x)>=2 and X<Y:
  if len(set(range(max(x)+1,min(y)))&set(range(X+1,Y+1)):
  	print('No War')
  else:
    print('War')
else:
  print('War')

Fixed code:
N,M,X,Y=map(int,input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
 
if max(x)<min(y) and X<Y:
  if len(set(range(max(x)+1,min(y)+1))&set(range(X+1,Y+1)))>=1:
  	print('No War')
  else:
    print('War')
else:
  print('War')
Buggy code:
n, m, x, y = list(map(int, input().split()))

x_ = list(map(int, input().split()))
y_ = list(map(int, input().split()))

max_x = max(x_)

min_y = min(y_)


if max_x < (min_y-1):
    print('No War')
else:
    print('War')

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

x_ = list(map(int, input().split()))
y_ = list(map(int, input().split()))

if max(x_) > x:
    max_x = max(x_)
else:
    max_x = x

if min(y_) > y:
    min_y = y
else:
    min_y = min(y_)


if max_x < min_y:
    print('No War')
else:
    print('War')
Buggy code:
N, M, X, Y = map(int, input().split(' '))
x = list(map(int, input().split(' ')))
y = list(map(int, input().split(' ')))

if min(y) > max(x) and X < Y:
    print('No war')
else:
    print('War')

Fixed code:
N,M,X,Y = map(int,input().split())
x = list(map(int,input().split()))
y = list(map(int,input().split()))

if max(x) < min(y) and X < min(y) and max(x) < Y:
    print("No War")
else:
    print("War")
Buggy code:
n,m,x,y = map(int,input().split())
X = list(map(int,input().split()))
Y = list(map(int,input().split()))
for z in range(-100,101):
    if x < z <= y and max(X) < z <= min(Y):
        print("Np War")
        exit()

print("War")

Fixed code:
n,m,x,y = map(int,input().split())
X = list(map(int,input().split()))
Y = list(map(int,input().split()))
for z in range(-100,101):
    if x < z <= y and max(X) < z <= min(Y):
        print("No War")
        exit()

print("War")
Buggy code:
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))

x = max(b)
y = min(c)

p = max(a[2],x)
q = min(a[3],y)

if q-p > 0:
    print("No war")
else:
    print("War")

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

x = max(b)
y = min(c)

p = max(a[2],x)
q = min(a[3],y)

if q-p > 0:
    print("No War")
else:
    print("War")
Buggy code:
# -*- coding: utf-8 -*-
"""
Created on Sun Sep 23 21:12:01 2018

@author: masato
"""

N, M, X, Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))
x.sort()
y.sort()
xmin = x[0]
ymin = y[0]
xmax = x[-1]
ymax = y[-1]

z = max(xmax,ymin)

iswar = 0

for i in range(len(x)):
    for j in range(len(y)):
        if x[i] > z:
            iswar = 1
            break
        elif y[j] <= z:
            iswar = 1
            break
    if iswar == 1:
        break

if iswar == 1:
    print("War")
else:
    print("No War")


Fixed code:
# -*- coding: utf-8 -*-
"""
Created on Sun Sep 23 21:12:01 2018

@author: masato
"""

N, M, X, Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))
x.sort()
y.sort()
xmin = x[0]
ymin = y[0]
xmax = x[-1]
ymax = y[-1]

z = max(xmax,ymin)

iswar = 0

for i in range(len(x)):
    if min(ymin,Y) <= x[i]:
        iswar = 1
        break
        
for j in range(len(y)):
    if max(xmax,X) >= y[j]:
        iswar = 1
        break

if iswar == 1:
    print("War")
else:
    print("No War")
Buggy code:
N, M, X, Y = map(int, input().split(' '))
x = list(map(int, input().split(' '))) + [X]
y = list(map(int, input().split(' '))) + [Y]

if min(y) > max(x):
    print('No war')
else:
    print('War')

Fixed code:
N, M, X, Y = map(int, input().split(' '))
x = list(map(int, input().split(' '))) + [X]
y = list(map(int, input().split(' '))) + [Y]

if max(x) < min(y):
    print('No War')
else:
    print('War')
Buggy code:
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7

N,M,X,Y = I()
x = l()
y = l()
x1 = max(x)
y1 = min(y)
for z in range(X-1,Y+1):
    if x1 < z and y1 >= z:
        print('No War')
        exit()
print('War')

Fixed code:
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7

N,M,X,Y = I()
x = l()
y = l()
x1 = max(x)
y1 = min(y)
for z in range(X+1,Y+1):
    if x1 < z and y1 >= z:
        print('No War')
        exit()
print('War')
Buggy code:
N,M,X,Y=map(int,input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))

print("No War") if X<Y and max(x)+1<min(y) else print("War")


Fixed code:
N, M, X, Y = map(int, input().split())
x = max(list(map(int, input().split())))
y = min(list(map(int, input().split())))
print('No War' if x < y and X < y and x < Y else 'War')
Buggy code:
N,M,X,Y=map(int,input().split())
x=[int(x) for x in input().split()]
y=[int(x) for x in input().split()]

if max(x)<min(y):
    print("No War")
else:
    print("War")


Fixed code:
N,M,X,Y = map(int,input().split())
x = [int(x) for x in input().split()]
y = [int(y) for y in input().split()]

x = max(X,max(x))
y = min(Y,min(y))

answer = 'War' if y <= x else 'No War'

print(answer)
Buggy code:
n, m, x, y = map(int, input().split(" "))
xs = list(map(int, input().split(" ")))
ys = list(map(int, input().split(" ")))
xs.sort()
ys.sort()
if xs[-1] >= ys[0]:
    print("War")
else:
    print("No War")


Fixed code:
n, m, x, y = map(int, input().split(" "))
xs = list(map(int, input().split(" ")))
ys = list(map(int, input().split(" ")))
xs.append(x)
ys.append(y)
xs.sort()
ys.sort()
if xs[-1] >= ys[0]:
    print("War")
else:
    print("No War")
Buggy code:
#coding:utf-8

N, M, X, Y = list(map(int, input().split()))
x = list(map(int, input().split()))
y = list(map(int, input().split()))

'''
result1 = (X < Z) and (Z <= Y)

num_violate2 = len([i for i in x if i >= Z])
if num_violate2 > 0:
    result2 = False
else:
    result2 = True

num_violate3 = len([i for i in x if i < Z])
if num_violate3 > 0:
    result3 = False
else:
    result3 = True

if result1 and result2 and result3:
    print('No War')
else:
    print('War')
'''

result1 = X < Y
x = sorted(x)
y = sorted(y)
result2 = x[-1] + 1 < y[0]

if result1 and result2:
    print('No War')
else:
    print('War')


Fixed code:
#coding:utf-8

N, M, X, Y = list(map(int, input().split()))
x = list(map(int, input().split()))
y = list(map(int, input().split()))

'''
result1 = (X < Z) and (Z <= Y)

num_violate2 = len([i for i in x if i >= Z])
if num_violate2 > 0:
    result2 = False
else:
    result2 = True

num_violate3 = len([i for i in x if i < Z])
if num_violate3 > 0:
    result3 = False
else:
    result3 = True

if result1 and result2 and result3:
    print('No War')
else:
    print('War')
'''

x.append(X)
y.append(Y)

x = sorted(x)
y = sorted(y)

if x[-1] < y[0]:
    print('No War')
else:
    print('War')
Buggy code:
(n, m, x, y) = list(map(int, input().split()))
xs = list(map(int, input().split()))
ys = list(map(int, input().split()))

xs.sort()
ys.sort()

#print(n, m, x, y)
#print(xs)
#print(ys)
z = ys[0]
if(z < xs[-1]):
  print("War")
elif(x < z and z < y):
  print("No War")

Fixed code:
(n, m, x, y) = list(map(int, input().split()))
xs = list(map(int, input().split()))
ys = list(map(int, input().split()))

xs.sort()
ys.sort()

#print(n, m, x, y)
#print(xs)
#print(ys)

if(xs[-1] < x):
  xs[-1] = x
if(y < ys[0]):
  ys[0] = y

z = ys[0]
if(z <= xs[-1]):
  print("War")
elif(x < z and z <= y):
  print("No War")
else:
  print("War")
Buggy code:
from sys import stdin
N,M,X,Y=[int(x) for x in stdin.readline().rstrip().split()]
datax=[int(x) for x in stdin.readline().rstrip().split()]
datay=[int(x) for x in stdin.readline().rstrip().split()]
if sorted(datax)[-1] < sorted(datay)[0]:
    print("No War")
else:
    print("War")

Fixed code:
from sys import stdin
N,M,X,Y=[int(x) for x in stdin.readline().rstrip().split()]
datax=[int(x) for x in stdin.readline().rstrip().split()]
datay=[int(x) for x in stdin.readline().rstrip().split()]
if sorted(datax)[-1]+1 <= sorted(datay)[0] and  X < sorted(datax)[-1]  and sorted(datay)[0] <=Y: 
    print("No War")
else:
    print("War")
Buggy code:
N, M, X, Y = tuple(map(int, input().split()))
area_X = [int(x) for x in inut().split()]
area_Y = [int(x) for x in inut().split()]
area_X.append(X)
area_Y.append(Y)

print('No War' if max(area_X) < min(area_Y) else 'War')


Fixed code:
N, M, X, Y = tuple(map(int, input().split()))
area_X = [int(x) for x in input().split()]
area_Y = [int(x) for x in input().split()]
area_X.append(X)
area_Y.append(Y)

print('No War' if max(area_X) < min(area_Y) else 'War')