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

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

def check():
    for z in range(x+1, y+1):
        if max(a)<z and min(b)>=z:
            print("No War")
            return
    print("War")
    return

check()

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

xs2 = sorted(xs)
ys2 = sorted(ys)
for i in range(x+1, y+1):
	if xs2[-1] < i <= ys2[0]:
		print("No War")
		quit()
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()]

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

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

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

flag =False
d = x+1
while d <= y:
    if max(xs) < d and d <= min(ys):
        flag = True
        break
    d = d + 1

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

Solution (Python):
import math
import sys
import queue
from collections import Counter
from itertools import accumulate
from fractions import gcd
from functools import reduce


def lcm(a, b):
    return a * b // gcd(a, b)

def combination_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

def permutations_count(n, r):
    return math.factorial(n) // math.factorial(n - r)

sys.setrecursionlimit(10000)

mod = 1000000007

"""

a = 100
b = 0.987654321
print("{0:06d}-{1:6f}".format(a,b))
000100-0.987654


char_list = list("abcd") 



    = sys.stdin.readline().rstrip()
    = list(sys.stdin.readline().rstrip())


    = int(sys.stdin.readline())
    = map(int, sys.stdin.readline().split())
    = list(map(int, sys.stdin.readline().split()))
    = [list(map(int,list(sys.stdin.readline().split()))) for i in range(N)]
"""

if __name__ == "__main__":
    N, M, X, Y = map(int, sys.stdin.readline().split())
    x = list(map(int, sys.stdin.readline().split()))
    y = list(map(int, sys.stdin.readline().split()))
    x.append(X)
    y.append(Y)
    if max(x) >= min(y):
        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()))

flag = True

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

if Y - X < 2:
    flag = False

if y[0] <= x[-1] or (y[0] <= X or x[-1] >= Y):
    flag = False


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

Solution (Python):
N, M, X, Y = [int(x) for x in input().split()]
xN = [int(x) for x in input().split()] + [X]
yM = [int(x) for x in input().split()] + [Y]

if max(xN) < min(yM):
  print('No War')
else:
  print('War')

Solution (Python):
N,M,X,Y = map(int,input().split())
ans = 0
x = list(map(int,input().split()))
y = list(map(int,input().split()))
for i in range(X+1,Y):
  k = i
  if i>max(x):
    if i<=min(y):
      ans += 1
      break
if ans == 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()))

for z in range(-100,100+1):
    if X < z <=Y:
        if max(x) < z:
            if min(y) >= z:
                print('No War')
                break
else:
    print('War')

Solution (Python):
(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] < x):
  xs[-1] = x
if(y < ys[0]):
  ys[0] = y

z = ys[0]
if(z <= xs[-1]):
  print("War")
elif(x < z and z <= 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()))
a.sort()
b.sort()

for i in range(x+1,y+1):
    if a[n-1]<i<=b[0]:
        print('No War')
        break
else:
    print('War')

Solution (Python):
n,m,x,y= map(int,input().split())
lix=list(map(int,input().split()))
liy=list(map(int,input().split()))
lix.append(x)
liy.append(y)
lix.sort()
liy.sort()
if lix[n] < liy[0]:
  print("No War")
else:
  print("War")

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

Solution (Python):
def solve():
    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)
    return "War" if max(xs) >= min(ys) else "No War"


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

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

ret = 'No War'
if X < Y:
    limit_x = sorted(xx)[-1]
    limit_y = sorted(yy)[0]
    if  limit_x >= limit_y or limit_x >= Y or limit_y<= X: 
        ret='War'
else:
    limit_x = sorted(xx)[0]
    limit_y = sorted(yy)[-1]
    if limit_x <= limit_y or limit_x <= Y or limit_y >= X:
        ret='War'

print(ret)

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",end=" ")
print("War")

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

for Z in range(X+1, Y+1):
  if max(x)<Z and min(y)>=Z:
    war = "No War"
    break
  else:
    war = "War"
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 x < y and max(xl) < min(yl) and x < min(yl) and max(xl) < 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(x, y):
    z = i+1
    if max(X) < z and min(Y) >= z:
        print('No War')
        exit()

print('War')

Solution (Python):
n, m, x, y = map(int, input().split())
nli = list(map(int, input().split()))
mli = list(map(int, input().split()))
nli.append(x)
mli.append(y)
if max(nli) >= min(mli):
    print('War')
