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

if xlist[n-1] < ylist[0]:
   if xlist[n-1] > X and ylist[0] <= 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()))
xlist.append(X)
ylist.append(Y)
xlist.sort()
ylist.sort()

if xlist[-1] < ylist[0]:
   print("No War")
else:
   print("War")
Buggy code:
count = 0
N,M,X,Y = list(map(int,input().split(' ')))
XL = list(map(int,input().split(' ')))
YL = list(map(int,input().split(' ')))
 
for z in range(X+1,Y+1):
	if z>max(XL) and z<=min(YL):
		count += 1 
 
if count>0:
	print('No war')
else:
	print('war')

Fixed code:
count = 0
N,M,X,Y = list(map(int,input().split(' ')))
XL = list(map(int,input().split(' ')))
YL = list(map(int,input().split(' ')))
 
for z in range(X+1,Y+1):
  if z>max(X,max(XL)) and z<=min(Y,min(YL)):
    count += 1 

if count>0:
  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())))
ok = False
for z in range(x+1,y+1):
        if x < z and y >= z:
            ok = True
            break
if ok :print("No War")
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())))
ok = False
for z in range(X+1,Y+1):
        if x < z and y >= z:
            ok = True
            break
if ok :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()))
ans = 0
for z in range(X+1,Y+1):
    if max(x) < z and min(y) >= z:
        ans = 1
    if ans == 1:
        j = z
        break
if ans == 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()))
ans = 0
for z in range(X+1,Y+1):
    if max(x) < z and min(y) >= z:
        ans = 1
    if ans == 1:
        j = z
        break
if ans == 0:
    print('War')
else:
    print('No War')
Buggy code:
N,M,X,Y=list(map(int, input().split()))
xc=list(map(int, input().split()))
yc=list(map(int, input().split()))
xc.sort()
yc.sort()
if xc[-1]>=yc[0]:
  print('War')
else:
  print('No War')

Fixed code:
N,M,X,Y=list(map(int, input().split()))
xc=list(map(int, input().split()))
xc.append(X)
yc=list(map(int, input().split()))
yc.append(Y)
xc.sort()
yc.sort()
if xc[-1]>=yc[0]:
  print('War')
else:
  print('No War')
Buggy code:
n,m,X,Y=map(int,input().split())

p_x=[int(j) for j in input().split()]
p_y=[int(i) for i in input().split()]

max_x=max(p_x)
Z=min(p_y)

if max_x<Z and (X<Z and X<=Y):
    print('No war')
else:
    print('War')

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

p_x=[int(j) for j in input().split()]
p_y=[int(i) for i in input().split()]

max_x=max(p_x)
Z=min(p_y)

if max_x<Z and (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()))
x_list = []
y_list = []
for v in x:
    x_list.append(v)
for v in y:
    y_list.append(v)
x_list.sort(reverse=True)
y_list.sort()
if x_list[0]>=y_list[0]:
    print('War')
else:
    XY = list(range(x_list[0]+1, y_list[0]+1))
    for v in XY:
        if (v > X) and (v <= Y):
            print('No War')
            break
        else:
            continue
    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_list = []
y_list = []
for v in x:
    x_list.append(v)
for v in y:
    y_list.append(v)
x_list.sort(reverse=True)
y_list.sort()
if x_list[0]>=y_list[0]:
    print('War')
else:
    XY = list(range(x_list[0]+1, y_list[0]+1))
    for v in XY:
        if (v > X) and (v <= Y):
            print('No War')
            break
        print('War')
Buggy code:
n, m, X, Y = map(int, input().split())
x = map(int, input().split())
y = 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 = map(int, input().split())
y = map(int, input().split())

if(max(max(x), X) < min(min(y), Y)):
    print("No War")
else:
    print("War")
Buggy code:
head=[int(n) for n in input.readline().split()]
list_x=[int(n) for n in input.readline().split()]
list_x.append(head[2])
list_y=[int(n) for n in input.readline().split()]
if max(list_x) < min(list_y):
    print("No War")
else:
    print("War")

Fixed code:
head=[int(n) for n in input().split()]
list_x=[int(n) for n in input().split()]
list_x.append(head[2])
list_y=[int(n) for n in input().split()]
list_y.append(head[3])
if max(list_x) < min(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 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) 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()))
x.append(X)
y.append(Y)
x.sort(reverse = True)
y.sort()
print(x[0],y[0])
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()))
y = list(map(int, input().split()))
x.append(X)
y.append(Y)
x.sort(reverse = True)
y.sort()
#print(x[0],y[0])
if x[0]<y[0]:
    print('No War')
else:
    print('War')
