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

X = sorted(X)
Y = sorted(Y)

if(X[n-1]>=Y[0]):
    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 = sorted(X)
Y = sorted(Y)

if (X[n-1]<Y[0]) and X[n-1]<y and Y[0]>x:
    print('No War')
else:
    print('War')
Buggy code:
N,M,X,Y = map(int,input().split())
lsx = list(map(int,input().split()))+[X]
lsy = list(map(int,input().split()))+[Y]
if max(lsx) < min(lsy):
    print('No war')
else:
    print('War')

Fixed code:
N,M,X,Y = map(int,input().split())
lsx = list(map(int,input().split()))+[X]
lsy = list(map(int,input().split()))+[Y]
if max(lsx) < min(lsy):
    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 = max(a)+1
d = min(b)
e = 0

if c > d:
    print("War")
else:
    for i in range(c,d+1):
        if x < i and i <= y:
            print("No War")
            print(i)
            e = 1
            break
    if e == 0:
        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 = max(a)+1
d = min(b)
e = 0

if c > d:
    print("War")
else:
    for i in range(c,d+1):
        if x < i and i <= y:
            print("No War")
            e = 1
            break
    if e == 0:
        print("War")
Buggy code:
n,m,x,y = map(int,input().split())
li1 = list(map(int,input().split()))
li2 = list(map(int,input().split()))

for z in range(x,y+1):
    if all([i < z for i in li1]):
        flag = True
    else:
        flag = False
    if all([i >= z for i in li2]):
        flag = True
    else:
        flag = False
        
if flag == True:       
    print("No War")
elif flag == False:
    print("War")

Fixed code:
n,m,x,y = map(int,input().split())
li1 = list(map(int,input().split()))
li2 = list(map(int,input().split()))
flag = False
for z in range(x+1,y+1):
    if all([i < z for i in li1]) and all([i >= z for i in li2]):
        flag = True
        #print(z)
        break
        
if flag == True:       
    print("No War")
else:
    print("War")
Buggy code:
N,M,X,Y = map(int, input().split())
x = [int(_) for _ in input().split()]
y = list(map(int, input().split()))
maxX = max(x)
minY = min(y)

print(maxX,maxY)
for i in range(Y+1):
    if X < i <= Y and maxX < i and minY >= i:
        print("No War")
        break
    elif i == Y:
        print("War")
        break

Fixed code:
N,M,X,Y = map(int, input().split())
x = [int(_) for _ in input().split()]
y = list(map(int, input().split()))
maxX = max(x)
minY = min(y)
flag = True
for i in range(Y+1):
    if X < i <= Y and maxX < i and minY >= i:
        print("No War")
        flag = False
        break
if flag:
    print("War")
Buggy code:
N, M, X, Y= map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))


xx = max(x)
yy = min(y)

if (X > Y):
    print('War')
elif (xx > yy):
    print('War')
elif (yy < X):
    print('War')
elif (Y < xx):
    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()))


xx = max(x)
yy = min(y)

if (X >= Y):
    print('War')
elif (xx >= yy):
    print('War')
elif (yy <= X):
    print('War')
elif (Y <= xx):
    print('War')
else:
    print('No War')
Buggy 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) < min(y):
    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(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()))
if max(x)< min(y):
  print('No War')
else :
  print('War')

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

if x<y:
  print("No War")
else:
  print("War")
Buggy code:
n, m, x, y = map(int, input().split())
a = max(list(map(int, input().split())))
b = min(map(int, input().split()))
print(['War', 'No War'][any((a<i<=b) for i in range(x,y))])

Fixed code:
n, m, x, y = map(int, input().split())
a = max(list(map(int, input().split())))
b = min(map(int, input().split()))
print(['War', 'No War'][any((a<i<=b) for i in range(x+1,y+1))])
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:
    print("War")
    exit()
for Z in range(X,Y):
    if max(x)<=Z<min(y):
        continue
    else:
        print("War")
        exit()
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:
    print("War")
    exit()
for Z in range(X,Y):
    if max(x)<=Z<min(y):
        print("No War")
        exit()
print("War")
Buggy code:
n,m,X,Y = map(int, input().split())
import numpy as np
x = np.array(list(map(int, input().split())))
y = np.array(list(map(int, input().split())))