else:
    print('No 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_max=sorted(x)[-1]
y_min=sorted(y)[0]
for z in range(X+1,Y+1):
  if x_max < z <= y_min:
    print('No War')
    exit()
print('War')

Solution (Python):
import math
import copy
import sys



























inputa = input().split()
inputaList = [int(n) for n in inputa]

inputb = input().split()
inputbList = [int(n) for n in inputb]

inputc = input().split()
inputcList = [int(n) for n in inputc]

inputbList.append(inputaList[2])
xmin = min(inputbList)
xmax = max(inputbList)

inputcList.append(inputaList[3])
ymin = min(inputcList)
ymax = max(inputcList)

if xmax < ymin or ymax < xmin:
    print("No War")
else:
    print("War")

Solution (Python):
n,m,x,y=input().split()
n,m,x,y=int(n),int(m),int(x),int(y)
x1=input().split()
x2=[]
for i in range(n):
    x2.append(int(x1[i]))
y1=input().split()
y2=[]
for i in range(m):
    y2.append(int(y1[i]))

s="War"
if y>x:
    for i in range(y-x):
        if x+i+1>max(x2) and min(y2)>=x+i+1:
            s="No War"

print(s)

Solution (Python):

i = lambda:map(int,input().split())
_,_,x,y = i()
print('No War' if max(sum([list(i()),[x]],[])) < min(sum([list(i()),[y]],[])) else 'War')

Solution (Python):

i = lambda:map(int,input().split())
_,_,x,y = i()
print('No War' if len(set(range(max(i())+1,min(i())+1)).intersection(set(range(x+1,y+1)))) > 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()))

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

if (min(y)-max(x))>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()))
hantei = 0

for j in range(X + 1,Y+1):
    hantei1 = 0
    hantei2 = 0
    for k in range(N):
        if x[k] >= j:
           hantei1 = 1
           break
    for l in range(M):
        if y[l] < j:
           hantei1 = 1
           break
    if hantei1 == 0 and hantei2 == 0:
        print("No War")
        hantei = 1
        break
  
if hantei == 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()))

x_max = max(x)
y_min = min(y)
for i in range(-100,101):
    if X < i <= Y and x_max < i and y_min >= i:
        print("No War")
        exit()
print("War")

Solution (Python):
n,m,X,Y = map(int, input().split())
import numpy as np
x = np.array(list(map(int, input().split())))
y = np.array(list(map(int, input().split())))

for i in range(X+1,Y+1):
  if (x<i).all() and (y>=i).all():
    print("No War")
    break
else:
  print("War")

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

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

ans = 'No War' if max(max(xx), x) < min(min(yy), y) else 'War'
print(ans)

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

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

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

jpn = sorted(list(map(int, input().split())))
usa = sorted(list(map(int, input().split())))

a = list(range(jpn[-1]+1, usa[0]+1))

if not a:
    print('War')
    exit()

for i in a:
    if x < i <= y:
        print('No War')
        exit()

print('War')

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

x.append(xl)
y.append(yl)
x_mx=max(x)
y_mn=min(y)

res='War' 

if x_mx<y_mn:
	res='No War' 

print(res)

Solution (Python):
n,m,x,y = map(int,input().split())
xl = list(map(int,input().split()))
xl.append(x)
yl = list(map(int,input().split()))
yl.append(y)
if max(xl) < min(yl):
  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()))
a.append(x)
b.append(y)
if(min(b)>max(a)):
  print("No War")
else:
  print("War")

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

Solution (Python):
import sys
n,m,x,y =  list(map(int,input().split()))
xxx =  list(map(int,input().split()))
yyy =  list(map(int,input().split()))
if x < y:
  for i in range(x+1,y):
    if max(xxx) < i <= min(yyy):
      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 = sorted(x)
y = sorted(y)
if x[-1] < Y and y[0] > X and x[-1] < y[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.sort(reverse = True)
y.sort()

flag = 'War'
if x[0] < y[0]:
    zmin = x[0] + 1
    zmax = y[0]
    for i in range(zmin, zmax + 1):
        if X < i and i <= Y:
            flag = 'No War'
            break

print(flag)

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

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()))
x.append(X)
y.append(Y)
 
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()))
z = "War"

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

print(z)

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

if max(x1) < min(y1):
    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()))
mini = max(x)
maxi = min(y)
al = [i for i in range(X+1,Y+1)]
ol = [i for i in range(mini+1,maxi+1)]
for i in ol:
    if i in al:
        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)
if min(ly)-max(lx)>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()]

p=max(x)
q=min(y)

Z=max(p,X)+1

if Z<=Y and Z<=q:
    print("No War")
else:
    print("War")

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)

