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-----
3 2 10 20
8 15 13
16 22

-----Sample Output-----
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

Difficulty: introductory

Starter code:

Solutions:
def readinput():
    n,m,x,y=list(map(int,input().split()))
    xx=list(map(int,input().split()))
    yy=list(map(int,input().split()))
    return n,m,x,y,xx,yy

def main(n,m,x,y,xx,yy):
    xx.append(x)
    yy.append(y)
    xx.sort()
    yy.sort()
    if xx[-1]<yy[0]:
        return 'No War'
    else:
        return 'War'

def __starting_point():
    n,m,x,y,xx,yy=readinput()
    ans=main(n,m,x,y,xx,yy)
    print(ans)

__starting_point()


url = "https://atcoder.jp//contests/abc110/tasks/abc110_b"

def main():
    n, m, x, y = list(map(int, input().split()))
    xs = list(map(int, input().split()))
    ys = list(map(int, input().split()))
    xs.sort()
    ys.sort()
    if xs[-1] >= ys[0]:
        print('War')
        return
    for i in range(xs[-1] + 1, ys[0] + 1):
        if x < i <= y:
            print('No War')
            return
    print('War')


def __starting_point():
    main()

__starting_point()

n,m,X,Y=map(int,input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
 
x.sort(reverse=True)
y.sort()
 
 
flag=0
for i in range(X+1,Y+1):
  if x[0]<i and y[0]>=i:
    flag=1
    break
  
 
  else:
    flag=0
    
if flag==1:
  print('No War')
  
else:
  print('War')

def mapt(fn, *args):
    return tuple(map(fn, *args))


def Input():
    return mapt(int, input().split(" "))


def main():
    n, m, x, y = Input()
    x_data = Input()
    y_data = Input()
    x_max = max(x_data)
    y_min = min(y_data)
    ans = False

    for i in range(-100, 101):
        if x_max < i <= y_min and x < i <= y:
            ans = True
            break

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


main()

n, m, x, y = list(map(int, input().split()))
xn = list(map(int, input().split()))
yn = list(map(int, input().split()))
maxx = max(xn)
miny = min(yn)
if x < miny and miny <= y and miny > maxx:
    print("No War")
else:
    print("War")


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 and X < y[0] and x[n - 1] < y[0]:
    print('No War')
else:
    print('War')

n, m, x, y = (int(i) for i in input().split())
list_x = sorted(list(map(int, input().split())))
list_y = sorted(list(map(int, input().split())))
if max(x ,list_x[-1]) < min(y, list_y[0]):
    print("No War")
else:
    print("War")

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

x_max = max(x)
z = min(y)

if X < z <= Y and x_max < z:
  print('No War')
else:
  print('War')

n, m, x, y = list(map(int, input().split()))
xx = list(map(int, input().split()))
yy = list(map(int, input().split()))
for i in range(x+1, y+1):
    if max(xx) < i <= min(yy):
        print('No War')
        return
print('War')


n,m,x,y=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)<y and x<min(y_list):
  print("No War")
else:
  print("War")

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")
    return
print("War")

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

p = list(map(int, input().split()))
q = list(map(int, input().split()))

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

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

print('No War' if max(A) < min(B) else 'War')

N, M, X, Y = list(map(int, input().split()))
max_X = max(list(map(int, input().split())))
min_Y = min(list(map(int, input().split())))

for Z in range(X+1, Y+1):
    if max_X < Z <= min_Y:
        print("No War")
        return
else:
    print("War")


n, m, x, y = map(int,input().split())
max_x = max(list(map(int,input().split())))
min_y = min(list(map(int,input().split())))

for z in range(x+1,y+1):
  if max_x < z <= min_y:
    print("No War")
    return
else:
  print("War")

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

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("War")
else:
  print("No War")

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

# ABC110
# B 1 Dimensional World's Tale
N, M, X, Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))
x = sorted(x, reverse=True)
y = sorted(y)
ANS = []
ans = x[0]+1
while True:
    if ans <= y[0]:
        ANS.append(ans)
        ans = ans + 1
    else:
        break
for i in ANS:
    if X < i:
        if i < Y:
            print("No War")
            return
print("War")

import numpy as np

n, m, x, y = list(map(int, input().split()))
px = np.array([int(i) for i in input().split()])
py = np.array([int(i) for i in input().split()])

res = 'War'
for i in range(x+1, y+1):
    if np.count_nonzero(px < i) == n and np.count_nonzero(py >= i) == m:
        res = 'No War'
        break
print(res)


def main():
    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[len(x)-1] < y[0] < Y:
        print('No War')
    else:
        print('War')
main()  

