qyliang/CodeNanoFix huggingface dataset:
Buggy code:
def main():
    N , M , A , B = list(map(int,input().split()))
    X = list(map(int,input().split()))
    Y = list(map(int,input().split()))

    print(max(X))
    print(max(Y))
    flag = False
    

    for Z in range(A,B):
        if A < Z:
            if Z <= B:
                if max(X) < Z:
                    if max(Y) >= Z:
                        flag = True
                        ans = Z
    
    if flag:
        print("No War")
        print(ans)
    else:
        print("War")

if __name__ == '__main__':
    main()

Fixed code:
def main():
    N , M , A , B = list(map(int,input().split()))
    X = list(map(int,input().split()))
    Y = list(map(int,input().split()))

    flag = False
    

    for Z in range(A,B):
        if A < Z:
            if Z <= B:
                if max(X) < Z:
                    if min(Y) >= Z:
                        flag = True
                        ans = Z
    
    if flag:
        print("No War")

    else:
        print("War")

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

ans = 'War'

for z in range(X, Y+1):
    if z > max(x) and z <= max(y):
        ans = 'No War'
        break

print(ans)


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

ans = 'War'

for z in range(X+1, Y+1):
    if max(x) < z and min(y) >= z:
        ans = 'No War'
        break

print(ans)
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)

if min_y<max_x:
    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 max(max(x),X) < min(min(y),Y):
  print("No War")
else:
  print("War")
Buggy code:
# -*- coding: utf-8 -*-

N, M, X, Y = map(int, input().split())
Xl = list(map(int, input().split())) + [X]
Yl = list(map(int, input().split())) + [Y]

if max(Xl) < min(Yl):
    print("War")
else:
    print("No War")


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

N, M, X, Y = map(int, input().split())
Xl = list(map(int, input().split())) + [X]
Yl = list(map(int, input().split())) + [Y]

if max(Xl) < min(Yl):
    print("No War")
else:
    print("War")
Buggy 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)
if max(xs) < min(ys):
    print("N0 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()))
xs.append(x)
ys.append(y)
if max(xs) < min(ys):
    print("No War")
else:
    print("War")
Buggy code:
N, M, X, Y = (int(i) for i in input().split())
l_x = [int(x) for x in input().split()]
l_y = [int(y) for y in input().split()]

if max(l_x) => min(l_y):
    print('War')
else:
    print('No War')

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

l_x.append(X)
l_y.append(Y)
if max(l_x) >= min(l_y):
    print('War')
else:
    print('No War')
Buggy code:
n,m,x,y=map(int,input().split())
xl=list(map(int,input().split()))
yl=list(map(int,input().split()))
zl=[i for i in range(x+1,y)]
flag=False
for i in zl:
    if i>sum(xl) and sum(yl)>=i:
        flag=True

if flag:
    print("War")
else:
    print("No war")

Fixed code:
n,m,x,y=map(int,input().split())
xl=list(map(int,input().split()))
yl=list(map(int,input().split()))
zl=[i for i in range(x+1,y)]
flag=False
for i in zl:
    if i>max(xl) and min(yl)>=i:
        flag=True

if flag:
    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):
  if min(y) >= X and min(y) < Y:
    ans = "No War"
  elif max(x) > X and max(x) <= Y:
    ans = "No War"
  else:
    ans = "War"
else:
  ans = "War"

print(ans)

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

if not (max(x)<min(y) and X<min(y) and Y>max(x)):
    print("War")
else :
    print('No War')
Buggy code:
# B
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)
ans = "War"
Xmax = max(x)
Ymin = min(y)
# print("X",X)
# print("Y",Y)
# print("Xmax",Xmax)
# print("Ymin",Ymin)
# 1
if Xmax < Ymin:
    ans = "No War"
print("Ans",ans)

Fixed code:
# B
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)
ans = "War"
Xmax = max(x)
Ymin = min(y)
# print("X",X)
# print("Y",Y)
# print("Xmax",Xmax)
# print("Ymin",Ymin)
# 1
if Xmax < Ymin:
    ans = "No War"
print(ans)
Buggy code:
n,m,x,y=map(int,input().split())
xl=list(map(int,input().split()))
yl=list(map(int,input().split()))
xl.append(x)
yl.append(y)
if max(xl)<=min(yl):
  print("No War")
else:
  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.append(x)
yl.append(y)
if max(xl)<min(yl):
  print("No War")
else:
  print("War")