for i in range(X,Y+1):
  if (x<i).all() and (y>=i).all():
    print("No War")
    break
else:
  print("War")

Fixed code:
n,m,X,Y = map(int, input().split())
import numpy as np
x = np.array(list(map(int, input().split())))
y = np.array(list(map(int, input().split())))

for i in range(X+1,Y+1):
  if (x<i).all() and (y>=i).all():
    print("No War")
    break
else:
  print("War")
Buggy code:
a = list(map(int,input().split()))
x = list(map(int,input().split()))
y = list(map(int,input().split()))
z = "War"

for i in range(a[2],a[3]+1):
  if max(x)<i<min(y):
    z = "No War"
else:
  print(z)

Fixed code:
a = list(map(int,input().split()))
x = list(map(int,input().split()))
y = list(map(int,input().split()))
z = "War"

for i in range(a[2]+1,a[3]+1):
  if max(x)<i<=min(y):
    z = "No War"
else:
  print(z)
Buggy code:
n, m, x, y = map(int,input().split())
xl = list(map(int, input().split()))
xl.append(x)
xl.sort()
yl = list(map(int, input().split()))
yl.append(y)
yl.sort()

if abs(xl[n]) < abs(yl[0]):
    print("No War")
else:
    print("War")


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

if xl[n] < yl[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()))
s = 1
for i in range(-100,101):
    if X < i <= Y and max(x) < i <= min(y):
        s = 0
print(["No war","War"][s])

Fixed code:
n,m,X,Y = map(int,input().split())
x = list(map(int,input().split()))
y = list(map(int,input().split()))
s = 1
for i in range(-100,101):
    if X < i <= Y and max(x) < i <= min(y):
        s = 0
print(["No War","War"][s])
Buggy code:
import sys

def main(lines):
  N, M, X, Y = map(int, lines[0].split()) 
  x = list(map(int, lines[1].split()))
  y = list(map(int, lines[2].split()))
  x.sort()
  y.sort()
  if x[N - 1] < y[0]:
    print("No War")
  else:
    print("War")


if __name__ == '__main__':
    lines = []
    for l in sys.stdin:
        lines.append(l.rstrip('\r\n'))
    main(lines)

Fixed code:
import sys

def main(lines):
  N, M, X, Y = map(int, lines[0].split()) 
  x = list(map(int, lines[1].split()))
  y = list(map(int, lines[2].split()))
  x.sort()
  y.sort()
  flag = 0
  for i in range(X + 1, Y + 1):
    if x[N - 1] < i and i <= y[0]:
      flag = 1
  if flag:
    print("No War")
  else:
    print("War")


if __name__ == '__main__':
    lines = []
    for l in sys.stdin:
        lines.append(l.rstrip('\r\n'))
    main(lines)
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 max_x < min_y and max_x < Y or 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 >= 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())
Xs = list(map(int, input().split()))
Ys = list(map(int, input().split()))
if max(Xs) < min(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()))
Xs.append(X)
Ys.append(Y)
if max(Xs) < min(Ys):
    print('No War')
else:
    print('War')
Buggy code:
N,M,X,Y = map(int,input().split())
ans = 0
x = list(map(int,input().split()))
y = list(map(int,input().split()))
for i in range(X,Y):
  k = i
  if i>max(x):
    if i<=min(y):
      ans += 1
      break
if ans == 1:
  print("No War")
else:
  print("War")

Fixed code:
N,M,X,Y = map(int,input().split())
ans = 0
x = list(map(int,input().split()))
y = list(map(int,input().split()))
for i in range(X+1,Y):
  k = i
  if i>max(x):
    if i<=min(y):
      ans += 1
      break
if ans == 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()))
if x<y and max(a)<min(b):
    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()))
if x<y and max(a)<min(b) and max(a)<y and x<min(b) :
    print("No War")
else:
    print("War")
Buggy code:
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

_ = rl()
maxx = max(rm())
miny = min(rm())
if maxx >= miny:
  print('War')
else:
  print('No War')







Fixed code:
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

_, _, x, y = rl()
maxx = max(rm())
miny = min(rm())
if maxx < miny and x<miny and maxx<y:
  print('No War')