n,m,x,y = list(map(int, input().split()))
a = list(map(int, input().split())) + [x]
b = list(map(int, input().split())) + [y]
print(("No War" if max(a) < min(b) else "War"))



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

n,m,x,y = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
a.sort(reverse = True)
b.sort()
bool = False
if a[0] < b[0]:
    for i in range(a[0] + 1,b[0] + 1):
        if x < i and i <= y:
            bool = True
if bool:
    print('No War')
else:
    print('War')

n, m, X, Y = list(map(int, input().split()))
x = list(map(int, input().split()))
y = list(map(int, input().split()))
x = sorted(x, reverse=False)[-1]
y = sorted(y, reverse=False)[0]
flg = 'War'
if x < x+1 <= y:
    if x+1 > X:
        if x+1 <= Y:
            flg = 'No War'

print(flg)    


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

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


N, M, X, Y = map(int, input().split())
X_list = list(map(int, input().split()))
Y_list = list(map(int, input().split()))
maxX = max(X_list)
minY = min(Y_list)
for z in range(maxX+1, minY+1):
    if z > X and Y >= z:
        print("No War")
        return
print("War")

n,m,x,y=map(int,input().split())
lx=list(map(int,input().split()))
ly=list(map(int,input().split()))
z=max(lx)+1 if max(lx)>=x else x+1

if min(ly)<z or y<z:
  print("War")
  
else:
  print("No War")

import sys
from collections import deque
mapin = lambda: map(int, sys.stdin.readline().split())
listin = lambda: list(map(int, sys.stdin.readline().split()))
inp = lambda: sys.stdin.readline()

N,M,X,Y = mapin()
veca = listin()
vecb = listin()
max_x = -10000
min_y = 10000
for i in veca:
    if max_x < i:max_x = i
for i in vecb:
    if min_y > i:min_y = i
if max_x < min_y and max_x > X and min_y < Y:
    print("No War")
else:print("War")

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):
  if X < min(y) <= Y:
    print("No War")
    return
print("War")

n, m, x, y = list(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")


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


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("War")
else:
  print("No War")


n,m,a,b = map(int,input().split())
x = list(map(int,input().split()))
y = list(map(int,input().split()))
x.sort()
y.sort()
if x[-1]<y[0]:
    for i in range(x[-1]+1,y[0]+1):
        if a<i<b:
            print("No War")
            break
    else:
        print("War")
else:
    print("War")

n, m, X, Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))
cnt = 0
for z in range(-100, 101):
    if X < z and z <= Y and max(x) < z and min(y) >= z:
        print("No War")
        break
    else:
        cnt += 1
        if cnt == 201:
            print("War")
            break

from typing import List


def answer(n: int, m: int, x: int, y: int, xs: List[int], ys: List[int]) -> str:
    xs.append(x)
    ys.append(y)
    if min(ys) <= max(xs):
        return 'War'
    return 'No War'


def main():
    n, m, x, y = list(map(int, input().split()))
    xs = list(map(int, input().split()))
    ys = list(map(int, input().split()))
    print((answer(n, m, x, y, xs, ys)))


def __starting_point():
    main()


__starting_point()

N, M, X, Y = map(int, input().split())
x = [int(s) for s in input().split()]
y = [int(s) for s in input().split()]
x.append(X)
y.append(Y)
print('No War') if max(x) < min(y) else print('War')


N,M,X,Y = map (int, input ().split ())
lx = [int (x) for x in input().split()]
lx.append (X)
ly = [int (y) for y in input().split()]
ly.append (Y)
if X >= Y or max(lx) >= min(ly):
  print ('War')
else:
  print ('No War')

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

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

n,m,x,y = map(int, input().split())
xl = list(map(int, input().split()))
yl = list(map(int, input().split()))
z = 'War'
for i in range(x+1,y+1):
    if max(xl) < i and i <= min(yl):
        z = 'No War'
        break
print(z)

_,_,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)
flag = False
for z in range(X+1,Y+1):
  if x_max < z <= y_min:
    flag = True
print("No War" if flag else "War")

import sys
n, m, x, y = list(map(int, input().split()))
x1 = max(list(map(int, input().split())))
y1 = min(list(map(int, input().split())))


for i in range(x+1, y+1):
    if x1 < i <= y1:
        print('No War')
        return
print('War')



n, m, x, y = map(int, input().split())
x_list = list(map(int, input().split()))
y_list = list(map(int, input().split()))
flag = False
if max(x_list) < min(y_list):
    flag = True
if flag:
    for i in range(max(x_list) + 1, min(y_list) + 1):
        if x < i <= y:
            flag = True
            break
        else:
            flag = False
if flag:
    print('No War')
else:
    print('War')

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

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 and X<y[0] and x[n-1]<y[0]:
  print("No War")
