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

num = []
if sorted(x)[-1] < sorted(y)[0]:
    for i in range(sorted(x)[-1] + 1, sorted(y)[0] + 1):
        num.append(i)
else:
    print("War")
    exit()

for i in num:
    if X < i <= Y:
        print("No War")
        exit()

print("War")

Solution (Python):
N,M,X,Y = map(int,input().split())
xi = sorted(list(map(int,input().split())))
yi = sorted(list(map(int,input().split())))
Z = yi[0]
if(Z>xi[-1] and Z >X and Z <= Y):
    print("No War")
else:
    print("War")

Solution (Python):
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(X,max(x))
y = min(Y,min(y))

answer = 'War' if y <= x else 'No War'

print(answer)

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

max_x = max(xn + [x])
min_y = min(yn + [y])

print("War" if max_x >= min_y else "No War")

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

Solution (Python):

import sys










def main():
    n, m, X, Y = (int(i) for i in sys.stdin.readline().split())
    x = [int(x) for x in sys.stdin.readline().split()]
    y = [int(y) for y in sys.stdin.readline().split()]
    max_x = max(x + [X])
    min_y = min(y + [Y])
    if Y - X < 1 or min_y - max_x < 1:
        ans = 'War'
    else:
        ans = 'No War'
    
    print(ans)
    
if __name__ == "__main__":
    main()

Solution (Python):
from sys import stdin
import fractions

n,m,x,y = [int(x) for x in stdin.readline().rstrip().split()]

lx = list(map(int,stdin.readline().rstrip().split()))
ly = list(map(int,stdin.readline().rstrip().split()))

lx.sort()
ly.sort()

if lx[-1]>=ly[0]:
    print("War")
    exit()

li = []

for i in range(lx[-1]+1,ly[0]+1):
    li.append(i)

for i in li:
    if x<i<=y:
        print("No War")
        exit()

print("War")

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

Solution (Python):
import sys
def input(): return sys.stdin.readline().strip()

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

main()

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 int(max(X))<int(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()))
X.append(x)
Y.append(y)
if int(max(X))<int(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()))
X.append(x)
Y.append(y)
if int(max(X))<int(min(Y)):
  print("No War")
else:
  print("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 min(y_lst) - max(x_lst) <= 0:
	print("War")
else:
	flg = 1
	for i in range(max(x_lst) + 1, min(y_lst) + 1):
		if X < i and i <= Y:
			flg = 0
			print("No War")
			break
	if flg:
		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 = list(map(int, input().split()))
y = list(map(int, input().split()))
xmax = max(x)
ymin = min(y)
if(xmax < ymin and X < ymin and xmax < 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 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")

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

j = 0
for z in range(X+1, Y+1):
	if max(x) < z and z <= min(y):
		j = 1
		break
if j == 1:
	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()))
y1=min(Y)
x1=max(X)
if x<y1 and x1<y:
    if x1<y1:
        print('No War')
    else:
        print('War')
else:
    print('War')

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

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

count = 0

for i in range(x+1, y+1):
    if max(X) < i and min(Y) >= i:
        count += 1
        break

if count == 1:
    print('No War')
else:
    print('War')

Solution (Python):
N,M,X,Y= map(int, input().split())
x_list = [int(e) for e in input().split()]
y_list = [int(e) for e in input().split()]

for i in range(X+1,Y+1):
  if max(x_list) < i and min(y_list) >= i:
    print("No War")
    break
else:
  print("War")

Solution (Python):
n, m, x, y = [int(x) for x in input().split()]
X = [int(x) for x in input().split()]
Y = [int(x) for x in input().split()]
isOK = max(X)< min(Y) and x < max(X) and min(Y) <= y
print('No War' if isOK else 'War')

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

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

print('No War' if max(x,xl[-1]) < min(y,yl[0]) else '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)

xs = sorted(xs)
ys = sorted(ys)

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

Solution (Python):
import sys
def input():
    return sys.stdin.readline()[:-1]
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] and x[-1]<Y and X<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)
x.sort()
y.sort()
if x[-1]>=y[0]:
  print("War")
else:
  print("No War")

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

Solution (Python):
N,M,X,Y=[int(i) for i in input().split()]

x = [X]
y = [Y]

x+=[int(i) for i in input().split()]
y+=[int(i) for i in input().split()]

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

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

for i in range(x+1, y+1):
	if(i <= a[-1]):
		continue
	if(i > b[0]):
		continue
	print ("No War")
	exit()
print ("War")

