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):
import sys
n, m, x, y = map(int, input().split())
lineA = list(map(int, input().split()))
lineB = list(map(int, input().split()))
maxA = max(lineA)
minB = min(lineB)
if maxA >= minB:
    print("War")
else:
    for i in range(x + 1, y):
        if maxA < i and i <= minB:
            print("No War")
            sys.exit(0)
    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(x,max(xlist))
ymin=min(y,min(ylist))

if xmax +1 <= ymin:
    print('No War')
else:
    print('War')

Solution (Python):



def main():
    N, M, X, Y = map(int, input().split())
    x = map(int, input().split())
    y = map(int, input().split())
    max_x = max(x)
    min_y = min(y)
    if max_x > min_y:
        print('War')
        return
    if X >= Y:
        print('War')
        return
    for i in range(X+1, Y):
        if max_x < i <= min_y:
            print('No War')
            break
    else:
        print('War')





if __name__ == "__main__":
    main()

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 z in range(X+1, Y+1): 
    if max(x) < z and min(y) >= z:
        print("No War")
        sys.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.append(X)
y.append(Y)

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

Solution (Python):
I=lambda:[int(i) for i in input().split()]
n,m,x,y=I()
a=sorted(I())
b=sorted(I())
t=b[-m]
if x<t<=y and sum(1 for i in a if i<t)>=n:
  print('No War')
else:
  print('War')

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

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

war = True
if xx < yy:
    z = []
    for i in range(xx+1,yy+1):
        z.append(i)
    for i in range(len(z)):
        if z[i] <= Y and z[i] > X:
            war = False
            break

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

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

Solution (Python):
i=lambda:list(map(int,input().split()));n,m,x,y=i();print('No '*(max(i()+[x])<min(i()+[y]))+'War')

Solution (Python):
i=lambda:map(int,input().split());n,m,x,y=i();print('No '*(max(list(i())+[x])<min(list(i())+[y]))+'War')

Solution (Python):
x,y=input().split()[2:];print('No '*(max(map(int,input().split()+[x]))<min(map(int,input().split()+[y])))+'War')

Solution (Python):
x,y=input().split()[2:];print('No '*(max(map(int,input().split()+[x]))<min(map(int,input().split()+[y])))+'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 min(y) > max(x):
    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()))

outbreak = True

for z in range(x, y+1):
    if x < z < y and max(xs) < z and min(ys) >= z:
        outbreak = False

print('War' if outbreak else 'No War')

Solution (Python):
n,m,x,y=map(int,input().split());x=max(list(map(int,input().split()))+[x]);y=min(list(map(int,input().split()))+[y]);print('No War'if x<y 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())))
if X < Y and x < y and x < Y and X < y:
	print("No War")
else:
	print("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()))


max_x = max(max(x_list), X)
min_y = min(min(y_list), Y)

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

Solution (Python):
iptA=list(map(int,input().split()))
X=list(map(int,input().split()))
Y=list(map(int,input().split()))
X.append(iptA[2])
Y.append(iptA[3])
     
xmax,ymin=max(X),min(Y)
if xmax>=ymin:
    print('War')
else:
    print('No War')

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

    xs = list(map(int,input().split()))
    ys = list(map(int,input().split()))
    zs = []

    for n in range(X+1,Y+1):
        zs.append(n)

    xMax = max(xs)
    yMin = min(ys)
    tmp = []
    for z in zs:
        if z > xMax:
            tmp.append(z)
        if z <= yMin:
            tmp.append(z)

    flag = False
    for z in zs:
        if tmp.count(z) > 1:
            flag = True


    if len(zs) == 0:
        print("War")
        return 0

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

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

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

print(ans)

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

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

res = False
for th in range(X+1, Y+1):
  is_up = all([x < th for x in xs ])
  is_down = all([y >= th for y in ys])
  
  
  if is_up and is_down:
    res = True

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

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

for z in range(x+1,y+1):
  if max(a)<z and min(b)>=z:
    print("No War")
    break
else:
  print("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.sort()
y_list.sort()

for z in range(X+1, Y):
    if x_list[-1] < z <= y_list[0]:
        print("No War")
        exit()
print("War")

Solution (Python):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**13
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)


def main():
    n,m,x,y = LI()
    a = LI()
    b = LI()
    t = max(a)
    u = min(b)
    for i in range(x+1,y+1):
        if t < i <= u:
            return 'No War'

    return 'War'


print(main())

Solution (Python):
from sys import stdin
il = lambda: list(map(int, input().split()))
IL = lambda: list(map(int, stdin.readline().rstrip().split()))
ils = lambda n, s="int(input())": [eval(s) for _ in range(n)]

n, m, x, y = IL()
xs = IL()
ys = IL()
a = max(xs)
b = min(ys)
if x < a and b <= y and 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()))
x.append(X)
y.append(Y)