Buggy code:
N, M, X, Y = map(int, input().rstrip().split())
x = [int(_) for _ in input().rstrip().split()]
y = [int(_) for _ in input().rstrip().split()]

Flag = True
for z in range(X+1, Y+1):
    if max(x) >= z and min(y) < z:
        Flag = False

if Flag:
    print("No War")
else:
    print("War")

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

Flag = False
for z in range(X+1, Y+1):
    if max(x) < z and min(y) >= z:
        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()))

x.append(X)
y.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()))

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

if max(x)<min(y): print("No War")
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()))

if max(x) < min(y) and a < b:
    print('No 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.append(a)
y.append(b)

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 max(x) >= min(y):
  print("War")
  quit()
else:
  if X < min(y) - max(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):
  print("War")
  quit()
else:
  if max(x) <= X or min(y) > 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 X < Y and 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, max(x)) < min(Y, min(y)):
    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()))

a=x_max+1
b=y_min

def judge(a,b):
    if(a>b):
        return print("No War")
    else:
        z=range(a,b+1)
        for i in z:
            if(i>X and i<=Y):
                return print("No War")
        else:
            return print("War")
        
judge(a,b)

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

a=max(x)+1
b=min(y)

def judge(a,b):
    if(a>b):
        return print("War")
    else:
        z=range(a,b+1)
        for i in z:
            if(i>X and i<=Y):
                return print("No War")
        else:
            return print("War")
        
judge(a,b)
Buggy code:
#-*-coding:utf-8-*-

def main():
    n, m, x, y = map(int, input().split())
    x_list = list(map(int, input().split()))
    y_list = list(map(int, input().split()))
    for z in range(x + 1, y+1):
        if all(x < z for x in x_list) and all(y >= z for y in y_list):
            print('No War')
            print(z)
            exit()
    print('War')

if __name__ == '__main__':
    main()

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

def main():
    n, m, x, y = map(int, input().split())
    x_list = list(map(int, input().split()))
    y_list = list(map(int, input().split()))
    for z in range(x + 1, y+1):
        if all(x < z for x in x_list) and all(y >= z for y in y_list):
            print('No War')
            exit()
    print('War')

if __name__ == '__main__':
    main()
Buggy code:
#110
n, m, x, y = map(int, input().split())
xlist = list(map(int, input().split()))
ylist = list(map(int, input().split()))

xmax = max(max(xlist),x)
ymin = min(min(ylist),y)

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

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

xmax = max(max(xlist),x)
ymin = min(min(ylist),y)

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

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

input = sys.stdin.readline


def main():
    n, m, X, Y = map(int, input().split())
    x = list(map(int, input().split()))
    y = list(map(int, input().split()))
    war = "No War"
    for z in range(X, Y + 1):
        if X <= z <= Y and all([i < z for i in x]) and all([i >= z for i in y]):
            war = "War"
            break
    print(war)


if __name__ == "__main__":
    main()


Fixed code:
import sys

input = sys.stdin.readline


def main():
    n, m, X, Y = map(int, input().split())
    x = list(map(int, input().split()))
    y = list(map(int, input().split()))
    war = "War"
    for z in range(X + 1, Y + 1):
        if all([i < z for i in x]) and all([i >= z for i in y]):
            war = "No War"
            break

    print(war)


if __name__ == "__main__":
    main()
Buggy code:
n, m, x, y = map(int, input().split())
xl = list(map(int, input().split()))
yl = list(map(int, input().split()))
mx = max(xl) + 1
my = min(yl)
for i in range(x + 1, y + 1):
    if mx <= i <= my:
        print(mx, my, i, x, y)
        print("No War")
        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()))
mx = max(xl) + 1
my = min(yl)
for i in range(x + 1, y + 1):
    if mx <= i <= my:
        print("No War")
        exit()
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(" ")))

if x<y and max(X)<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<y and max(X)<min(Y) and max(X)<y and x<min(Y):
    print("No War")
else:
    print("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()))
xmax = max(list_x)
ymin = min(list_y)
for i in range(x+1,y+1):
  if xmax < i and i <= ymin:
    print("No war")
    exit()
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()))
xmax = max(list_x)
ymin = min(list_y)
for i in range(x+1,y+1):
  if xmax < i and i <= ymin:
    print("No War")
    exit()
print("War")
Buggy code:
N, M, X, Y = [int(i) for i in input().split()]
x_ls = [int(i) for i in input().split()]
y_ls = [int(i) for i in input().split()]
max_x = max(x_ls)
min_y = min(y_ls)
flg = 0
for z in range(int(X + 0.00001), int(Y)):
    if max_x < z <= min_y:
        flg = 1
if flg > 0:
    print("War")
else:
    print("No War")