else:
  print('War')
Buggy code:
N, M, X, Y = map(int, input().split())
xlst = list(map(int, input().split()))
ylst = list(map(int, input().split()))

xmax = max(xlst)
ymin = min(ylst)
cand = []
for i in range(xmax+1, ymin+1):
    cand.append(i)
print(cand)
    
warflag = True
for c in cand:
    if X < c <= Y:
        warflag = False
if warflag:
    print('War')
else:
    print('No War')

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

xmax = max(xlst)
ymin = min(ylst)
cand = []
for i in range(xmax+1, ymin+1):
    cand.append(i)
    
warflag = True
for c in cand:
    if X < c <= Y:
        warflag = False
if warflag:
    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 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 = list(map(int, input().split()))
y_list = list(map(int, input().split()))
if X < Y and max(max(x_list), X) < min(min(y_list), 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 if min(Y) <= max(X):
  print("War")
  exit()
else:
  for i in range(max(X)+1, min(Y)+1):
    if x < i <= 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()))

if min(Y) <= max(X):
  print("War")
  exit()
else:
  for i in range(max(X)+1, min(Y)+1):
    if x < i <= y:
      print("No War")
      exit()
      
print("War")
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()]

c=0
for i in range(X,Y+1):
  c =0
  if (i >=X and i <=Y) :
    c += 1
  if max(x) < i :
    c + =1
  if min(y) < i :
    c += 1
  
  if c == 3:
    print("No War")
    exit()
  else:
    continue
    
    
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()]

c=0
for i in range(X+1,Y+1):
  c =0
  if (i >X and i <=Y) :
    c += 1
  if max(x) < i :
    c += 1
  if min(y) >= i :
    c += 1
  
  if c == 3:
   
    print("No War")
    exit()
  else:
    continue
    
    
print("War")
Buggy code:
N,M,X,Y=map(int,input().split())
x_array = list(map(int,input().split()))
y_array = list(map(int,input().split()))
x_array.sort()
y_array.sort()
if y_array[0] - x_array[N-1] <=0:print("War")
else: print("No War")

Fixed code:
N,M,X,Y=map(int,input().split())
x_array = list(map(int,input().split()))
y_array = list(map(int,input().split()))
x_array.sort()
y_array.sort()
if x_array[N-1] >= Y or y_array[0] <= X :print("War")
else :
    if y_array[0] - x_array[N-1] > 0 : 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()))
x_max = max(xs)
y_min = min(ys)
def get_war(x_max, y_min, X, Y):
    if y_min > x_max:
        for z in list(range(x_max, y_min + 1)):
            if (z > X) and (z <= Y):
                return 'No War'
            else:
                pass
        else:
            return 'No War'
    else:
        return 'War'
print(get_war(x_max, y_min, X, Y))

Fixed code:
n, m, X, Y = map(int, input().split())
xs = list(map(int, input().split()))
ys = list(map(int, input().split()))
x_max = max(xs)
y_min = min(ys)
def get_war(x_max, y_min, X, Y):
    if y_min > x_max:
        for z in list(range(x_max+1, y_min + 1)):
            if (z > X) and (z <= Y):
                return 'No War'
            else:
                pass
        else:
            return 'War'
    else:
        return 'War'
print(get_war(x_max, y_min, X, Y))
Buggy code:
N, M, X, Y = map(int, input().split())
x = max(map(int, input().split()))
y = min(map(int, input().split()))
if x < y and x < Y 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 max(x) < Y and X < min(y):
    print('No War')
else:
    print('War')
Buggy code:
# B
N, M, X, Y = map(int, input().split())
lst_x =  list(map(int, input().split()))
lst_y =  list(map(int, input().split()))

ans = 'War'
for i in range(X, Y):
    if (max(lst_x) < i and min(lst_y) >= i):
        ans = 'No War'
print(ans)

Fixed code:
# B
N, M, X, Y = map(int, input().split())
lst_x =  list(map(int, input().split()))
lst_y =  list(map(int, input().split()))

ans = 'War'
for i in range(X+1, Y+1):
    if (max(lst_x) < i and min(lst_y) >= i):
        ans = 'No War'
