qyliang/CodeNanoFix huggingface dataset:
Buggy code:
N, M, X, Y = list(map(int, input().split()))
x = list(map(int, input().split()))
y = list(map(int, input().split()))

if X+1>Y:
    print("War")
else:
    if max(x)+1 >min(y):
        print("War")
    else:
        print("No 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 X+1>Y:
    print("War")
else:
    if (max(x)+1) > min(y):
        print("War")
    else:
        if X +1 <= min(y) and Y >= max(x)+1:
            print("No War")
        else:
            print("War")
Buggy code:
n,m,cx,cy = map(int,input().split())
x = list(int(i) for i in input().split())
y = list(int(i) for i in input().split())

x.sort()
y.sort()
z = range(cx+1,cy+1)

ans = "War"
for v in z:
    if (v > x[n-1]) and (v <= y[0]):
        ans = "No war"
        break

print(ans)

Fixed code:
n,m,cx,cy = map(int,input().split())
x = list(int(i) for i in input().split())
y = list(int(i) for i in input().split())

x.sort()
y.sort()
z = range(cx+1,cy+1)

ans = "War"
for v in z:
    if (v > x[n-1]) and (v <= y[0]):
        ans = "No War"
        break

print(ans)
Buggy code:
n, m, x, y = map(int, input().split())
x_li = list(map(int, input().split()))
y_li = list(map(int, input().split()))

if max(x_li) < min(y_li):
    for i in range(max(x_li)+1, min(y_li)):
        if x < i and y >= i:  
            print("No War")
            break
    else:
        print("War")
else:
    print("War")

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

if max(x_li) < min(y_li):
    for i in range(max(x_li)+1, min(y_li)+1):
        if x < i and y >= i:  
            print("No War")
            break
    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())
ans = False
for i in range(X+1, Y+1):
    if i > max(x) and i <= min(y):
        ans = True
        break

print("War" if ans True else "No War")

Fixed code:
N, M, X, Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))
ans = False
for i in range(X+1, Y+1):
    if i > max(x) and i <= min(y):
        ans = True
        break

print("War" if ans == False else "No War")
Buggy code:
N,M,X,Y = map(int,input().split())
x = list(map(int,input().split()))
y = list(map(int,input().split()))
tmp = list(range(X,Y+1))
tmp2 = list(range(max(x),min(y)+1))
if list(set(tmp) & set(tmp2)) == []:
  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()))
tmp = list(range(X+1,Y+1))
tmp2 = list(range(max(x)+1,min(y)+1))
if list(set(tmp) & set(tmp2)) == []:
  print('War')
else:
  print('No 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(max(x)+1, min(y)):
    if X < Z <= Y:
        print("No War")
        exit()
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()))
for Z in range(max(x)+1, min(y)+1):
    if X < Z <= Y:
        print("No War")
        exit()
else:
    print("War")
Buggy code:
n,m,a,b = map(int,input().split())
x = list(map(int,input().split()))
y = list(map(int,input().split()))
x.sort()
y.sort()
if x[-1]<y[0]:
    for i in range(x[-1]+1,y[0]+1):
        if a<i<b:
            print("No War")
    else:
        print("War")
else:
    print("War")

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

if sum(l)!=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()))
x.sort()
y.sort()
l=[]
for i in range(X+1,Y):
  if x[-1]<i and y[0]>=i:
    l.append(i)

if l!=[]:
  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.sort()
y.sort()
for i in range(X+1,Y+1,1):
    if i <= min(y) and i > max(x):
        print("No war")
        break
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.sort()
y.sort()
for i in range(X+1,Y+1,1):
    if i <= min(y) and i > max(x):
        print("No War")
        break
else:
    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()]
x_max = max(x)
y_min = min(y)
if x_max < y_min:
    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.append(X)
y.append(Y)
x_max = max(x)
y_min = min(y)
if x_max < y_min:
    print('No War')
else:
    print('War')
Buggy code:
N, M, X, Y = map(int,input().split())
x = list(map(int,input().split()))
x.sort(reverse=True)
y = list(map(int,input().split()))
y.sort()
if x[0] < y[0]:
    print('No War')
else:
    print('War')

Fixed code:
N, M, X, Y = map(int,input().split())
x = list(map(int,input().split()))
x.sort(reverse=True)
y = list(map(int,input().split()))
y.sort()
if x[0] < y[0] and X < y[0] and x[0] < 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()))

x.sort()
y.sort()

if x[-1] < y[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()))
x.append(X)
y.append(Y)
x.sort()
y.sort()

