Problem:
 Score : 200 points    Problem Statement Our world is one-dimensional, and ruled by two empires called Empire A and Empire B.  The capital of Empire A is located at coordinate X , and that of Empire B is located at coordinate Y .  One day, Empire A becomes inclined to put the cities at coordinates x_1, x_2, ..., x_N under its control, and Empire B becomes inclined to put the cities at coordinates y_1, y_2, ..., y_M under its control.  If there exists an integer Z that satisfies all of the following three conditions, they will come to an agreement, but otherwise war will break out.   X < Z \leq Y  x_1, x_2, ..., x_N < Z  y_1, y_2, ..., y_M \geq Z   Determine if war will break out.      Constraints  All values in input are integers.  1 \leq N, M \leq 100  -100 \leq X < Y \leq 100  -100 \leq x_i, y_i \leq 100  x_1, x_2, ..., x_N \neq X  x_i are all different.  y_1, y_2, ..., y_M \neq Y  y_i are all different.         Input Input is given from Standard Input in the following format:  N  M  X  Y  x_1  x_2  ...  x_N  y_1  y_2  ...  y_M       Output If war will break out, print War ; otherwise, print No War .        Sample Input 1 3 2 10 20
8 15 13
16 22      Sample Output 1 No War  The choice Z = 16 satisfies all of the three conditions as follows, thus they will come to an agreement.   X = 10 < 16 \leq 20 = Y  8, 15, 13 < 16  16, 22 \geq 16        Sample Input 2 4 2 -48 -1
-20 -35 -91 -23
-22 66      Sample Output 2 War       Sample Input 3 5 3 6 8
-10 3 1 5 -100
100 6 14      Sample Output 3 War

Solution (Python):
a = list(map(int, input().split()))
x = list(map(int, input().split()))
y = list(map(int, input().split()))
if max(a[2], max(x)) < min(a[3], min(y)):
  print('No War')
else:
  print('War')

Solution (Python):
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()

Solution (Python):
n, m, X, Y =map(int,input().split())
x = list(map(int,input().split()))
y = list(map(int,input().split()))
A = max(X,max(x))
B = min(Y,min(y))
if A < B:
    print("No War")
else:
    print("War")

Solution (Python):
n, m, x, y = [int(item) for item in input().split()]

xs = sorted([int(item) for item in input().split()] + [x])
ys = sorted([int(item) for item in input().split()] + [y])

if xs[-1] < ys[0]:
  print("No War")
else:
  print("War")

Solution (Python):
import numpy as np
N, M, X, Y = map(int, input().split())
x_n = np.array([input().split()], dtype=int)
y_n = np.array([input().split()], dtype=int)
count=0
for Z in range(X+1, Y+1):
    if np.all(x_n<Z) & np.all(y_n>=Z):
        count+=1
if count>0:
    print('No War')
else:
    print('War')

Solution (Python):
N,M,X,Y = map(int,input().strip().split())

x_max = max(list(map(int,input().strip().split())))
y_min = min(list(map(int,input().strip().split())))

for p in range(X + 1,Y + 1):
    if x_max < p and p <= y_min:
        print("No War")
        exit()

print("War")

Solution (Python):
n,m,x,y=map(int,input().split())
X=list(map(int,input().split()))
Y=list(map(int,input().split()))
X.sort()
Y.sort()
Z=[i for i in range(x+1,y+1)]
if X[-1]<Y[0]:
  z=[i for i in range(X[-1]+1,Y[0]+1)]
  if len(set(z)&set(Z))>0:
    print("No War")
  else:
    print("War")
else:
  print("War")

Solution (Python):
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")

Solution (Python):
import sys
from sys import stdin
n,m,x,y = [int(x) for x in stdin.readline().rstrip().split()]
xs = [int(x) for x in stdin.readline().rstrip().split()]
ys = [int(x) for x in stdin.readline().rstrip().split()]
for i in range(-100, 101):
    if x < i <= y and max(xs) < i <= min(ys):
        print('No War')
        sys.exit()
print('War')

Solution (Python):
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_list.append(x)
y_list.append(y)
max_x = max(x_list)
min_y = min(y_list)
if (min_y - max_x) > 0:
    print("No War")
else:
    print("War")

Solution (Python):

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

Solution (Python):
data = [int(s) for s in input().split()]

N = data[0]
M = data[1]
X = data[2]
Y = data[3]