Buggy code:
N, M, X, Y = list(map(int, input().split()))
x = list(map(int, input().split()))
x.sort()
y = list(map(int, input().split()))
y.sort()

zx = x[N-1] + 1
zy = y[0]
if (zx <= zy) and (X <= zx) and (zy <= Y):
    print ('No War')
else:
    print ('War')

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

zx = x[N-1] + 1
zy = y[0]
if (zx <= zy) and (Y >= zx) and (zy > X):
    print ('No War')
else:
    print ('War')
Buggy code:
n,m,x,y=map(int,input().split())
arr1=list(map(int,input().split()))
arr2=list(map(int,input().split()))
if(x>=y):
	print("War")
elif(max(arr1)>=min(arr2)):
	print("War")
else:
	print("No War")

Fixed code:
n,m,x,y=map(int,input().split())
arr1=list(map(int,input().split()))
arr2=list(map(int,input().split()))
arr1.append(x)
arr2.append(y)
if(max(arr1)>=min(arr2)):
	print("War")
else:
	print("No War")
Buggy code:
import math

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, 1):
  if X < Z and Z <= Y and max(x) < Z and min(y) >= Z:
    print('No War')
  else:
    print('War')

Fixed code:
import math

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, 1):
  if X < Z and Z <= Y and max(x) < Z and min(y) >= Z:
    print('No War')
    break
else:
  print('War')
Buggy code:
n, m, x, y = map(int, input().split())
if x>y :
    print('War')
else:
    X = sorted(list(map(int, input().split())))
    Y = sorted(list(map(int, input().split())))
    for i in range(x+1, y+1):
        if X[-1]<i and i <= Y[0]:
            print('No War')
            break
        else :
            print('War')
            break



Fixed code:
n, m, x, y = map(int, input().split())
if x>y :
    print('War')
else  :
    X = sorted(list(map(int, input().split())))
    Y = sorted(list(map(int, input().split())))
    a = 0
    for i in range(x+1, y+1):
        if X[-1]<i and i <= Y[0] and x < i and i <= y:
            print('No War')
            break
        else :
            a += 1
    if a == y-x:
        print('War')
Buggy 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()]

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(x) for x in input().split()]
_X = max(X, max(x))
_Y = min(Y, min(y))
if _X < _Y:
    print("No War")
else:
    print("War")
Buggy code:
N, M, X, Y = map(int, input().split())
lstX = list(map(int, input(split()))).sort(reverse=True)
lstY = list(map(int, input(split()))).sort()
if lstX[0] > X and lstX[0] + 1 <= lstY[0] and lstX[0] + 1 <= Y:
    print('No War')
elif lstX[0] < X and X + 1 <= lstY[0] and X + 1 <= Y:
    print('No War')
else:
    print('War')

Fixed code:
N, M, X, Y = map(int, input().split())
lstX = list(map(int, input().split()))
lstY = list(map(int, input().split()))
lstX.sort(reverse=True)
lstY.sort()
#print(lstX)
#print(lstY)
if lstX[0] > X and lstX[0] + 1 <= lstY[0] and lstX[0] + 1 <= Y:
    print('No War')
elif lstX[0] < X and X + 1 <= lstY[0] and X + 1 <= 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):
    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(max(x),X)<min(min(y),Y):
    print('No War')
else:
    print('War')
Buggy code:
iptA=list(map(int,input().split()))
X=list(map(int,input().split())).append(iptA[2])
Y=list(map(int,input().split())).append(iptA[3])
  
xmax,ymax=max(X),max(Y)
if xmax>=ymax:
    print('War')
 else:
     print('No War')

Fixed code:
iptA=list(map(int,input().split()))
X=list(map(int,input().split()))
Y=list(map(int,input().split()))
X.append(iptA[2])
Y.append(iptA[3])
     
xmax,ymin=max(X),min(Y)
if xmax>=ymin:
    print('War')
else:
    print('No War')
Buggy code:
n,m,x,y = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))

a.sort(),b.sort()

if a[-1] < b[0]:
    print("No War")
else:
    print("War")

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

a.sort(),b.sort()

if max(a[-1],x) < min(y,b[0]):
    print("No War")
else:
    print("War")
Buggy code:
n,m,x,y = map(int,input().split())

x1 = max(map(int,input().split())) + 1
y1 = min(map(int,input().split()))

if x1 <= y1 and (x1 <= y or y1 > x):
    print('No war')
else:
    print('War')

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