Solution (Python):
n,m,x,y =map(int,input().split())
lx = list(map(int,input().split()))
ly = list(map(int,input().split()))
lx.append(x)
ly.append(y)
lx.sort()
ly.sort()
if lx[-1] < ly[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()))
ans = "War"
for i in range(X+1,Y):
    if max(x) < i and min(y) >= i:
        ans = "No War"
        break
print(ans)

Solution (Python):


N, M, X, Y = list(map(int, input().split()))
x_list = list(map(int, input().split()))
y_list = list(map(int, input().split()))

if max(x_list) < min(y_list) and max(x_list) > X and min(y_list) <= Y:
    ans = "No War"
else:
    ans = "War"

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)
if x_max < y_min and x < y_min and x_max < y: 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()]

def check() :        
    for Z in range(max(x) + 1, min(y) + 1) :
        if X < Z <= Y :
            return 'No War'
    
    return 'War'
    
print(check())

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 min(y) > X and 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()))

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

flag = True
for i in range(X+1, Y+1):
    if i <= min_y and i > max_x:
        flag = False
        break
    
if flag == True:
    print("War")
else:
    print("No War")

Solution (Python):
n1, n2, n3, n4 = [int(i) for i in input().split()]

x1 = [int(i) for i in input().split()]
y1 = [int(i) for i in input().split()]

x1.append(n3)
y1.append(n4)

x2 = max(x1)
y2 = min(y1)

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

Solution (Python):
def solve():
    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:
        return 'No War'
    else:
        return 'War'


if __name__ == '__main__':
    print(solve())

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()
if xl[-1] >= yl[0]:
  print('War')
  quit()
for i in range(xl[-1]+1, yl[0]+1):
  if i>x and i<=y:
    print('No War')
    quit()
print('War')

Solution (Python):
def slove():
    import sys
    input = sys.stdin.readline
    n, m, x, y = list(map(int, input().rstrip('\n').split()))
    xl = list(map(int, input().rstrip('\n').split()))
    xl.sort()
    yl = list(map(int, input().rstrip('\n').split()))
    yl.sort()
    for i in range(x + 1, y + 1):
        if xl[-1] < i <= yl[0]:
            print("No War")
            exit()
    print("War")


if __name__ == '__main__':
    slove()

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

ans = 'War'
for z in range(X+1,Y+1):
    war = False
    for x in xlist:
        if x >= z:
            war = True
            break
    if war:
        continue

    for y in ylist:
        if y < z:
            war = True
            break
    if war:
        continue

    if not war:
        ans = 'No War'
        break

print(ans)

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

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_list.append(X)
y_list.append(Y)

max_x = max(x_list)
min_y = min(y_list)

for i in range(X, Y + 1):
    if max_x < i and i <= min_y:
        print('No War')
        break
    else:
        pass
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()))
a=max(x)
a=max(a,X)
b=min(y)
b=min(b,Y)
if a<b:
  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()))
flag = 0

Z_max = min(y)
Z_min = max(x)
Z = X + 1
while Z < Y:
    if Z_min < Z and Z <= Z_max:
        break
    Z += 1

for i in range(N):
    if x[i] >= Z:
        flag = 1
        break

if flag == 0:
    for i in range(M):
        if y[i] < Z:
            flag = 1
            break

if flag == 0:
    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)
x.sort()
y.sort()

if x[N] < y[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()))

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

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

domi_x = list(map(int, input().split()))
domi_y = list(map(int, input().split()))

domi_x.append(X)
domi_y.append(Y)

max_x = max(domi_x)
min_y = min(domi_y)

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

Solution (Python):
NMXY = list(map(int, input().split(' ')))

N = list(map(int, input().split(' ')))

M = list(map(int, input().split(' ')))

if ( NMXY[2] < min(M) and NMXY[3] >= min(M) ) :
  if ( max(N) < min(M) ):
    print('No War')
  else :
    print('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())))

if max(x, X[-1]) < min(y, Y[0]):
    print('No War')
else:
    print('War')

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

Solution (Python):
N,M,X,Y=map(int,input().split())
XX=max(list(map(int,input().split())))
YY=min(list(map(int,input().split())))
c=0

for i in range(X+1,Y+1):
    if i>XX and i<=YY:
        c=1
print(['War','No War'][c])

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

Solution (Python):
n,m,x,y=map(int,input().split())
x1=list(map(int,input().split()))
y1=list(map(int,input().split()))
if min(y1)-max(x1)>=1 and max(x1)<y and min(y1)>x:
    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)