a = [int(i) for i in input().split()]
b = [int(j) for j in input().split()]

am = max(a)

bm = min(b)

x = am

i = 0
f = 0

if am >= bm:
    print("War")
    f = 1

else:
    while x < bm:
        
        if x in range(X,Y):
            
            print("No War")
            f = 1
            break
        x += 1


if f == 0:
    print("War")

Solution (Python):
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')

Solution (Python):
n, m, cx, cy = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))
x.append(cx)
y.append(cy)
if(max(x) < min(y)) : print("No War")
else : print("War")

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

minX = max(x) + 1
maxY = min(y)

if X < minX and maxY <= Y and minX <= maxY:
    print("No War")
else:
    print("War")

Solution (Python):
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 Z in range(max(x)+1,min(y)+1):
     if X<Z<=Y:
         print("No War")
         break
     else:
         print("War")
         break
else:
  print("War")

Solution (Python):
N, M, X, Y = map(int, input().split())
x = [int(_) for _ in input().split()]
y = [int(_) for _ in input().split()]
flag = False

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

if max(x) < min(y) and max(x) < Y and X < min(y):
    flag = True

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

Solution (Python):
n,m,X,Y=map(int,input().split())
x=max(list(map(int,input().split())))
y=min(list(map(int,input().split())))
for i in range(x+1,y+1):
  if X<i and i<=Y:
    print('No War')
    exit()
print('War')

Solution (Python):
N, M, X, Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))
mx = max(X, max(x))
my = min(Y, min(y))
[print("No War" if mx < my else "War")]

Solution (Python):
N, M, X, Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))
mx = max(x)
my = min(y)
for z in range(-100, 101):
    if mx < z <= my and X < z < Y:
        print("No War")
        exit()
print("War")

Solution (Python):
n, m, x, y = [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_list.sort()
y_list.sort()
xmax = x_list[n-1]
ymin = y_list[0]

if ymin - xmax >= 1 and x < ymin and xmax+1 < y and y - x > 1:
    print("No War")
else:
    print("War")

Solution (Python):
NY=input().split()
N=int(NY[0]);M=int(NY[1]);X=int(NY[2]);Y=int(NY[3])
xs=input().split()
xs=[int(x) for x in xs]
ys=input().split()
ys=[int(y) for y in ys]
if X<Y and max(xs)<min(ys):
  if min(ys)<(X+1) or Y<(max(xs)+1):
    print("War")
  else:
    print("No War")
else:
  print("War")

Solution (Python):












n,m,x,y=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
xmax=-1000
ymin=1000

for i in range(0,n):
	if a[i]>xmax:
		xmax=a[i]

for i in range(0,m):
	if b[i]<ymin:
		ymin=b[i]

flag=0

for t in range(x+1,y+1):
	if xmax<t:
		if ymin>=t:
			flag=1
			break

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

Solution (Python):
n,m,x,y=map(int,input().split())
xn=list(map(int,input().split()))
yn=list(map(int,input().split()))
xn.sort()
yn.sort()
z=yn[0]
if x<z<y and xn[-1]<z and yn[0]>=z:
    print("No War")
else:
    print("War")

Solution (Python):
def main110():
    N, M, X, Y = (int(x) for x in input().split())

    a = list(map(int, input().split()))
    b = list(map(int, input().split()))

    if min(b) - max(a) >= 1:
        if max(a)+1 > X and max(a)+1 > Y:
            print("War")
        elif min(b) < X and min(b) < Y:
            print("War")
        elif max(a)+1 == X or min(b) == Y:
            print("War")
        else:
            print("No War")
    else:
        print("War")

main110()

Solution (Python):
N,M,X,Y=map(int,input().split())
Listx=list(input().split())
for i in range(N):
    Listx[i]=int(Listx[i])
Listx.sort()
Listy=list(input().split())
for i in range(M):
    Listy[i]=int(Listy[i])
Listy.sort()
low=max(X,Listx[N-1])
hight=min(Y,Listy[0])
if low<hight:
    print('No War')
else:
    print('War')

Solution (Python):
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')
elif max(max(x),X)<min(min(y),Y):
    print('No War')
else:
    print('War')

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

print("War")

Solution (Python):
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)
print('No War' if max(xs) < min(ys) else 'War')