if x[-1] < y[0]:
    print("No War")
else:
    print("War")
Buggy code:
N, M, X, Y = map(int, input().split())
max_x = max(map(int, input().split()))
min_y = min(map(int, input().split()))

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


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

if X < Y and X < min_y and Y > max_x and max_x < min_y:
    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.sort()
ys.sort()
print("No War" if xs[-1] < ys[0] else "War")


Fixed code:
n, m, x, y = map(int, input().split())
xs = list(map(int, input().split())) + [x]
ys = list(map(int, input().split())) + [y]
xs.sort()
ys.sort()
print("No War" if xs[-1] < ys[0] else "War")
Buggy code:
N,M,X,Y=map(int,input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
x.sort()
y.sort()
ans=False
for i in range(X+1,Y+1):
    print(i)
    if(x[-1]<i and y[0]>=i):
        ans=True
        break
if(ans):
    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.sort()
y.sort()
ans=False
for i in range(X+1,Y+1):
    if(x[-1]<i and y[0]>=i):
        ans=True
        break
if(ans):
    print('No War')
else:
    print('War')
Buggy code:
n,m,x,y=map(int,input().split());x=max(list(map(int,input.split()))+[x]);y=min(list(map(int,input.split()))+[y]);print('No War'if x<y else'War')

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

else:
    print("War")
    exit()

if X < Z and Z <= 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()))
judge = False
for i in range(X,Y):
    if all([v < i for v in x]) and all([v >= i for v in y]):
        judge = True
        break
if judge:
    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()))
judge = False
for i in range(X+1,Y):
    if all([v < i for v in x]) and all([v >= i for v in y]):
        judge = True
        break
if judge:
    print("No War")
else:
    print("War")
Buggy code:
n,m,x,y=map(int,input().split())
xlist=[int(i) for i in input().split()]
ylist=[int(i) for i in input().split()]

if x<y and xlist<ylist:
    print("No War")
else:
    print("War")

Fixed code:
n,m,x,y=map(int,input().split())
xlist=[int(i) for i in input().split()]
ylist=[int(i) for i in input().split()]
xlist.append(x)
ylist.append(y)

if x<y and max(xlist)<min(ylist):
    print("No War")
else:
    print("War")
Buggy code:
n,m,x,y=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=True
for z in range(x+1,y+1):
  if all([l<z for l in a]) and all([l>=z for l in b]):
    pass
  else:
    c=False
if c==True:
  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()))
c=False
for z in range(x+1,y+1):
  if all([l<z for l in a]) and all([l>=z for l in b]):
    c=True
    break
if c==True:
  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.sort(reverse=True)
y.sort()


flag=0
for i in range(X+1,Y+1):
  if x[0]<=i and y[0]>i:
    flag=1
    break
  

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

xx.sort()
yy.sort()
for i in range(min(x,y)+1,max(x,y)):
    if xx[-1] < i and yy[0] >= i:
        print('No war')
        quit()
print('War')

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

xx.sort()
yy.sort()
for i in range(x+1,y+1):
    if xx[-1] < i and yy[0] >= i:
        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 max(x) <min(y) :
    print("No War")
else :
    print("War")

Fixed code:
n, m, x, y = map(int, input().split())
xlist = list(map(int, input().split()))
ylist = list(map(int, input().split()))
if max(max(xlist),x) <min(min(ylist),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()))


x_max  = max(x)
y_min = min(y)
if x_max >= y_min:
    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()))


x_max  = max(x)
y_min = min(y)
if x_max >= y_min or x_max >= Y or y_min <= X:
    print("War")
else :
    print("No War")
Buggy code:
n,m,x,y=map(int,input().split())
x1=max(map(int,input().split()))
x2=min(map(int,input().split()))
z=list(range(x+1,y+1))
for i in z:
    if x1<i<=x2:
        print("No War")
        break
    else:
	    print("War")
	    break

Fixed code:
n,m,x,y=map(int,input().split())
x1=max(map(int,input().split()))
x2=min(map(int,input().split()))
z=list(range(x+1,y+1))
for i in z:
	if x1<i<=x2:
		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()))

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:
N,M,X,Y = map(int,input().split())
x = list(map(int,input().split()))
y = list(map(int,input().split()))
x.sort()
y.sort()
if x[N-1] < y[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()))
x.append(X)
y.append(Y)
x.sort()
y.sort()
if x[N] < y[0]:
    print("No War")
else:
    print("War")