for i in range(x+1,y+1):
    if max_x < i <= min_y:
        print("No War")
        break
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 collections import deque

sys.setrecursionlimit(4100000)


def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def solve(inputs):
    [N, M, X, Y] = string_to_int(inputs[0])
    x = string_to_int(inputs[1])
    y = string_to_int(inputs[2])
    max_x = max(x)
    min_y = min(y)

    candidates = [x for x in range(max_x+1, min_y+1)]
    for c in candidates:
        if c > X and c <= Y:
            return "No War"
    return "War"


def string_to_int(string):
    return list(map(int, string.split()))


if __name__ == "__main__":
    ret = solve(inputs(3))
    print(ret)

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

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

print(ans)

Solution (Python):
N, M, X, Y = list(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+1):
  if  max(x) < i <= min(y):
    ans ='No War'
    break
    

print(ans)

Solution (Python):
n,m,x,y = map(int, input().split())
xli = list(map(int, input().split()))
yli = list(map(int, input().split()))
xmax = max(xli)
ymin = min(yli)
for z in range(x+1, y+1):
    if xmax < z <= ymin:
        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()))

count = 0

x.sort()
y.sort()




for Z in range(200):
    if X < Z-100 and Z-100 <= Y:
        if x[N-1] < Z-100 and y[0] >= Z-100:
            count += 1
            


if count != 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,max(x))
min_Y = min(Y,min(y))

if max_X<min_Y:
    print("No War")
else:print("War")

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

Solution (Python):
import numpy as np

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

if min(y_list) - max(x_list)>0:
  print("No War")
else:
  print("War")

Solution (Python):
n,m,x,y,*l=map(int,open(0).read().split());print((max(x,*l[:n])<min(y,*l[n:]))*"No "+"War")

Solution (Python):
n,m,x,y,*l=map(int,open(0).read().split())
print((max(l[:n]+[x])<min(l[n:]+[y]))*"No "+"War")

Solution (Python):


def main():

    tmp=list(map(int,input().split()))
    X = tmp[2]
    Y = tmp[3]
    xl = max(list(map(int,input().split())))
    yl = min(list(map(int,input().split())))

    for i in range(X+2,Y+1):
        if xl < i and i <= yl:
            print("No War")
            exit()

    print("War")
        
    
if __name__== "__main__":
    main()

Solution (Python):


def main():

    tmp=list(map(int,input().split()))
    X = tmp[2]
    Y = tmp[3]
    xl = list(map(int,input().split()))
    yl = list(map(int,input().split()))

    for i in range(X+2,Y+1):
        if max(xl) < i and i <= min(yl):
            print("No War")
            exit()

    print("War")
        
    
if __name__== "__main__":
    main()

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

Solution (Python):

tmp = [int(el) for el in input().split(' ')]
n = tmp[0]
m = tmp[1]
x = tmp[2]
y = tmp[3]

X = [int(el) for el in input().split(' ')]
Y = [int(el) for el in input().split(' ')]

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

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

if xList[-1] < yList[0] and xList[-1] > X and xList[-1] + 1 <= Y:
  print("No War");
else:
  print("War");

Solution (Python):

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

ans = 'War'
for i in range(X+1, Y+1):
    if (max(lst_x) < i and min(lst_y) >= i):
        ans = 'No War'
print(ans)

Solution (Python):
l = [int(i) for i in input().split(" ")]
n = l[0]
m = l[1]
x = l[2]
y = l[3]
z_set = set(range(x+1,y+1))
if len(z_set) == 0:
    print("War")
else:
    x_max = max([int(i) for i in input().split(" ")])
    y_min = min([int(i) for i in input().split(" ")])
    x_y_set = set(range(x_max+1,y_min+1))
    if len(x_y_set & z_set) == 0:
        print("War")
    else:
        print("No 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())))
for i in range(xx + 1, yy + 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()))

check = 0

for i in range(X+1, Y+1):
    tmp = 0
    for j in range(N):
        if x[j] < i:
            tmp += 1
    for j in range(M):
        if y[j] >= i:
            tmp +=1
    if tmp == N+M:
        check = 1
        break

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

Solution (Python):

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

xx = max(xs)
yy = min(ys)

ok = False
for z in range(x + 1, y + 1):
    if xx < z <= yy:
        ok = True

print("No War" if ok 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.sort()
Y.sort()

for i in range(x+1,y+1):
  if X[-1] < i and Y[0] >= i:
    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()))
x2=max(x)
y2=min(y)
if X <= x2 < y2 <= Y:
    print('No War')
else:
    print('War')