Solution (Python):
n,m,x,y = map(int,input().split())
xs = max(list(map(int,input().split())))
ys = min(list(map(int,input().split())))
ans = 'War'
if xs+1 <= ys:
    for i in range(xs+1,ys+1):
        if x < i <= y:
            ans = 'No War'
            break
print(ans)

Solution (Python):
N,M,X,Y=map(int,input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
z1=max(x)+1
z2=min(y)
flag=False
if z1>z2:
    print('War')
else:
    for i in range(z1,z2+1):
        if X<i<=Y:
            flag=True
            break
    if flag:
        print('No War')
    else:
        print('War')

Solution (Python):
N,M,x,y = map(int,input().split())
X = input().split()
Y = input().split()

for i in range(N):
 X[i] = int(X[i])
for i in range(M):
 Y[i] = int(Y[i])
X.sort()
Y.sort()

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

Solution (Python):
N,M,X,Y=map(int,input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
Z1=list(int(i) for i in range(X+1,Y+1))
Z2=list(int(j) for j in range(max(x)+1,min(y)+1))
if len(list(set(Z1)&set(Z2)))>0:
    print('No War')
else:
    print('War')

Solution (Python):

_, _, X, Y = map(int, input().split())
xs = list(map(int, input().split()))
ys = list(map(int, input().split()))
rx = X
ry = Y
for x in xs:
    if rx < x:
        rx = x
for y in ys:
    if ry > y:
        ry = y
print(['No War', 'War'][ry - rx < 1])

Solution (Python):
n, m, X, Y = (int(i) for i in input().split())
x = [int(i) for i in input().split()]  
y = [int(i) for i in input().split()] 

x_max = max(X, max(x))
Z = x_max + 1

if Y < Z or min(y) < Z:
    print("War")
else:
    print("No War")

Solution (Python):
from sys import stdin
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 X <= Y:
    for Z in range(X+1,Y+1,1):
        if xmax < Z <= ymin:
            print('No War')
            exit()
    print('War')
else:
    print('War')

Solution (Python):
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(reverse = True)
y.append(Y)
y.sort()
if x[0] < y[0]:
  print("No War")
else:
  print("War")

Solution (Python):
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')

Solution (Python):
N, M, X, Y = map(int,input().split())
x = sorted(list(map(int,input().split())))
y = sorted(list(map(int,input().split())))
ans = "War"
for i in range(X+1,Y+1):
  if(x[-1] < i <= y[0]):
    ans = "No War"
print(ans)

Solution (Python):
N, M, X, Y = map(int, input().split())
Xi = list(map(int, input().split()))
Yi = list(map(int, input().split()))
Xi.append(X)
Yi.append(Y)
xm = max(Xi)
ym = min(Yi)

if xm < ym:
    print("No War")
else:
    print("War")

Solution (Python):
N,M,X,Y=map(int,input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
can=False
for Z in range(X+1,Y+1):
    if max(x)<Z<=min(y):
        can=True
if can:
    print("No War")
else:
    print("War")

Solution (Python):
N, M, X, Y = map(int, input().split())
x_list = list(map(int, input().split())) + [X]
x_list.sort()
y_list = list(map(int, input().split())) + [Y]
y_list.sort()
if max(x_list) < min(y_list):
    print('No War')
else:
    print('War')

Solution (Python):
def main():
    N, M, X, Y = map(int, input().split())
    x = list(map(int, input().split()))
    y = list(map(int, input().split()))

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

    print('War')


if __name__ == "__main__":
    main()

Solution (Python):
N,M,X,Y=map(int,input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
Z=min(y)
if X<Z<=Y and max(x)<Z and min(y)>=Z :
    print('No War')
else:
    print('War')

Solution (Python):
def ans():
  N, M, X, Y = map(int,input().split())
  x = sorted(list(map(int,input().split())))
  y = sorted(list(map(int,input().split())))
  for i in range(X+1, Y+1):
    if(x[-1] < i <= y[0]):
      print("No War")
      break
  else:
    print("War")
ans()

Solution (Python):
N,M,X,Y=map(int,input().split())
x=max(map(int,input().split()))
y=min(map(int,input().split()))
print('War' if x >= y or Y <= x or X >= y else 'No War')

Solution (Python):
ri = lambda: int(input())
rl = lambda: list(map(int,input().split()))
rr = lambda N: [ri() for _ in range(N)]
YN = lambda b: print('YES') if b else print('NO')
yn = lambda b: print('Yes') if b else print('No')
OE = lambda x: print('Odd') if x%2 else print('Even')
INF = 10**18

N,M,X,Y=rl()
x=rl()
y=rl()
x_ = max(x+[X])
y_ = min(y+[Y])

if x_ < y_:
    print('No War')
else:
    print('War')

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

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

Solution (Python):
def one_dimensional_worlds_tale(
        N: int, M: int, X: int, Y: int, x: list, y: list) -> bool:
    border_x = max([X] + x)
    border_y = min([Y] + y)
    return border_x < border_y


if __name__ == "__main__":
    N, M, X, Y = map(int, input().split())
    x = [int(s) for s in input().split()]
    y = [int(s) for s in input().split()]
    ans = one_dimensional_worlds_tale(N, M, X, Y, x, y)
    print('War' if not ans else 'No War')

Solution (Python):


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

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

Solution (Python):


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

Solution (Python):
n, m, x, y = map(int, input().split())
x_city=list(map(int, input().split()))
y_city=list(map(int, input().split()))
x_city.append(x)
y_city.append(y)
x_city.sort()
y_city.sort()
if x_city[-1]<y_city[0]:
    print('No War')
else:
    print('War')

Solution (Python):
N, M, X, Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))
x.sort()
y.sort()
Zx = x[-1] + 1
Zy = y[0]
flag = True
if Zx <= Zy:
    for z in range(Zx, Zy+1):
        if X < z and z<= Y:
            flag = False
            break
if flag:
    print("War")
else:
    print("No War")

Solution (Python):

n, m, x, y = [int(x) for x in input().split()]
xc = [int(x) for x in input().split()]
yc = [int(x) for x in input().split()]
if min(yc) - max(xc) < 1:
    print("War")
    exit()
if (y - max(xc) < 1) or (min(yc) - x < 1):
    print("War")
    exit()
print("No War")

Solution (Python):
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')

Solution (Python):
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")

Solution (Python):
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")

Solution (Python):
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")

Solution (Python):
n,m,x,y = map(int,input().split())

X = list(map(int,input().split()))
Y = list(map(int,input().split()))

c = 0

for i in range(x+1,y+1):
	if max(X) < i <= min(Y):
		c += 1

if c != 0:
	print('No War')
else:
	print('War')

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

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

Solution (Python):
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")

Solution (Python):
N,M,X,Y = map(int,input().split())
xs = list(map(int,input().split()))
ys = list(map(int,input().split()))
print(['War','No War'][max([X]+xs)<min([Y]+ys)])

Solution (Python):
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 + 1:
    print('War')
else:
    print('No War')

Solution (Python):






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





x.append(X)
sorted_x = sorted(x)
y.append(Y)
sorted_y = sorted(y)





if sorted_x[-1] < sorted_y[0]:
    print("No War")
else:
    print("War")

Solution (Python):
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')

Solution (Python):
N,M,X,Y = map(int,input().split())
xl = list(map(int,input().split()))
yl = list(map(int,input().split()))

if min(yl)-max(xl)>0:
    if min(yl)<=Y and min(yl)>X:
        ans = 'No War'
    else:
        ans = 'War'
else:
    ans = 'War'
    
print(ans)

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

def war(Z):
  for i in range(N):
    if x[i] >= Z:
      return False
  for i in range(M):
    if y[i] < Z:
      return False
  return True

ans = "War"
for i in range(X + 1, Y + 1):
  if war(i):
    ans = "No War"
    break
print(ans)

Solution (Python):
n,m,x,y = map(int, input().split())
x_list = list(map(int,input().split()))
y_list = list(map(int,input().split()))
x_max = max(x_list)
y_min = min(y_list)

def is_war(z):
  if x_max < z and y_min >=z and x<z and z<=y:
    return True
  else:
    return False

flag = False
for i in range(-100,100,1):
  if is_war(i):
    flag = True
print("No War" if flag else "War")

Solution (Python):
def solve(string):
    N, M, X, Y, *xy = map(int, string.split())
    x, y = xy[:N], xy[N:]
    max_x = max(x)
    min_y = min(y)
    if min_y <= max_x or min_y <= X or Y <= max_x:
        return "War"
    else:
        return "No War"


if __name__ == '__main__':
    print(solve("\n".join([input(), input(), input()])))

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

Solution (Python):
N, M, X, Y = map(int, input().split())
xlist = sorted([int(x) for x in input().split()])
ylist = sorted([int(y) for y in input().split()])

flg = 'War'
if X >= Y:
    pass    
else:
    for z in range(X+1, Y+1):
        if xlist[-1] < z and ylist[0] >= z:
            flg = 'No War'

print(flg)

Solution (Python):
n,m,X,Y=map(int,input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
temp=False
if Y-X>0:
    for i in range(X+1,Y):
        if max(x)<i and i<=min(y):
            temp=True
            break
if temp==False:
    print("War")
else:
    print("No War")

Solution (Python):
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)

max_x = max(x)
min_x = min(x)

for i in range(len(y)):
    if max_x >= y[i] and min_x <= y[i]:
        print('War')
        exit()
print('No War')

Solution (Python):


n,m,x,y = map(int, input().split())
xl=list(map(int, input().split()))
yl=list(map(int, input().split()))

xl.sort()
yl.sort()

yr=min(yl[0],y)

if xl[-1]<yr and x<yr:
  print('No War')
else:
  print('War')

Solution (Python):
n,m,x,y = map(int,input().split())
lix = [int(xn) for xn in input().split()]
liy = [int(yn) for yn in input().split()]
cnt = 0
if y - x < 1:
    cnt = 0
else:
    for i in range(x + 1, y + 1):
        if min(liy) - i >= 0 and i - max(lix) >= 1:
            cnt = 1
        
if cnt == 1:
    print("No War")
else:
    print("War")

Solution (Python):
N, M, X, Y = map(int, input().split())
x = [int(i) for i in input().split()]
y = [int(j) for j in input().split()]
if max(x) < min(y) and max(x) < Y and min(y) > X:
  print('No War')
else:
  print('War')

Solution (Python):
N, M, X, Y = map(int, input().split())
lst1 = sorted(map(int, input().split()))
lst2 = sorted(map(int, input().split()))
Z = int(lst2[0])
if  X < Z <= Y and int(lst1[-1]) < Z:
    print('No War')
else:
    print('War')

Solution (Python):
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")

Solution (Python):
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) and x < y:
    print('No War')
else:
    print('War')

Solution (Python):
(*_,X,Y),x,y=eval('map(int,input().split()),'*3);print('No'*(max(X,*x)<min(Y,*y)),'War')

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

ans = 'No War' if max([X]+x) < min([Y]+y) else 'War'
print(ans)

Solution (Python):
n, m, x, y = map(int, input().split())
xl = [int(i) for i in input().split()]
yl = [int(i) for i in input().split()]
xl.append(x)
yl.append(y)

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

Solution (Python):

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)