Buggy code:
N, M. X, Y = map(int, input().split())
x_lst = list(map(int, input().split()))
y_lst = list(map(int, input().split()))
if (X < Y and max(x_lst) < min(y_lst) and X < min(y_lst) and max(x_lst) < Y):
  print("No War")
else:
  print("War")

Fixed code:
N, M, X, Y = map(int, input().split())
x_lst = list(map(int, input().split()))
y_lst = list(map(int, input().split()))
if (X < Y and max(x_lst) < min(y_lst) and X < min(y_lst) and max(x_lst) < Y):
  print("No War")
else:
  print("War")
Buggy code:
n,m,x,y=list(map(int,input().split()))
l_x=list(map(int,input().split()))
l_y=list(map(int,input().split()))
x_max=max(l_x)
y_max=min(l_y)
for i in range(x_max+1,y_min):
    if x<i<=y:
        print('No War')
        exit()
print('War')


Fixed code:
n,m,x,y=list(map(int,input().split()))
l_x=list(map(int,input().split()))
l_y=list(map(int,input().split()))
x_max=max(l_x)
y_min=min(l_y)
for i in range(x_max+1,y_min+1):
    if x<i<=y:
        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()))
A=max(x)
B=min(y)
if A<B:
    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()))
A=max(x)
B=min(y)
if A>=B:
    print("War")
else:
    if X<=A and B<=Y:
        print("No War")
    else:
        print("War")
Buggy code:
(n, m, x, y) = map(int, input().split())
rightx = max(map(int, input().split()))
lefty = min(map(int, input().split()))

if rightx < min(y, lefty):
  print('No War')
else:
  print('War')

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

if rightx < min(y, lefty) and x < lefty:
  print('No War')
else:
  print('War')
Buggy code:
n, m, x, y = map(int, input().split())
x_city = list(map(int, input().split()))
y_city = list(map(int, input().split()))
x_city.sort()
y_city.sort()
print(x_city)
print(y_city)
if y_city[0] - x_city[-1] > 0 and x < y_city[0]:
    print('No War')
else:
    print('War')

Fixed code:
n, m, x, y = map(int, input().split())
x_city = list(map(int, input().split()))
y_city = list(map(int, input().split()))
x_city.sort()
y_city.sort()
if y_city[0] - x_city[-1] > 0 and x < y_city[0] and x_city[-1] < y:
    print('No War')
else:
    print('War')
Buggy code:
def main():
  N,M,X,Y = map(int, input().split())
  max_x = max(map(int,input().split()))
  min_y = min(map(int,input().split()))
  max_xx = max(max_x,X)
  min_yy = min(min_y,Y)
  print(max_x)
  print(min_y)
  print(max_xx)
  print(min_yy)
  
  if min_yy - max_xx > 0:
    print("No War")
  else:
    print("War")
    
main()

Fixed code:
def main():
  N,M,X,Y = map(int, input().split())
  max_x = max(map(int,input().split()))
  min_y = min(map(int,input().split()))
  max_xx = max(max_x,X)
  min_yy = min(min_y,Y)
  #print(max_x)
  #print(min_y)
  #print(max_xx)
  #print(min_yy)
  
  if min_yy - max_xx > 0:
    print("No War")
  else:
    print("War")
    
main()
Buggy code:
n,m,X,Y = list(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 max(x) <= X and min(y) >= 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) or max(x)>=Y or min(y)<=X:
    print("War")
else:
    print("No War")
Buggy code:
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])


Fixed code:
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)])
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(x) for x in input().split()]
if max(max(x),X)<min(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()))
for z in range(X+1, Y):
    if max(x) < z < min(y):
        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()))
for z in range(X+1, Y):
    if max(x) < z <= min(y):
        print("No War")
        exit()
print("War")
Buggy code:
N, M, X, Y = map(int, input().split())
xlist = list(map(int, input().split()))
ylist = list(map(int, input().split()))

if X < max(xlist):
    xmax = max(xlist)
else:
    xmax = X

if Y > min(ylist):
    ymax = min(ylist)
else:
    ymin = Y

if xmax + 1 <= ymin:
    print("No War")
else:
    print("War")

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

if X < max(xlist):
    xmax = max(xlist)
else:
    xmax = X

if Y > min(ylist):
    ymin = min(ylist)
else:
    ymin = Y

if xmax + 1 <= ymin:
    print("No War")
else:
    print("War")
Buggy code:
N,M,X,Y=map(int,input().split())
x_box=input().split()
y_box=input().split()

for a in range(len(x_box)):
    x_box[a]=int(x_box[a])