print(ans)
Buggy code:
n,m,x,y=map(int,input().split())
xn=list(map(int,input().split()))
ym=list(map(int,input().split()))
xn.append(x)
ym.append(y)
if max(xn)<max(ym):
  print("No War")
else:
  print("War")

Fixed code:
n,m,x,y=map(int,input().split())
xn=list(map(int,input().split()))
ym=list(map(int,input().split()))
xn.append(x)
ym.append(y)
if max(xn)<min(ym):
  print("No War")
else:
  print("War")
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()]
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 = [int(i) for i in input().split()]
Y = [int(i) for i in input().split()]
a = max(max(X),x)
b = min(min(Y),y)
if(a < b):
  print("No War")
else:
  print("War")
Buggy code:
n,m,x,y = map(int,input().split())
listx = [int(i) for i in input().split()]
listy = [int(i) for i in input().split()]
listx.append(x)
listy.append(y)
maxx = max(listx)
miny = min(listy)
if (miny > maxx):
    print("No war")
else:
    print("War")

Fixed code:
#2
n,m,x,y = map(int,input().split())
listx = [int(i) for i in input().split()]
listy = [int(i) for i in input().split()]
listx.append(x)
listy.append(y)
maxx = max(listx)
miny = min(listy)
if (miny > maxx):
    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()

x_max = x[0]
y_min = y[0]
result = "War"

for z in range(X,Y):
    if x_max < z <= y_min:
        result = "No War"
        break

print(result)


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

x_max = x[0]
y_min = y[0]
result = "War"
for z in range(X+1,Y+1):
    if x_max < z <= y_min:
        result = "No War"
        break

print(result)
Buggy code:
xy=input().split()
X=xy[2]
Y=xy[3]
n=input().split()
n.append(X)
n=[int(i) for i in n]
n=sorted(n)
m=input().split()
m.append(Y)
m=[int(i) for i in m]
m=sorted(m)
x=n[-1]
y=m[0]
if x>y:
    print("War")
else:
    print("No War")

Fixed code:
xy=input().split()
X=xy[2]
Y=xy[3]
n=input().split()
n.append(X)
n=[int(i) for i in n]
n=sorted(n)
m=input().split()
m.append(Y)
m=[int(i) for i in m]
m=sorted(m)
x=n[-1]
y=m[0]
if x>=y:
    print("War")
else:
    print("No War")
Buggy code:

NMXY =  list(int(i) for i in input().split())
x =  list(int(i) for i in input().split())
y =  list(int(i) for i in input().split())


x.append(NMXY[2])

y.append(NMXY[3])
print(max(x))
print(min(y))
if max(x) < min(y):
    print('No War')
else:
    print('War')


Fixed code:

NMXY =  list(int(i) for i in input().split())
x =  list(int(i) for i in input().split())
y =  list(int(i) for i in input().split())

x.append(NMXY[2])

y.append(NMXY[3])

if max(x) < min(y):
    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()))
for i in range(X+1,Y):
  if max(xl) < i and min(yl) >= i:
    print("NoWar")
    exit()
print("War")

Fixed code:
N,M,X,Y = map(int,input().split())
xl = list(map(int,input().split()))
yl = list(map(int,input().split()))
for i in range(X+1,Y):
  if max(xl) < i and min(yl) >= i:
    print("No War")
    exit()
print("War")
Buggy code:
N, M, X, Y = map(int, input().split())
XL = list(map(int, input().split()))
YL = list(map(int, input().split()))

print('War' if max(XL) > min(YL) \
    or X > min(YL) and Y < max(XL) else 'No War')

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

print('War' if max(XL) >= min(YL) \
    or X >= min(YL) or Y <= max(XL) else 'No War')
Buggy code:
n,m,x,y=map(int,input().split())
lix=list(map(int,input().split()))
liy=list(map(int,input().split()))
if max(lix) <= min(liy):
  print("No War")
else:
  print("War")

Fixed code:
n,m,x,y=map(int,input().split())
lix=list(map(int,input().split()))
liy=list(map(int,input().split()))
if min(y, min(liy)) <= max(x,max(lix)):
  print("War")
else:
  print("No War")
Buggy code:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-