else:
  print("War")

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

N,M,X,Y = map(int,input().split())
xx = list(map(int, input().split()))
yy = list(map(int, input().split()))

xx.sort()
yy.sort()


for Z in range(X+1,Y):
    if Z > xx[-1] and yy[0] >= Z:
        print('No War')
        return

print('War')

def __starting_point():
	n,m,x,y = list(map(int,input().split()))
	X = list(map(int,input().split()))
	Y = list(map(int,input().split()))
	X.sort()
	Y.sort()

	flg = False
	#xの場所がYのFROM-に入っていないこと
	if (Y[0] <= x):
		flg = True
	#yの場所がXのFROM-に入っていないこと
	elif (y <= X[n-1]):
		flg = True
	#Xの右端とYの左端が交わらないこと
	elif (X[n-1] >= Y[0]):
		flg = True
 
	if flg:
		print("War")
	else:
		print("No War")

__starting_point()

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)
if mx<my:
    for i in range(mx+1,my+1):
        if x<i<=y:
            print("No War")
            return
    print("War")
    
        
    

else:
    print("War")


            


n,m,x,y = map(int,input().split())
x_list = list(map(int,input().split()))
y_list = list(map(int,input().split()))

isWar = True
z = min(y_list)
if (x<z<=y) and (max(x_list)<z):
    isWar = False

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

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

for z in range(X+1,Y+1):
    if x<z<=y:
        print("No War")
        return
print("War")


n,m,x,y = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]
b = [int(x) for x in input().split()]
max_x = max(a)
min_y = min(b)
max_x = max(max_x,x)
min_y = min(min_y,y)

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

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 and min(y)>=i:
    print('No War')
    return

print('War')

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

if sx[-1] < sy[0] and X < sy[0] and sx[-1] < Y:
    print('No War')
else:
    print('War')

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

x = list(map(int, input().split()))
y = list(map(int, input().split()))

Z = [X+1, Y]

x.sort()
y.sort()

Z[0] = max(x[-1]+1, Z[0])
Z[1] = min(y[0], Z[1])

print(("No War" if Z[0]<=Z[1] else "War"))


n,m,x,y=map(int,input().split())
for i in [i for i in range(max(list(map(int,input().split())))+1,min(list(map(int,input().split())))+1)]:
  if x<i<=y: print('No War');break
else:
  print('War')

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

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)

if Mx >= My or Mx >= Y or X >= My:
  print("War")
else:
  print("No War")

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[-1] < y[0] and X < x[-1] and y[0] <= Y:
    print("No War")
else:
    print("War")

N, M, X, Y = list([int(a) for a in input().split(" ")])
x = list([int(b) for b in input().split(" ")])
y = list([int(c) for c in input().split(" ")])
x.append(X)
y.append(Y)
x.sort()
y.sort()
if x[-1] < y[0]:
  print("No War")
else:
  print("War")