for a in range(len(y_box)):
    y_box[a]=int(y_box[a])

for i in range(X+1,Y+1):
    if max(x_box)< i <min(y_box):
        print('No War')
        exit()
print('War')

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

for a in range(len(x_box)):
    x_box[a]=int(x_box[a])
for a in range(len(y_box)):
    y_box[a]=int(y_box[a])

for i in range(X+1,Y+1):
    if max(x_box)< i <=min(y_box):
        print('No War')
        exit()
print('War')
Buggy code:
n,m,x,y = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split())) 
set1 = set()
set2 = set()
c = 0
maxa = max(a)
minb = min(b)
if maxa < minb:
  for i in range(maxa+1,minb+1):
    set1.add(i)
if x < y:
  for i in range(x+1,y+1):
    set2.add(i)
set3 = set1 & set2
if len(set3) >= 1:
  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())) 
set1 = set()
set2 = set()
c = 0
maxa = max(a)
minb = min(b)
if maxa < minb:
  for i in range(maxa+1,minb+1):
    set1.add(i)
if x < y:
  for i in range(x+1,y+1):
    set2.add(i)
set3 = set1 & set2
if len(set3) >= 1:
  print("No War")
else:
  print("War")
Buggy code:
l = input().split()


N = int(l[0])
M = int(l[1])
X = int(l[2])
Y = int(l[3])

if X < -100:
    X = -100
elif X > 100:
    X = 100

if Y < -100:
    Y = -100
elif Y > 100:
    Y = 100


lx = input().split()
ly = input().split()

lx = [int(z) for z in lx]
ly = [int(z) for z in ly]

lx = sorted(lx)


ly = sorted(ly)

flag = True


if int(ly[0]) - int(lx[N-1]) >= 1:
    for z in range(int(lx[N-1]) + 1, int(ly[0]) + 1):
        if z > X and z <= Y:
            flag = True
        else:
            flag = False
            break
else:
    flag = False

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


Fixed code:
l = input().split()


N = int(l[0])
M = int(l[1])
X = int(l[2])
Y = int(l[3])

"""
if X < -100:
    X = -100
elif X > 100:
    X = 100

if Y < -100:
    Y = -100
elif Y > 100:
    Y = 100
"""

lx = input().split()
ly = input().split()

lx = [int(z) for z in lx]
ly = [int(z) for z in ly]

lx = sorted(lx)


ly = sorted(ly)

flag = True


if int(ly[0]) - int(lx[N-1]) >= 1:
    for z in range(int(lx[N-1]) + 1, int(ly[0]) + 1):

        if z > X and z <= Y:
            flag = False
            break


if flag:
    print("War")
else:
    print("No War")
Buggy code:
def main():
    N,M,X,Y = map(int, input().split())
    x_wants=[int(s) for s in input().split()]
    y_wants=[int(s) for s in input().split()]

    x_wants.append(X)
    y_wants.append(Y)
    x_wants = sorted(x_wants)
    y_wants = sorted(y_wants)

    x_max = x_wants[len(x_wants)-1]
    y_min = y_wants[0]

    if(x_max>=y_min):
        print('War')
        return
    
    print('No war')

if __name__ == "__main__":
    main()

Fixed code:
def main():
    N,M,X,Y = map(int, input().split())
    x_wants=[int(s) for s in input().split()]
    y_wants=[int(s) for s in input().split()]

    x_wants.append(X)
    y_wants.append(Y)
    x_wants = sorted(x_wants)
    y_wants = sorted(y_wants)

    x_max = x_wants[len(x_wants)-1]
    y_min = y_wants[0]

    if((y_min-x_max)<1):
        print('War')
        return
    
    print('No War')

if __name__ == "__main__":
    main()
Buggy code:
cnds = [int(i) for i in input().split()]

posX = [int(i) for i in input().split()]
posY = [int(i) for i in input().split()]
posX.sort()
posY.sort()

max_x = posX[-1]
min_y = posY[0]
if cnds[2] < cnds[3]:
    if max_x < max_y:
        print('No War')
    else:
        print('War')
else:
    print('War')





Fixed code:
cnds = [int(i) for i in input().split()]

posX = [int(i) for i in input().split()]
posY = [int(i) for i in input().split()]
posX.sort()
posY.sort()

max_x = posX[-1]
min_y = posY[0]
if cnds[2] < cnds[3]:
    if max_x < min_y and cnds[2] < min_y and max_x < cnds[3]:
        print('No War')
    else:
        print('War')
else:
    print('War')