x1 = max(map(int,input().split())) + 1
y1 = min(map(int,input().split()))

if x1 <= y1 and x1 <= y and y1 > x:
    print('No War')
else:
    print('War')
Buggy code:
n,m,x,y = map(int,input().split())

x1 = max([int(i) for i in input().split()]) + 1
y1 = min([int(i) for i in input().split()])

if x1 <= y1 and x1 <= y and y1 > x:
    print('No war')
else:
    print('War')

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

x1 = max([int(i) for i in input().split()]) + 1
y1 = min([int(i) for i in input().split()])

if x1 <= y1 and x1 <= y and y1 > x:
    print('No War')
else:
    print('War')
Buggy code:
n,m,x,y = map(int,input().split())

x_n = list(map(int,input().split()))
y_m = list(map(int,input().split()))

if x+1 < y and max(x_n)+1 < min(y_m): 
    print("No War")
else:
    print("War")


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

x_n = list(map(int,input().split()))
y_m = list(map(int,input().split()))

if x < max(x_n) and max(x_n) <min(y_m) and min(y_m) <=y:
    print("No War")
else:
    print("War")
Buggy code:
def main():
    n, m, x, y = list(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)

    zx = max(x_list) + 1
    zy = min(y_list)

    if zx > zy :
        print('War')

    print('No war')


if __name__ == '__main__':
    main()



Fixed code:
def main():
    n, m, x, y = list(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)

    zx = max(x_list) + 1
    zy = min(y_list)

    if zx > zy :
        print('War')
    else:
        print('No War')


if __name__ == '__main__':
    main()
Buggy code:
n,m,x,y=map(int, input().split())
x_l = list(map(int, input().split()))
y_l = list(map(int, input().split()))
if max(x_l)<min(y_l):
  print("No War")
else:
  print("War")

Fixed code:
n,m,x,y=map(int, input().split())
x_l = list(map(int, input().split()))
y_l = list(map(int, input().split()))
if max(x_l)<y and max(x_l) < min(y_l) and x < min(y_l):
  print("No War")
else:
  print("War")
Buggy code:
N, M, X, Y = [int(nmxy) for nmxy in input().split()]
x = [int(xx) for xx in input().split()]
y = [int(yy) for yy in input().split()]
x_Z = max(x) + 1
Z_y = min(y)
for Z in range(X+1, Y):
  if x_Z < Z <= Z_y:
    print("No War")
    break
else:
  print("War")

Fixed code:
N, M, X, Y = [int(nmxy) for nmxy in input().split()]
x = [int(xx) for xx in input().split()]
y = [int(yy) for yy in input().split()]
x_Z = max(x)
Z_y = min(y)
for Z in range(X+1, Y):
  if x_Z < Z <= Z_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()))

dif = min(y) - max(x)

if dif >= 0:
  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()))

dif = min(y) - max(x)

if dif > 0 and min(y) > X and max(x) < Y:
  print('No War')
else:
  print('War')
Buggy code:
# -*- coding: utf-8 -*-

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

if x[0] > y[0]:
    print("War")
else:
    print("No War")


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

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

if x[0] >= y[0]:
    print("War")
else:
    Z = y[0]
    if X < Z and Z <= Y:
        print("No War")
    else:
        print("War")
Buggy code:
N, M, X, Y = [int(n) for n in input().split()]
XC = [int(n) for n in input().split()]
YC = [int(n) for n in input().split()]

def main():
    max_x = max(XC)
    min_y = min(YC)
    if max_x < min_y and\
       set(range(X, Y + 1)) & set(range(max_x, min_y + 1)):
        print('No War')
    else:
        print('War')

if __name__ == '__main__':
    main()

Fixed code:
N, M, X, Y = [int(n) for n in input().split()]
XC = [int(n) for n in input().split()]
YC = [int(n) for n in input().split()]

def main():
    max_x = max(XC)
    min_y = min(YC)
    if max_x < min_y and\
       set(range(X, Y)) & set(range(max_x, min_y)):
        print('No War')
    else:
        print('War')

if __name__ == '__main__':
    main()
Buggy code:
n,m,x,y = map(int,input().split())
xi = list(map(int,input().split()))
yi = list(map(int,input().split()))
x_max = max(xi)
x_min = min(xi)
y_max = max(xi)
y_min = min(yi)
a = 0
if x_max < y_min:
    if x < y_min and y > x_max:
        a += 1
elif x_min > y_max:
    if x > y_max and y < x_min:
        a += 1