def check1():
    for Z in range(-100, 101):
        flag = True

        for v in x:
            if Z <= v:
                flag = False
                break
        
        for v in y:
            if v < Z:
                flag = False
                break
        
        if flag:
            return False
        
    return True


def check2():
    return max(x) >= min(y)

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

def check2():
    return max(x) >= min(y)

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

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

print("No War" if max([x]+a) < min([y]+b) else "War")

Solution (Python):
N, M, X, Y = tuple(map(int, input().split()))
area_X = [int(x) for x in input().split()]
area_Y = [int(x) for x in input().split()]
area_X.append(X)
area_Y.append(Y)

print('No War' if max(area_X) < min(area_Y) else 'War')

Solution (Python):


N,M,X,Y=map(int,raw_input().split())
x=map(int,raw_input().split())
y=map(int,raw_input().split())
xmax=max(x)
ymin=min(y)
if xmax<Y and ymin>X and xmax<ymin:
 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)

Xa = max(XL)
Ya = min(YL)

if Xa < Ya:
  print("No War")
else:
  print("War")

Solution (Python):
n, m, x, y = map(int, input().split())
xlst = list(map(int, input().split()))
ylst = list(map(int, input().split()))
xlst += [x]
ylst += [y]
xmax = max(xlst)
ymin = min(ylst)
if xmax < ymin:
    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()))
mx = max(xs)
my = min(ys)
for z in range(mx+1,my+1):
    if X < z <= Y:
        print('No War')
        exit()
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()))

    mx, my = max(max(X), x), min(min(Y), y)
    if mx < my:
        print("No War")
    else:
        print("War")


if __name__ == '__main__':
    main()

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

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

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

Solution (Python):
import sys

n,m,x,y = (int(_) for _ in input().split())
xl = [int(_) for _ in input().split()]
yl = [int(_) for _ in input().split()]

xl.append(x)
yl.append(y)

xl.sort()
yl.sort()

print('War') if (xl[-1] >= yl[0]) 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()))

if max(x+[X])<min(y+[Y]):
    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()))
amax=max(a)
bmin=min(b)
c=a+b;flag=0
for i in range(n+m):
    if (c[i]>x and c[i]<=y) and (amax<c[i]) and (bmin>=c[i]):
        print('No War')
        flag=1
        break
if flag==0:
    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(X+1, Y+1):
    check = True
    for p in x:
        if p >= z:
            check = False
            break
    if check:
        for q in y:
            if q < z:
                check = False
                break
        if check:
            print("No War")
            exit()
print("War")

Solution (Python):
N, M, X, Y = map(int, input().split())
xs = list(map(int, input().split()))
xs.append(X)
ys = list(map(int, input().split()))
ys.append(Y)
xmax = max(xs)
ymin=  min(ys)
if xmax<ymin:
    print("No 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,raw_input().split())
x = map(int,raw_input().split())
y = map(int,raw_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())
a=[int(i) for i in input().split()] + [x]
b=[int(i) for i in input().split()] + [y]

A=max(a)
B=min(b)

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

Solution (Python):

from sys import stdin

s_in = lambda: stdin.readline()[:-1] 
d_in = lambda: int(stdin.readline()) 
ds_in = lambda: list(map(int, stdin.readline().split())) 

N, M, X, Y = ds_in()
x_arr = ds_in()
y_arr = ds_in()

max_x = max(x_arr)
min_y = min(y_arr)
for z in range(X+1, Y+1):
    if max_x < z and z <= min_y:
        print('No War')
        exit()

print('War')

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

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




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

if x_max >= y_min:
    ans = True
else:
    ans = False

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

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

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

if x_max >= y_min:
    war_happen = True
else:
    war_happen = False

print('War' if war_happen 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()))
x.append(X)
y.append(Y)
x = sorted(x)
y = sorted(y)