N, M, X, Y = [int(c) for c in input().split()]
xls = [int(x) for x in input().split()]
yls = [int(c) for c in input().split()]
if max (xls) < min(yls):
    print('War')
else:
    print('No War')

Fixed code:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-

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

x.append(X)
y.append(Y)
xmax = max(X)
ymin = min(Y)
if xmax < ymin:
  print('No War')
else:
  print('War')

Fixed code:
inpl = lambda: list(map(int,input().split()))
N, M, X, Y = inpl()
x = inpl()
y = inpl()
 
x.append(X)
y.append(Y)
xmax = max(x)
ymin = min(y)
if xmax < ymin:
  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()))
minB = min(B)
maxA = max(A)
for i in range(maxA, minB+1):
  if X < i and Y =< i:
    print("No War")
    exit()
  else:
    print("War")
    exit()

Fixed code:
N, M, X, Y = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
minB = min(B)
maxA = max(A)
for i in range(X, Y+1):
  if maxA < i and minB >= i and X < i and i <= Y:
    print("No War")
    exit()
print("War")
Buggy code:


def main():
    N, M, X, Y = tuple(int(x) for x in input().split(" "))
    Xs = list(int(x) for x in input().split(" "))
    Ys = list(int(x) for x in input().split(" "))
    Xs.sort()
    Ys.sort()
    print(Xs)
    print(Ys)
    if Xs[-1] < Ys[0]:
        for n in range(Xs[-1]+1, Ys[0]+1):
            if X < n <= Y:
                print("No War")
                return
    print("War")




if __name__ == "__main__":
    main()


Fixed code:


def main():
    N, M, X, Y = tuple(int(x) for x in input().split(" "))
    Xs = list(int(x) for x in input().split(" "))
    Ys = list(int(x) for x in input().split(" "))
    Xs.sort()
    Ys.sort()
    if Xs[-1] < Ys[0]:
        for n in range(Xs[-1]+1, Ys[0]+1):
            if X < n <= Y:
                print("No War")
                return
    print("War")




if __name__ == "__main__":
    main()
Buggy code:
n,m,x,y = map(int,input().split())
xlist = list(int(i) for i in input().split())
ylist = list(int(i) for i in input().split())
z = max(xlist)+1
if z <= min(ylist):
  print("No War")
else:
  print("War")

Fixed code:
n,m,x,y = map(int,input().split())
xlist = list(int(i) for i in input().split())
ylist = list(int(i) for i in input().split())
z = max(xlist)+1
if z <= min(ylist) and x < z and z <= y:
  print("No War")
else:
  print("War")
Buggy code:
if __name__ == '__main__':
    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()]

    result = "War"

    for i in range(-100, 101):
        if max(x) < i and min(y) >= i:
            result = "No war"

    print(result)


Fixed code:
if __name__ == '__main__':
    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()]

    result = "War"

    for i in range(-100, 101):
        if X < i and Y >= i and max(x) < i and min(y) >= i:
            result = "No War"

    print(result)
Buggy code:
N,M,X,Y = map(int, input().split())
num_list = [list(map(int, input().split())) for _ in range(2)]

x_max = max(num_list[0])
y_max = max(num_list[1])

if x_max >= y_max:
    print('War')
elif x_max < X or y_max > Y:
    print('War')
else:
    print('No war')


Fixed code:
N,M,X,Y = map(int, input().split())
num_list = [list(map(int, input().split())) for _ in range(2)]
 
x_max = max(num_list[0])
y_min = min(num_list[1])
 
if x_max >= y_min:
    print('War')
elif x_max < X or y_min > Y:
    print('War')
else:
    print('No War')
Buggy code:
_, _, x, y = map(int, input().split())
x_cities = map(int, input().split())
y_cities = map(int, input().split())

max_x, min_y = max(x_cities), min(y_cities)
if max_x < min_y and x < min_y < y:
  print("No war")
else:
  print("War")

Fixed code:
_, _, x, y = map(int, input().split())
x_cities = map(int, input().split())
y_cities = map(int, input().split())

max_x, min_y = max(x_cities), min(y_cities)
if max_x < min_y and x < min_y < y:
  print("No War")
else:
  print("War")