for i in range(len(x)):
	for j in range(len(y)):
		if (x[i] == y[j]):
			print('War')
			exit()

if max(x) >= min(y):
	print('War')
	exit()

print('No War')

Solution (Python):
n,m,x,y=map(int,input().split())
xl=list(map(int,input().split()))
yl=list(map(int,input().split()))

flag=False

if max(xl)>=min(yl):
    pass
else:
    l=range(max(xl)+1,min(yl)+1)
    for i in range(len(l)):
        if x<l[i]<=y:
            flag=True
        else:
            pass

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

Solution (Python):
(*z,X,Y),x,y=eval('map(int,input().split()),'*3);print('No War'[3*(max(X,*x)>=min(Y,*y)):])

Solution (Python):
n,m,x,y = map(int,input().split())
x_list = list(map(int,input().split()))
x_list.append(x)
y_list = list(map(int,input().split()))
y_list.append(y)
if max(x_list) < min(y_list):
    print('No War')
else:
    print('War')

Solution (Python):
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.append(y)
Y.sort()

if max(X)<min(Y):
    print('No War')
else:
    print('War')

Solution (Python):
N, M, X, Y = list(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')

Solution (Python):


"""
Created on Mon Feb 11 05:38:56 2019

@author: shinjisu
"""



import math


def getInt(): return int(input())


def getIntList(): return [int(x) for x in input().split()]


def zeros(n): return [0]*n


def dmp(x):
    global debug
    if debug:
        print(x)


debug = True


def getIntLines(n): return [int(input()) for i in range(n)]


def getIntMat(n):
    mat = []
    for i in range(n):
        mat.append(getIntList())
    return mat


def zeros2(n, m): return [zeros(m)]*n


def prob096():  
    X = getIntList()
    K = getInt()
    dmp((X, K))
    total = sum(X) - max(X) + max(X)*2**K
    return total


def prob097():  
    X = getInt()
    dmp(X)
    if X == 1:
        return 1
    for n in range(X, 0, -1):
        dmp(n)
        for b in range(2, int(math.sqrt(X))+1):
            a = n
            exp = True
            while a > 1:
                if a % b != 0:
                    exp = False
                    break
                a //= b
            if exp:
                break
        if exp:
            break
    return n


def prob098():  
    N = getInt()
    S = input()
    dmp((N, S))
    maxChCount = 0
    for i in range(1, N):
        before = S[:i]
        after = S[i:]
        dmp((before, after))
        chCount = 0
        for j in range(26):
            ch = chr(ord('a')+j)
            if ch in before and ch in after:
                chCount += 1
        maxChCount = max(maxChCount, chCount)
    return maxChCount


def prob099():  
    a, b = getIntList()
    height = 0
    for i in range(b-a+1):
        height += i
    height -= b
    return height


def prob103():  
    S = input()
    T = input()
    for i in range(len(S)):
        S = S[1:] + S[0]
        dmp(S)
        if S == T:
            return 'Yes'
    else:
        return 'No'


def prob110():  
    N, M, X, Y = getIntList()
    cX = getIntList()
    cY = getIntList()
    dmp((N, M, X, Y))
    dmp(cX)
    dmp(cY)
    NW = 'No War'
    WA = 'War'
    if Y <= X:
        return WA
    cX.sort()
    cY.sort()
    dmp(cX)
    dmp(cY)
    if cX[-1] < cY[0] and \
            X < cY[0] and \
            cX[-1] < Y:
        return NW
    else:
        return WA


def prob100():  
    return 0


debug = False  
print(prob110())

Solution (Python):
from sys import stdin
N,M,X,Y=[int(x) for x in stdin.readline().rstrip().split()]
datax=[int(x) for x in stdin.readline().rstrip().split()]
datay=[int(x) for x in stdin.readline().rstrip().split()]
if sorted(datax)[-1]+1 <= sorted(datay)[0] and  X < sorted(datax)[-1]  and sorted(datay)[0] <=Y: 
    print("No War")
else:
    print("War")

Solution (Python):
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")

Solution (Python):
n,m,x,y = map(int,input().split())
xl = list(map(int,input().split()))
yl = list(map(int,input().split()))
lm = list(range(x+1,y+1))
xl.sort(reverse=True)
yl.sort()
ans = "War"

for item in lm:
    if item > xl[0] and item <= yl[0]:
        ans = "No War"
        break
        
print(ans,end='')

Solution (Python):
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")

Solution (Python):
n, m, x, y = map(int, input().split())
areaX = list(map(int, input().split()))
areaY = list(map(int, input().split()))

areaX.append(x)
areaY.append(y)

if max(areaX) < min(areaY):
    print("No War")
else:
    print("War")

Solution (Python):


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

print("War")

Solution (Python):
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(x) < min(y) and max(x) < Y and min(y) > X else 'War')