for z in range(-100,101):
    ans = "War"
    if z > max(x) and z <= min(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()))
x.sort()
y.sort()
if(x[-1]<y[0] and X<y[0] and x[-1]<Y):
    print("No War")
else:
    print("War")

Solution (Python):
l = input().split()


N = int(l[0])
M = int(l[1])
X = int(l[2])
Y = int(l[3])

"""
if X < -100:
    X = -100
elif X > 100:
    X = 100

if Y < -100:
    Y = -100
elif Y > 100:
    Y = 100
"""

lx = input().split()
ly = input().split()

lx = [int(z) for z in lx]
ly = [int(z) for z in ly]

lx = sorted(lx)


ly = sorted(ly)

flag = True


if int(ly[0]) - int(lx[N-1]) >= 1:
    for z in range(int(lx[N-1]) + 1, int(ly[0]) + 1):

        if z > X and z <= Y:
            flag = False
            break


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

Solution (Python):


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

if not(X < Y):
    print("War")
else:
    Z = list(range(X + 1, Y + 1))
    out = "War"
    for num in Z:
        if (max(X_arr) < num and num <= min(Y_arr)):
            out = "No War"
            break
    print(out)

Solution (Python):
from functools import reduce
from operator import and_

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

xs = list(map(int, input().split()))
ys = list(map(int, input().split()))

Z = -1
R = 'War'
for zz in range(X + 1, Y + 1):
    xb = reduce(and_, [x < zz for x in xs])
    yb = reduce(and_, [y >= zz for y in ys])
    if xb and yb:
        R = 'No War'
        break

print(R)

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

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

    if flg:
        print("No War")
    else:
        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.sort()
y.sort()

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

Solution (Python):


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

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

flag_war = True

for z in range(X+1, Y+1):
    if x_max < z:
        if y_min >= z:
            print('No War')
            flag_war = False
            break
        else:
            continue
    else:
        continue
if flag_war == True:
    print('War')

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


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

if (X >= Y):
    print('War')
elif (xx >= yy):
    print('War')
elif (yy <= X):
    print('War')
elif (Y <= xx):
    print('War')
else:
    print('No War')

Solution (Python):
n, m, x, y = map(int,input().split())
lsx = input().split()
lsy = input().split()
lsx = list(map(int, lsx))
lsy = list(map(int, lsy))
z = False

lsxmax = max(lsx)
lsymin = min(lsy)
for i in range(x + 1, y + 1):
	if ((i > lsxmax) and (i <= lsymin)):
		z = True
if(z):
	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())))

if X< max(x)<min(y)<Y:
    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()))



xlist.sort()
ylist.sort()

xmax=xlist[N-1]
ymax=ylist[M-1]
xmin=xlist[0]
ymin=ylist[0]



if X+1<=Y and xmax<ymin and xmax<Y and ymin>X:
    print("No War")
else:
    print("War")

Solution (Python):

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


x = [int(N) for N in input().split()]
y = [int(M) for M in input().split()]

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




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

Solution (Python):
str1 = input();
str2 = str1.split(" ")
n = int(str2[0])
m = int(str2[1])
xcap = int(str2[2])
ycap = int(str2[3])

strx = input()
stry = input()
strx2 = strx.split(" ")
stry2 = stry.split(" ")
for i in range(n):
    strx2[i] = int(strx2[i])

for i in range(m):
    stry2[i] = int(stry2[i])

if max(max(strx2),xcap) < min(min(stry2), ycap):
    print("No War")
else:
    print("War")

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

a = max(A)
b = min(B)

print('No War' if a < b 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 and (min(y)-max(x)>0) and (Y>max(x) and X<min(y)):
    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()))


a = 0
if x < y:
    if max(xlist) < min(ylist):
        if (max(xlist) < y) and (x < min(ylist)):
            print('No War')
        else:
            print('War')
    else:
        print('War')
else:
    print('War')

Solution (Python):

"""
Created on Sun Sep 23 21:12:01 2018

@author: masato
"""

N, M, X, Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))
x.sort()
y.sort()
xmin = x[0]
ymin = y[0]
xmax = x[-1]
ymax = y[-1]

z = max(xmax,ymin)

iswar = 0

for i in range(len(x)):
    if min(ymin,Y) <= x[i]:
        iswar = 1
        break
        
for j in range(len(y)):
    if max(xmax,X) >= y[j]:
        iswar = 1
        break

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

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