Solution (Python):
N,M,X,Y = (int(x) for x in input().split())
x_arr = sorted([int(x) for x in input().split()]+[X])
y_arr = sorted([int(x) for x in input().split()]+[Y])

if(x_arr[-1] < y_arr[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()))




x_max=int(max(xs))
y_min=int(min(ys))

if x_max<y_min and y_min<y and y_min!=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()))




x_max=int(max(xs))
y_min=int(min(ys))

if x_max<y_min and y_min<y and y_min!=x:
    print("No War")

else:
    print("War")

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

x_max = max(xs)
y_min = min(ys)

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

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

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

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

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

Solution (Python):
n, m, x, y = map(int, input().split())
l = [list(map(int, input().split())) for i in range(2)]
if min(l[1]) - max(l[0])> 0 and max(l[0]) < y and x < min(l[1]):
    print('No War')
else:
    print('War')

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

max_x = max(List_x)
min_y = min(List_y)
if max(X,max_x)+1 <= min(Y,min_y):
    print("No War")
else:
    print("War")

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

xa.sort()
ya.sort()

if xa[-1] < ya[0] and (x < xa[-1] + 1 <= y or x < ya[0] <= 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()))

for i in range(X+1, Y+1):
    flag1 = all([True if x < i else False for x in xs])
    flag2 = all(True if y >= i else False for y in ys)
    if flag1 and flag2:
        print("No War")
        exit()
print("War")

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

ans = 'War'
Z = []
for i in range(X + 1, Y + 1):
    Z.append(i)

delxLst = []
for i in range(len(Z)):
    for j in range(len(xLst)):
        if Z[i] <= xLst[j]:
            delxLst.append(i)
            break

delxLst.sort(reverse=True)
for i in range(len(delxLst)):
    del Z[delxLst[i]]

delyLst = []
for i in range(len(Z)):
    for j in range(len(yLst)):
        if Z[i] > yLst[j]:
            delyLst.append(i)
            break
delyLst.sort(reverse=True)
for i in range(len(delyLst)):
    del Z[delyLst[i]]

if len(Z) > 0:
    print('No War')
else:
    print('War')

Solution (Python):

from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
bisect_left = bisect.bisect_left
bisect_right = bisect.bisect_right
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')


def A():
    a = LI()
    a.sort()
    a, b, c = a
    print(int(str(c)+str(b))+a)
    return


def B():
    n, m, X, Y = LI()
    x = LI()
    y = LI()
    x.append(X)
    y.append(Y)
    x.sort()
    y.sort()
    print("No " * (x[-1] < y[0]) + "War")
    return


def C():
    return


def D():
    return


if __name__ == '__main__':
    B()

Solution (Python):
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 max(Xs[-1], X) < min(Ys[0], Y):
    ans = 'No War'
else:
    ans = 'War'

print(ans)

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

x_max = max(x_areas)
y_min = min(y_areas)

if x_max < y_min and x_max < Y and y_min > 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()))

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())
x = max(map(int, input().split()))
y = min(map(int, input().split()))
print('No War' if any([ X < z <= Y and x < z <= y for z in range(X+1, Y+1)]) else '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)

flag = 0
for z in range(xmax+1,ymin+1):
    if X < z and z <= Y:
        flag = 1
if flag == 0:
    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.sort()
y.sort()
ans = 'War'
for i in range(X+1, Y+1):
	flag = True
	for j in range(0, N):
		if i <= x[j]:
			flag = False
	for j in range(0, M):
		if y[j] < i:
			flag = False
	if flag:
		ans = 'No '+ans
		break
print(ans)

Solution (Python):
import sys
n,m,x,y = map(int,input().split())
x_arr = sorted(list(map(int,input().split())))
y_arr = sorted(list(map(int,input().split())))
for z in range(x+1,y+1,1):
  if x_arr[-1] < z and y_arr[0] >= z:
    print('No War')
    sys.exit()
print('War')

Solution (Python):
n,m,x,y = map(int, input().split())
lstx = list(map(int, input().split()))
lsty = list(map(int, input().split()))
if max(max(lstx),x)+2 <= min(min(lsty),y)+1:
  print("No War")
else:
  print("War")

Solution (Python):
a, b, c, d = map(int, input().split())
e = list(map(int, input().split()))
f = list(map(int, input().split()))
e = sorted(e, reverse=True)
f.sort()
for i in range(e[0] + 1, f[0] + 1):
    if c < i <= d:
        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)
xs.sort()
ys.sort()
if xs[-1] >= ys[0]:
    print("War")
else:
    print("No War")