x.sort()
y.sort()
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()))
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 = list(map(int, input().split()))
y = list(map(int, input().split()))

print("No War" if max(x + [X]) < min(y + [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()))
x.append(X)
y.append(Y)
ans = "War"
Xmax = max(x)
Ymin = min(y)





if Xmax < Ymin:
    ans = "No War"
print(ans)

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)+1
y_min=min(y)+1

flg=True

for z in range(x_max,y_min):
    if X<z<=Y:
        flg=False
        break
print("War" if flg else "No War")

Solution (Python):
import sys
n,m,x,y = map(int,input().split())
x_li = list(map(int,input().split()))
y_li = list(map(int,input().split()))
for z in range(x+1,y+1):
    if z>x and z>max(x_li) and z<=y and z<=min(y_li):
        print('No War')
        sys.exit()
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()))

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




XY_list = []
xy_list = []
for i in range(X+1, Y+1):
    XY_list.append(i)

if max_x   >= min_y:
    print("War")
    exit()

for i in range(max_x +1, min_y+1):
    xy_list.append(i)



set_XY = set(XY_list)
set_xy = set(xy_list)

print("No War" if set_XY & set_xy else "War")

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

Solution (Python):
n,m,X,Y = map(int,input().split())
x = list(map(int,input().split()))
y = list(map(int,input().split()))
for i in range(X+1,Y+1):
    for j in range(n):
        if i <= x[j]:
            break
    else:
        for k in range(m):
            if y[k] < i:
                break
        else:
            print('No War')
            break
else:
    print('War')

Solution (Python):
_,_,X,Y=map(int,input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
k=max(x)
l=min(y)
print('No War' if X<l and k<Y and k<l else '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())))

mixture = X + Y
sorted_mix = sorted(mixture)
if x > y:
    print("War")
    exit()

for i, j in zip(mixture, sorted_mix):
    if i != j:
        print("War")
        exit()

max_X = max(max(X), x)
min_Y = min(min(Y), y)

if max_X >= min_Y:
    print("War")
    exit()

print("No War")

Solution (Python):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)


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

    arr = x + y
    arr = [i for i in arr if X < i < Y]
    arr = [i for i in arr if x[-1] < i]
    arr = [i for i in arr if y[0] >= i]

    if arr:
        print('No War')
    else:
        print('War')


if __name__ == '__main__':
    main()

Solution (Python):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)


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

    arr = x + y
    arr = [i for i in arr if X < i < Y]
    arr = [i for i in arr if x[-1] < i]
    arr = [i for i in arr if y[0] >= i]

    if arr:
        print('No War')
    else:
        print('War')


if __name__ == '__main__':
    main()

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.append(X)
y_array.append(Y)
if max(x_array)<min(y_array):
    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_max = -101
for i in range(N):
    if x[i] > x_max:
        x_max = x[i]
y_min = 100
for i in range(M):
    if y[i] < y_min:
        y_min = y[i]
count = 0
for z in range(X+1,Y+1):
    if x_max < z:
        if z <= y_min:
            count = 1

if count:
    print('No War')
else:
    print('War')

Solution (Python):
n,m,x,y=map(int,input().split())
xi=[int(_) for _ in input().split()]+[x]
yi=[int(_) for _ in input().split()]+[y]
print('War' if max(xi) >= min(yi) else 'No War')

Solution (Python):
n,m,x,y=map(int,input().split())
xi=[int(_) for _ in input().split()]
yi=[int(_) for _ in input().split()]
print('War' if max(xi) >= min(yi) or x >= y  or max(xi) >= y or min(yi) <= x else 'No War')

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

if x >= y or Lx[-1] >= Ly[0] or Lx[-1] >= y or Ly[0] <= x:
        print('War')
else:
        print('No War')

Solution (Python):
import os, sys, re, math

N,M,X,Y = map(int,input().split(' '))

x_ary = list(map(int,input().split(' ')))
y_ary = list(map(int,input().split(' ')))
x_ary.sort()
y_ary.sort()

flg = False
for i in range(x_ary[-1], y_ary[0]):
    if i > X and i < Y:
        flg = True
        break
if flg:
    print('No War')
else:
    print('War')

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

print("War" if max(listX)>=min(listY) else "No War")