pos_cls = [[i, 'x'] for i in x]
pos_cls.append([X, 'x'])
pos_cls.extend([[i, 'y'] for i in y])
pos_cls.append([Y, 'y'])
pos_cls = sorted(pos_cls, key=lambda x:x[0])
if 'y' in [i[1] for i in pos_cls[:N+1]] or pos_cls[N][0] == pos_cls[N+1][0]:
	print 'War'
else:
	print 'No War'

Solution (Python):


N,M,X,Y=[int(i) for i in input().split()]
x=[int(i) for i in input().split()]+[X]
y=[int(i) for i in input().split()]+[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())
px = list(map(int, input().split()))
py = list(map(int, input().split()))

if max(px) < min(py) and (x+1) < y and max(px) < y and x < min(py) :
    for z in range(x+1, y+1):
        if z in range(max(px), min(py)+1):
            print('No War')          
            break
    else:
        print('War')
else:
    print('War')

Solution (Python):




"""








"""
def get_input():
    first = [int(i) for i in input().split(" ")]
    second = list(sorted([int(i) for i in input().split(" ")]))
    third = list(sorted([int(i) for i in input().split(" ")]))

    return first[2], first[3], second, third

def judge(x, y, x_list, y_list):
    """
    >>> judge(10,20,[8,15], [16,22])
    >>> judge(-48, -1, [-20,-35,-91,-23], [-22, 66])
    >>> judge(6,8, [-10,3,1,5,-100], [100,6,14])
    """
    x_max = max(x_list)
    y_min = min(y_list)

    if x >= y:
        return False
    if x_max >= y_min:
        return False
    if y <= x_max:
        return False
    if y_min <= x:
        return False
    return True



if __name__ == '__main__':
    
    
    res = judge(*get_input())
    if res:
        print("No War")
    else:
        print("War")

Solution (Python):
f=input().split()
(n,m,x,y)=(int(f[0]),int(f[1]),int(f[2]),int(f[3]))
ax=[int(i) for i in input().split()]
ay=[int(i) for i in input().split()]
ax.sort()
ay.sort()
b=ay[0]-ax[-1]
c=0
if x<ax[-1] and y>ax[-1]:
    c=1
elif x>ax[-1] and x<ay[0] and y<ay[0]:
    c=1
elif x>ax[-1] and y>ay[0] and x<ay[0]:
    c=1
if b>0 and c==1:
    print("No War")
else:
    print("War")

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

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

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

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

Solution (Python):
a=map(int, raw_input().split())
b=map(int, raw_input().split())
c=map(int, raw_input().split())

b.sort()
c.sort()
b.reverse()

if b[0]<c[0] and a[2]<c[0] and b[0]<a[3]:
    print "No War"
else:
    print "War"

Solution (Python):
def judge_place_term(a_cities, b_cities, z):
    for city_x in a_cities:
        if z <= city_x:
            return False
    for city_y in b_cities:
        if z > city_y:
            return False

    return True

def judge_war(a_cities, b_cities, x, y):
    for z in range(x + 1, y + 1, 1):
        if judge_place_term(a_cities, b_cities, z):
            return False
    
    return True

stats = input().split(" ")

n = int(stats[0])
m = int(stats[1])
x = int(stats[2])
y = int(stats[3])

a_cities = [int(city) for city in input().split(" ")]
b_cities = [int(city) for city in input().split(" ")]

if judge_war(a_cities, b_cities, x, y):
    print("War")
else:
    print("No 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()]

battle_flag=False

X_max=max(x)
Y_min=min(y)

battle_flag=True

for Z in range(X,Y+1):
    if X_max<Z and Z<=Y_min:
        
        if X<Z and Z<=Y:
            battle_flag=False

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

Solution (Python):



import sys

input1 = raw_input().split(" ")
input1 = [int(i) for i in input1]
N = input1[0]
M = input1[1]
X = input1[2]
Y = input1[3]

input2 = raw_input().split(" ")
input2 = [int(i) for i in input2]

input3 = raw_input().split(" ")
input3 = [int(i) for i in input3]


for i in range(X + 1, Y):
    if max(input2) < i <= min(input3):
        print "No War"
        sys.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)

xs.sort()
ys.sort()


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

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

max_x = max(xs)
min_y = min(ys)