Fixed code:
import math
N, M, X, Y = [int(i) for i in input().split()]
x_ls = [int(i) for i in input().split()]
y_ls = [int(i) for i in input().split()]
max_x = max(x_ls)
min_y = min(y_ls)
flg = 0
for z in range(int(math.ceil(X + 0.00001)), int(Y)):
    if max_x < z <= min_y:
        flg = 1
if flg > 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()))
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(list(map(int,input().split()))))
y = min(Y,min(list(map(int,input().split()))))

if 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()))
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()))
x.append(X)
y.append(Y)
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()))
x.append(X)
y.append(Y)
# print(x)
# print(y)
print("No War" if max(x)<min(y) else "War")
# if max(x) < min(y):
#     print('No war')
# else:
#     print('War')
Buggy code:
n,m,x,y=map(int,input())
a=max(list(map(int,input().split())))
b=min(list(map(int,input().split())))
print("No War" if a<b and x<b else "War")

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

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

a = max(a)
b = min(b)
if x < b and y > a:
    print('No War')
else:
    print('War')


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

a = max(a)
b = min(b)
if x < b and y > a and a < b:
    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()))
aMAX = max(a)
bMIN = min(b)
if (a<b and a+1>x and a+1<=y):
  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 = max(a)
b = min(b)
if (a<b and a+1>x and a+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()))

x.sort()
y.sort()
if x[n - 1] <= y[0] and X <= y[0] and x[n - 1] <= 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)
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())
x = list(int(i) for i in input().split())
y = list(int(i) for i in input().split())

x.sort()
y.sort()

if x[-1] < Y and y[0] >X:
    print("No War")
else:
    print("War")

Fixed code:
n, m, X,Y = 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()

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

data_x = list(map(int,input().split()))
data_y = list(map(int,input().split()))

max_x = max(data_x)
min_y = min(data_y)

if  max_x > min_y:
	print('War')
else:
    print('No War')

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

data_x = list(map(int,input().split()))
data_y = list(map(int,input().split()))

max_x = max(data_x)
min_y = min(data_y)

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

    mx = max(x)
    my = min(y)

    lx = max(mx, X)
    ly = min(my, Y)
    if lx < ly:
        print("No war")
    else:
        print("War")   

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

    mx = max(x)
    my = min(y)

    lx = max(mx, X)
    ly = min(my, Y)
    if lx < ly:
        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)
x.sort()
y.sort()

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

if x[-1] >= y[0]:
    print("War")
else:
    print("No War")
Buggy code:
n,m,x,y=map(int,input().split())
xx=[int(i) for i in input().split()]
yy=[int(i) for i in input().split()]
ok=False
for i in range(x,y+1):
    ansx=[0 if j<i else 1 for j in xx]
    ansy=[0 if j>=i else 1 for j in yy]
    if 1 not in ansx and 1 not in ansy:
        ok=True
        break
if ok:
    print("No War")
else:
    print("War")

Fixed code:
n,m,x,y=map(int,input().split())
xx=[int(i) for i in input().split()]
yy=[int(i) for i in input().split()]
ok=False
for i in range(x+1,y+1):
    ansx=[0 if j<i else 1 for j in xx]
    ansy=[0 if j>=i else 1 for j in yy]
    if 1 not in ansx and 1 not in ansy:
        ok=True
        break
if ok:
    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, Y+1):
  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+1):
  if max(x) < z <= min(y):
    print("No War")
    exit()
print("War")
Buggy code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

N, M, X, Y = MAP()
x = LIST()
y = LIST()

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

for Z in range(X, Y+1):
	if max_x < Z <= min_y:
		print("No War")
		break
else:
	print("War")


Fixed code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

N, M, X, Y = MAP()
x = LIST()
y = LIST()

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

for Z in range(X+1, Y+1):
	if max_x < Z <= min_y:
		print("No War")
		break
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 = list(range(X,Y+1))
b = list(range(max(x),min(y)+1))
if list (set(a)&set(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(j) for j in input().split()]
a = list(range(X+1,Y+1))
b = list(range(max(x)+1,min(y)+1))
if list (set(a)&set(b))!=[]:
    print('No War')
else :
    print('War')
Buggy code:
n,m,x,y = map(int,input().split())
xlis = list(map(int,input().split()))
ylis = list(map(int,input().split()))

if max(xlis)+1 < min(ylis) and x+1 < min(ylis) and max(xlis)+1 < y:
    print('No War')
    exit()
print('War')


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

if max(xlis) < min(ylis) and x < min(ylis) and max(xlis) < 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()))
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()))
print('No War' if max(max(x), X) < min(min(y), 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()))
maxs = max(x)
mins = min(y)

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

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

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