if a >= 1:
    print("No War")
else:
    print("war")

Fixed code:
n,m,x,y = map(int,input().split())
xi = list(map(int,input().split()))
yi = list(map(int,input().split()))
x_max = max(xi)
x_min = min(xi)
y_max = max(xi)
y_min = min(yi)
a = 0
if x_max < y_min:
    if x < y_min and y > x_max:
        a += 1
if a >= 1:
    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()))
X.append(x)
Y.append(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()))
X.append(x)
Y.append(y)
print('No War'if max(X)<min(Y) else'War')
Buggy code:
LL = input().split(" ")

LX = list(map(int,input().split()))
LY = list(map(int,input().split()))
	
LX.sort(reverse = True)
LY.sort(reverse = True)

CO = 0

for R in range(int(LL[2])+1,int(LL[3])):
	if LX[0] <= R and R <= LY[0] :
		print("No War")
		CO = 1
		break
		
if CO == 0:
	print("War")

Fixed code:
LL = input().split(" ")

LX = list(map(int,input().split()))
LY = list(map(int,input().split()))
	
LX.sort(reverse = True)
LY.sort()

CO = 0

for R in range(int(LL[2])+1,int(LL[3])):
	if LX[0]  >= LY[0]:
		break
	elif LX[0] <= R  <= LY[0] :
		print("No War")
		CO = 1
		break
		
if CO == 0:
	print("War")
Buggy code:
def main():
    s = [int(item) for item in input().split()]
    _, _, X, Y = s
    xs = [int(item) for item in input().split()]
    ys = [int(item) for item in input().split()]
    mx = max(xs)
    my = min(ys)
    if mx >= Y:
        print('War')
        return
    if my < X:
        print('War')
        return
    if mx >= my:
        print('War')
        return
    print('No War')


if __name__ == '__main__':
    main()

Fixed code:
def main():
    s = [int(item) for item in input().split()]
    _, _, X, Y = s
    xs = [int(item) for item in input().split()]
    ys = [int(item) for item in input().split()]
    mx = max(xs)
    my = min(ys)
    if mx >= Y:
        print('War')
        return
    if my <= X:
        print('War')
        return
    if mx >= my:
        print('War')
        return
    print('No War')


if __name__ == '__main__':
    main()
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)&(max(x) < min(y))&(max(x) < 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()))
x.append(X)
y.append(Y)
if (max(x) < min(y)):
  print('No War')
else:
  print('War')
Buggy code:
n, m, x, y = list(map(int, input().split()))
xv = list(map(int, input().split()))
yv = list(map(int, input().split()))
if x < y and max(xv) < min(yv):
  print('No War')
else:
  print('War')