Solution (Python):
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")

Solution (Python):
def main() -> None:
    N, M, X, Y = map(int, input().split())
    lx = list(map(int, input().split()))
    ly = list(map(int, input().split()))

    for Z in range(X+1, Y):
        if max(lx) < Z <= min(ly):
            print("No War")
            exit()
        else:
            continue

    print("War")


if __name__ == '__main__':
    main()

Solution (Python):
n, m, x, y = map(int, input().split())

li_x = list(map(int, input().split()))
li_y = list(map(int, input().split()))

max_x = max(li_x)
min_y = min(li_y)




if len(set([z for z in range(x + 1, y + 1)]).intersection(set([zz for zz in range(max_x + 1, min_y + 1)]))) > 0:
    print("No War")
else:
    print("War")

Solution (Python):
n, m, X, Y = map(int, input().split())
x = [int(i) for i in input().split()]
y = [int(i) for i in input().split()]

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

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

Solution (Python):
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 min(ys) - max(xs) < 1:
    print('War')
else:
    print('No War')

Solution (Python):
values1 = raw_input()
values2 = raw_input()
values3 = raw_input()

n,m,X,Y = values1.split(" ")
X = int(X)
Y = int(Y)
x =sorted([int(i) for i in values2.split(" ")]+[X])
y = sorted([int(i) for i in values3.split(" ")]+[Y])

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

Solution (Python):
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')

Solution (Python):
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')