res = 'War'
for z in range(-100, 101):
    if max_x < z and x < z and z <= y and z <= min_y:
        res = 'No War'
        break
    else:
        pass
print(res)

Solution (Python):
t = list(map(int, input().split()))[2:]
x = list(map(int, input().split()))
y = list(map(int, input().split()))

x.append(t[0])
y.append(t[1])
if max(x) < min(y):
    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()))
for z in range(-100,102):
    temp1 = 0
    if not(x < z <= y):
        continue
    for i in range(len(xn)):
        if not(xn[i] < z):
            temp1 = 1
            break
    for i in range(len(yn)):
        if not(yn[i] >= z):
            temp1 = 1
            break
    if temp1 == 1:
        continue
    else:
        break
print("War" if z == 101 else "No 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()]
x.sort()
y.sort()
if (x[N-1]<Y) and (x[N-1]<y[0]) 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()))
z = list(range(X+1,Y+1))

x.sort()
y.sort()

flag = 1

for i in z:
    if X<i<=Y and x[-1]<i and y[0]>=i:
        flag = 0
        
if flag == 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,min_y = max(x),min(y)

ans = ''
for Z in range(X+1,Y+1):
    if max_x < Z and Z <= min_y:
        ans = 'No '

print(ans+'War')

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

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

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()))
xmax = max(x_list)
ymin = min(y_list)
irange = y - x
for i in range(irange):
    if xmax < x+i+1 and x+i+1 <= ymin:
        print("No War")
        exit()
print("War")

Solution (Python):
N, M, X, Y = list(map(int, input().split()))
x = [0 for i in range(N)]
y = [0 for i in range(M)]
x = list(map(int, input().split()))
y = list(map(int, input().split()))
max_x = max(x)
min_y = min(y)
r = [i for i in range(max_x+1, min_y+1)]
count = 1
flag = False
while(True):
  if X + count in r:
    flag = True
    break
  else:
    if X + count == Y:
      break
    count += 1
if flag:
  print("No War")
else:
  print("War")

Solution (Python):


INF = float('inf')


def inpl(): return list(map(int, input().split()))


N, M, X, Y = inpl()
x = inpl()
y = inpl()
x.append(X)
y.append(Y)

x.sort()
y.sort()


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

flag=False

xmax = max(x)
ymin = min(y)

if X >= ymin:
    flag = True

if Y <= xmax:
    flag = True

if ymin - xmax <= 0:
    flag = True

if flag == False:
    print("No War")

else:
    print("War")

Solution (Python):
def answer(input0, input1, input2):
    values = [int(n) for n in input0.split(" ")]
    x = values[2]
    y = values[3]
    

    if x >= y:
        return False

    xa = sorted([int(n) for n in input1.split(" ")], reverse=True)
    

    ya = sorted([int(n) for n in input2.split(" ")], reverse=True)
    

    x0 = xa[0]
    yN = ya[len(ya)-1]

    if yN <= x0:
        return False

    candidate = yN - x0

    for i in range(candidate):
        z = yN - i
        if x0 < z and z <= yN and x < z and z < y:
            return True

    return False

res = answer(input(), input(), input())
if res:
    print("No War")
else:
    print("War")

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

Solution (Python):
iN,iM,iX,iY = [int(x) for x in input().split()]
aX = [int(x) for x in input().split()]
aY = [int(x) for x in input().split()]

aX.append(iX)
aY.append(iY)

if max(aX) < min(aY) :
    print("No War")
else:
    print("War")

Solution (Python):
e = input().split()
x = [int(i) for i in input().split()]
y = [int(i) for i in input().split()]

a = int(e[0])
b = int(e[1])
c = int(e[2])
d = int(e[3])

x.append(c)
y.append(d)
xmax = max(x)
ymax = min(y)

if xmax < ymax:
    print("No War")
else:
    print("War")
"""
if xmax < ymax:
    if c < ymax:
        if xmax < d:
            print("No War")
        else:
            print("War")
    else:
        print("War")
else:
    print("War")
"""

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

  for i in range(X+1, Y+1):
    if x[N-1] < i and i <= y[0] and X < i and i <= Y:
      print("No War")
      return 0

  print("War")
  
test()

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

res = 'No War'
xn_max = max(xn_list)
ym_min = min(ym_list)
y = int(y)
x = int(x)

if xn_max >= ym_min or xn_max >= y or x >= ym_min:
    res = 'War'

print(res)