Solution (Python):
n,m,X,Y= map(int, input().split())
x=[int(_) for _ in input().split()]
y=[int(_) for _ in input().split()]
x.append(X)
y.append(Y)
x.sort(reverse=True)
y.sort()
print('No War' if x[0]<y[0] 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 X >= Y:
    print('War')
    exit()
for i in range(X+1, Y+1):
    if max(x) < i and min(y) >= i:
        print('No War')
        exit()
print('War')

Solution (Python):
n, m, x, y = map(int, input().split())
xs = map(int, input().split())
ys = map(int, input().split())
print("No War" if max(x, *xs) < min(y, *ys) else "War")

Solution (Python):
import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readline


def main():
    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 Z in range(X+1, Y+1):
        if x[N-1]<Z and y[0]>=Z:
            ans = "No War"
    
    print(ans)

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()))
flg = 'War'
for i in range(X+1, Y+1):
	if max(x) < i and i <= min(y):
		flg = 'No ' + flg
		break
print(flg)

Solution (Python):
n, m, x, y = [int(a) for a in input().split()]
left = max([int(l) for l in input().split()] + [x])
right = min([int(r) for r in input().split()] + [y])
print ('No War' if left < right else 'War')

Solution (Python):
import os, sys, re, math

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

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

Solution (Python):
line = raw_input()
N, M, X, Y = [int(s) for s in line.split(' ')]
line = raw_input()
xn = [int(s) for s in line.split(' ')] + [X]
line = raw_input()
ym = [int(s) for s in line.split(' ')] + [Y]

x_edge = max(xn)
y_edge = min(ym)

print 'No War' if x_edge < y_edge else 'War'

Solution (Python):
n, m, x, y = map(int, input().split())
xs = map(int, input().split())
ys = map(int, input().split())
print("No War" if max([x] + list(xs)) < min([y] + list(ys)) else "War")

Solution (Python):
N, M, X, Y = list(map(int, input().split(' ')))
xs = list(map(int, input().split(' ')))
ys = list(map(int, input().split(' ')))

print('War' if max(xs + [X]) >= min(ys + [Y]) else 'No War')

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

Solution (Python):
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
if max(A[2],max(B)) >= min(A[3],min(C)):
  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()))
Z='War'
for i in range(X+1,Y+1):

    if max(x)< i <= min(y) :

        Z='No War'

    else:

        continue

print(Z)

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

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)
x.sort(reverse = True)
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()))

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

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

Solution (Python):
import sys
N,M,X,Y = map(int,input().split())
x = list(map(int,input().split()))
y = list(map(int,input().split()))
for i in range(X+1,Y+1):
    if max(x) < i <= min(y):
        print("No War")
        sys.exit()
print("War")

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

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

Solution (Python):
N, M, X, Y =list(map(int,input().split()))
x = [i for i in map(int, input().split())]        
y =[i for i in map(int, input().split())]
x_max =max(x)
y_min =min(y)


for Z in range(X+1,Y+1):

  
  if x_max<Z and Z<=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()))
if max(x) < min(y) and X < 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 i in range(-100, 100):
    if X < i <= Y and max(x) < i <= min(y):
        print('No War')
        exit()
    else:
        pass
print('War')

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

a=[]
for i in range(2):
    b=list(map(int,input().split()))
    a.append(b)

ans=False
for i in range(X,Y+1):
    if i > X and i <= Y:
        if max(a[0]) < i and min(a[1]) >= i:
            ans=True

if ans:
    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()))

startWar = True
for Z in range(X+1, Y+1):
    warOccur = False
    if max(x) < Z:
        pass
    else:
        warOccur = True

    if Z <= min(y):
        pass
    else:
        warOccur = True

    if warOccur == True:
        continue
    else:
        startWar = False
        break

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

Solution (Python):
N, M, X, Y = map(int,input().split())
x = sorted(map(int,input().split()))
y = sorted(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())
x=list(map(int,input().split()))
y=list(map(int,input().split()))

print('No War' if min(min(y),Y)>max(max(x),X) else 'War')

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

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

if min_y <= max_x:
  print("War")
else:
  if Y <= max_x:
    print("War")
  elif X >= min_y:
    print("War")
  else:
    print("No War")

Solution (Python):
import sys
sys.setrecursionlimit(5 * 10**5)
input = sys.stdin.readline

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

Solution (Python):
N, M, X, Y = map(int,input().split())
x = max(map(int, input().split()))
y = min(map(int, input().split()))
print("No War" if x < y and X < y and x < Y else "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())))
maxx = max(x)
miny = min(y)
for z in range(1, Y - X + 1):
  if X + z > maxx and X + z <= miny:
    print("No War")
    exit(0)
print("War")