Fixed code:
n, m, x, y = list(map(int, input().split()))
xv = list(map(int, input().split()))
yv = list(map(int, input().split()))
xv.append(x)
yv.append(y)
if x < y and max(xv) < min(yv):
  print('No 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(' ')))

ans = 'War'
for i in range(X,Y+1):
  if  max(x) < i <= min(y) and X < i <=y:
    ans ='No War'
    break
    

print(ans)    
    
    
    
    
  


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

ans = 'War'
for i in range(X+1,Y+1):
  if  max(x) < i <= min(y):
    ans ='No War'
    break
    

print(ans)
Buggy code:
icase=0
if icase==0:
    n,m,x,y=map(int,input().split())
    xi=list(map(int,input().split()))        
    yi=list(map(int,input().split()))        
    if max(xi)<min(yi):
        print("No War")
    else:
        print("War")
        

Fixed code:
icase=0
if icase==0:
    n,m,x,y=map(int,input().split())
    xi=list(map(int,input().split()))        
    xi.append(x)
    yi=list(map(int,input().split()))        
    yi.append(y)
    if max(xi)<min(yi):
        print("No War")
    else:
        print("War")
Buggy code:
n,m,x,y = map(int,input().split())

xis = sorted(list(map(int,input().split())),reverse=True)
yis = sorted(list(map(int,input().split())))
 
ans = 'No War' if xis[0] < yis[0] else 'War'

print(ans)

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

xis = sorted(list(map(int,input().split())),reverse=True)
yis = sorted(list(map(int,input().split())))
 
ans = 'No War' if (xis[0] < yis[0]) and (x < yis[0] and xis[0] < y) else 'War'

print(ans)
Buggy code:
n,m,x,y = map(int,input().split())
a = max(max(list(map(int,input().split())),x)
b = min(min(list(map(int,input().split())),y)
print("No War" if a<b else "War")

Fixed code:
n,m,x,y = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
print("No War" if max(max(a),x)<min(min(b),y) else "War")
Buggy code:
n,m,x,y = map(int,input().split())
a = sorted(map(int,input().split()))
b = sorted(map(int,input().split()))
if x<y and a[-1]<b[0]:
    print('No War')
else:
    print('War')

Fixed code:
n,m,x,y = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
a.append(x)
b.append(y)
a =sorted(a)
b =sorted(b)
if a[-1]<b[0]:
    print('No War')
else:
    print('War')
Buggy code:
n,m,x,y=map(int,input().split())
xx=list(map(int,input().split()))
yy=list(map(int,input().split()))
xxx=max(xx+list(x))
yyy=min(yy+list(y))
if xxx<yyy:
  print("No War")
else:
  print("War")

Fixed code:
n, m, x, y = map(int, input().split())
xx = list(map(int, input().split()))
yy = list(map(int, input().split()))
xxx = max(xx + [x])
yyy = min(yy + [y])
if xxx < yyy:
    print("No War")
else:
    print("War")
Buggy code:
n,m,x,y=map(int,input().split())
xl=list(map(int,input().split()))
yl=list(map(int,input().split()))
cnt=0
for i in range(x,y+1):
    if max(xl)<i and i<=min(yl):
        cnt+=1
if cnt == 0:
    print('War')
else:
    print('No War')

Fixed code:
n,m,x,y=map(int,input().split())
xl=list(map(int,input().split()))
yl=list(map(int,input().split()))
cnt=0
for i in range(x+1,y+1):
    if max(xl)<i and i<=min(yl):
        cnt+=1
if cnt == 0:
    print('War')
else:
    print('No War')
Buggy code:
# ABC110b
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

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')
    exit()
print('War')

Fixed code:
# ABC110b
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

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

if (max(max(x), X) < min(min(y), Y)):
    print('No War')
    exit()
print('War')
Buggy code:
#AtCorder Beginner Contest 110 B 1 Dimensional World's Tale
N,M,X,Y = input().split()

X = int(X)
Y = int(Y)

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

maxX = max(x)
minY = min(y)

for Z in range(maxX+1,minY+1):
    if ( X < Z and Z <= Y ) and ( maxX < Z and minY >=Z ):
        print("No War")
    else:
        print("War")

Fixed code:
#AtCorder Beginner Contest 110 B 1 Dimensional World's Tale
import sys
N,M,X,Y = input().split()

X = int(X)
Y = int(Y)

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

maxX = max(x)
minY = min(y)

if maxX >= minY:
    print("War")
else:
    for Z in range(maxX+1,minY+2):
        if ( X < Z and Z <= Y ) and ( maxX < Z and minY >=Z ):
            print("No War")
            sys.exit()
        else:
            print("War")
            sys.exit()
Buggy code:
N, M, X, Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))

xmax = max(x)
ymin = min(y)

if xmax >= ymin or xmax > Y or ymin < X:
    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()))

xmax = max(x)
ymin = min(y)

if xmax >= ymin or xmax >= Y or ymin <= X:
    print('War')
else:
    print('No War')
Buggy code:
n, m, x, y = map(int, input().split())

xl = list(map(int, input().split()))
yl = list(map(int, input().split()))

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

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

xl = list(map(int, input().split()))
yl = list(map(int, input().split()))

if max(xl + [x]) < min(yl + [y]):
    print("No War")
else:
    print("War")
Buggy code:
def main():
    n, m, x, y = map(int, input().split())
    dx = map(int, input().split())
    dy = map(int, input().split())

    max_x = max(list(dx))
    min_y = min(list(dy))

    z = x + 1
    while z <= y:
        if z > max_x and z <= min_y:
            print("No War", z)
            # print("No War")
            exit()
        z += 1
    print("War")


if __name__ == '__main__':
    main()


Fixed code:
def main():
    n, m, x, y = map(int, input().split())
    dx = map(int, input().split())
    dy = map(int, input().split())

    max_x = max(list(dx))
    min_y = min(list(dy))
    # if x >= y:
    #     print("WAR")
    #     exit()

    z = x + 1
    while z <= y:
        if z > max_x and z <= min_y:
            # print("No War", z)
            print("No War")
            exit()
        z += 1
    print("War")


if __name__ == '__main__':
    main()