N,M,X,Y=list(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")


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_start=x[-1]+1
Z_end=y[0]

for z in range(Z_start, Z_end+1):
    if X<z<=Y:
        print("No War")
        return

print("War")

import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


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

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

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

    return


def __starting_point():
    main()

__starting_point()

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

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

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

#X < x[-1]では境界値が抜けている。
if x[-1] < y[0] and X <= x[-1] and y[0] <= Y:
    print("No War")
else:
    print("War")


N,M,X,Y=map(int,input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
ans="War"
x.append(X)
y.append(Y)
if max(x)<min(y):
        ans="No War"
print(ans)

n,m,x,y = list(map(int,input().split()))
a = list(map(int,input().split()))
b = list(map(int,input().split()))
if max(max(a),x) < min(min(b),y):
  print("No War")
else:
  print("War")


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_max = max(x_list)
y_min = min(y_list)

ans = "War"
for Z in range(X+1, Y+1):

    if x_max < Z <= y_min:
        ans = "No War"
        break

print(ans)


import sys


stdin = sys.stdin
def ns(): return stdin.readline().rstrip()
def ni(): return int(stdin.readline().rstrip())
def nm(): return list(map(int, stdin.readline().split()))
def nl(): return list(map(int, stdin.readline().split()))


def main():
    n, m, x, y = nm()
    X = nl()
    Y = nl()
    xx = max(X)
    yy = min(Y)
    for z in range(-100, 101):
        if x < z <= y and xx < z <= yy:
            print('No War')
            return
    print('War')


def __starting_point():
    main()

__starting_point()

#k = int(input())
#s = input()
#a, b = map(int, input().split())
#s, t = map(str, input().split())
#l = list(map(int, input().split()))
#l = [list(map(int,input().split())) for i in range(n)]
#a = [list(input()) for _ in range(n)]
#a = [input() for _ in range(n)]


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

xmax = max(xl)
ymin = min(yl)

isWar = True
for i in range(x+1, y+1):
    if (xmax < i and ymin >= i):
        isWar = False
        break
if (isWar):
    print("War")
else:
    print("No War")



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

def __starting_point():
	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)

	flg = False
	for Z in range(X+1,Y+1):
		if x_max < Z <= y_min:
			flg = True
			break

	if flg:
		print("No War")
	else:
		print("War")
__starting_point()

*_,x,y=map(int,input().split())
for i in [i for i in range(max(list(map(int,input().split())))+1,min(list(map(int,input().split())))+1)]:
  if x<i<=y: print('No War');break
else:
  print('War')

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

left = max(a)
right = min(b)

if left < right and (x <= left < y or x < right <= y):
    print('No War')
else:
    print('War')

n,m,x,y = map(int,input().split())
xs = list(map(int,input().split()))
ys = list(map(int,input().split()))
xs.sort()
ys.sort()
if x >= y:
    print('War')
else:
    for i in range(x+1,y+1):
        if i > xs[-1] and i <= ys[0]:
            print('No War')
            return
        else:
            ans = 'War'
print(ans)

n,m,X,Y=map(int,input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
if min(Y,min(y))-max(X,max(x))>=1:
    print("No War")
else:
    print("War")

N,M,X,Y = (int(T) for T in input().split())
ACityMax = sorted(int(T) for T in input().split())[-1]
BCityMin = sorted(int(T) for T in input().split())[0]
if ACityMax<BCityMin and ACityMax<Y and X<BCityMin:
    print('No War')
else:
    print('War')

n,m,x,y = map(int,input().split())
xl = list(map(int,input().split()))
yl = list(map(int,input().split()))
z = [i for i in range(x+1,y+1)]
for i in range(len(z)):
  if max(xl) < z[i] <= min(yl):
    print("No War")
    return
print("War")

n,m,x,y = list(map(int,input().split()))
xl = list(map(int,input().split()))+[x]
yl = list(map(int,input().split()))+[y]
if max(xl)+1<=min(yl):
    print("No War")
else:
    print("War")


N,M,X,Y=map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
A.append(X)
B.append(Y)
A.sort()
B.sort()
if A[-1]>=B[0]:
  print("War")
else:
  print("No War")

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

N,M,X,Y = map(int,input().split())
x_lis = list(map(int,input().split()))
y_lis = list(map(int,input().split()))

x_max = max(x_lis)
y_min = min(y_lis)

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

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

if max(xl) < min(yl) and x < min(yl) and max(xl) < y:
    print('No War')
else:
    print('War')

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

print(['No War', 'War'][max(x + [X]) >= min(y + [Y])])

n,m,x,y=list(map(int, input().split()))
x_list=[int(i) for i in input().split()]
y_list=[int(i) for i in input().split()]

ans="War"

for i in range(x+1, y+1):
    if max(x_list)<i<=min(y_list):
        ans="No War"
        break

print(ans)


s = input().split()
n = int(s[0])
m = int(s[1])
x = int(s[2])
y = int(s[3])

city_a = []
city_b = []

v = input().split()
w = input().split()

for i in range(n):
    city_a.append(int(v[i]))
for i in range(m):
    city_b.append(int(w[i]))

city_a.sort()
city_b.sort()

p = city_a.pop()
q = city_b[0]

check = False

for i in range(x + 1, y+1):
    if p < i <= q:
        check = True
        break

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


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

N,M,X,Y=list(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")


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

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)
if max(xlist)<min(ylist):
  print('No War')
else:
  print('War')

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

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

l = max(X)
r = min(Y)

print('No War' if l < r and not (y <= l or r <= x) else 'War')

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

n, m, X, Y = list(map(int, input().split()))
x = list(map(int, input().split())) + [X]
y = list(map(int, input().split())) + [Y]
if min(y)-max(x) >= 1:
    print('No War')
else:
    print('War')






n,m,x,y = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
a.append(x)
b.append(y)
a =sorted(a)
b =sorted(b)
if a[-1]<b[0]:
    print('No War')
else:
    print('War')

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

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


a,b,x,y = map(int, input().split())

xl = list(map(int, input().split()))
yl = list(map(int, input().split()))

xx = max(xl)
xx = max(xx,x)
yy = min(yl)
yy = min(yy,y)

if xx<yy:
    print("No War")

else:
    print("War")

n, m, x, y = map(int, input().split())
a, b = [list(map(int, input().split())) for i in range(2)]

for i in range(x + 1, y + 1):
  if all(j < i for j in a) and all(k >= i for k in b):
    print("No War")
    break
else:
  print("War")

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

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