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):
def main():
    N , M , A , B = list(map(int,input().split()))
    X = list(map(int,input().split()))
    Y = list(map(int,input().split()))

    flag = False
    

    for Z in range(A,B):
        if A < Z:
            if Z <= B:
                if max(X) < Z:
                    if min(Y) >= Z:
                        flag = True
                        ans = Z
    
    if flag:
        print("No War")

    else:
        print("War")

if __name__ == '__main__':
    main()

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

xl = [int(x) for x in input().split()]
yl = [int(x) for x in input().split()]

xl.sort()
yl.sort()

xmax = xl[-1]
ymin = yl[0]

war = 'War'
nowar = 'No War'

isOk = False

if xmax < ymin:
    isOk = True
else:
    print(war)
    exit()


if X < ymin and Y > xmax:
    isOk = True
else:
    print(war)
    exit()

print(nowar)

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())
xi = sorted(list(map(int, input().split())), reverse=True)
yi = sorted(list(map(int, input().split())), reverse=True)

xi.append(x)
yi.append(y)

if max(xi) >= min(yi):
    print("War")
    exit(0)

print("No War")

Solution (Python):
_, _, x, y = list(map(int, input().split()))
x_list = list(map(int, input().split()))
y_list = list(map(int, input().split()))

x_list.append(x)
x_list.sort()

y_list.append(y)
y_list.sort()

if x_list[0] < y_list[0]:
    if x_list[-1] >= y_list[0]:
        print("War")
    else:
        print("No War")
else:
    if y_list[-1] >= x_list[0]:
        print("War")
    else:
        print("No War")

Solution (Python):



def main():
    n, m, x, y = list(map(int, input().split()))
    x_arr = list(map(int, input().split()))
    y_arr = list(map(int, input().split()))

    war_happen = False

    for z in range(x + 1, y + 1):
        
        if z > max(x_arr) and z <= min(y_arr):
            print('No War')
            return

    print('War')


if __name__ == '__main__':
    main()

Solution (Python):
s = list(map(int,input().split()))
x = list(map(int,input().split()))
y = list(map(int,input().split()))

mx = max(x)
if mx < s[2]:
  mx = s[2]
my = min(y)
if my > s[3]:
  my = s[3]

  
if mx >= my:
  print ("War")
else:
  print ("No War")

Solution (Python):
N, M, X, Y = map(int, input().split())
ma_x = max(map(int, input().split()))
mi_y = min(map(int, input().split()))
for z in range(X + 1, Y + 1):
    if ma_x < z and mi_y >= z:
        print('No War')
        break
else:
    print('War')

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

xi = list(map(int,input().split()))

yi = list(map(int,input().split()))

if(max(xi+[x]) >= min(yi+[y])):
    print("War")
else:
    print("No War")

Solution (Python):
def main():
    data = list(map(int, input().split()))
    Xn = data[0]
    Yn = data[1]
    X = data[2]
    Y = data[3]

    Xs = list(map(int, input().split()))
    Ys = list(map(int, input().split()))

    mergin = list(range(X, Y))
    if not mergin:
        mergin.append(0)
    x_line = min(mergin)
    y_line = max(mergin)

    max_x = max(Xs)
    min_y = min(Ys)

    if (max_x < min_y):
        if ((max_x + min_y) // 2 in mergin):
            print('No War')
        else:
            print('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.sort()
_y.sort()

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()))
max_x = max(x)
min_y = min(y)
s1 = set([i for i in range(X + 1, Y + 1)])
s2 = set([i for i in range(max_x + 1, min_y + 1)])
if s1 & s2:
    print('No War')
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_max = max(xs)
ys_min = min(ys)

flag = True
for xi in range(xs_max+1, ys_min+1):
  
  if x<xi and xi<=y:
    print('No War')
    flag = False
    break
if flag:
  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) and max(x) < Y ):
  print("No War")
else:
  print("War")

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

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

if(y_min <= x_max):
    print("War")
    exit()

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

Solution (Python):
import sys
n,m,x,y = map(int, input().split())
lis1 = [int(i) for i in input().split()]
lis2 = [int(i) for i in input().split()]
z = x+1
while z <= y:
  if max(lis1) < z and min(lis2) >= z:
    print('No War')
    sys.exit()
  else:
    z += 1
print('War')

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

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

Solution (Python):
def solve():
    _, _, 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 X >= Y or max_x >= min_y or min_y <= X < Y or max_x >= Y > X:
        print("War")
        return

    print("No War")
    

if __name__=='__main__':
    solve()

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 = max(x) + 1
Z_max = min(y)

is_ok = False
for Z in range(Z_min, Z_max + 1):
    if X >= Z:
        continue
    if Z > Y:
        continue
    is_ok = True

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

Solution (Python):
a = list(map(int,input().split()))
x = list(map(int,input().split()))
y = list(map(int,input().split()))
x_max = max(x)
y_min = min(y)
X = a[2]
Y = a[3]
check = 'War'
for i in range(X+1,Y+1):
    if (x_max < i) and (y_min >= i):
        check = 'No War' 
print(check)

Solution (Python):
from sys import stdin

input = lambda: stdin.readline()

def main():
    N, M, X, Y = map(int, input().split())
    Xn = list(map(int, input().split()))
    Ym = list(map(int, input().split()))


    if max([X] + Xn) < min([Y] + Ym):
        print('No War')
    else:
        print('War')

main()

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

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

if y_min-x_max>=1:
	for i in range(x_max+1,y_min+1):
		if X<i<=Y:
			print "No War"
			quit()
	else:
		print "War"
	
else:
	print "War"

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

interbal = range(X + 1, Y + 1)
ans = 'War'
for z in interbal:
    if max(x_pos) < z <= min(y_pos):
        ans = 'No War'
        break
print(ans)

Solution (Python):


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

if X < Y:
    xs = sorted(a[0])
    ys = sorted(a[1])
    if xs[-1] < ys[0] and xs[-1] < Y and ys[0]>X:
        print('No War')
    else:
        print('War')
else:
    print('War')

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

Solution (Python):


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

if __name__ == '__main__':
    main()

Solution (Python):


nmxy = input().split(" ")
n = int(nmxy[0])
m = int(nmxy[1])
xc = int(nmxy[2])
yc = int(nmxy[3])
x_list = [int(s) for s in input().split(" ")]
y_list = [int(s) for s in input().split(" ")]
x_list.append(xc) 
y_list.append(yc)
x_list.sort(reverse=True)
y_list.sort()

if x_list[0] < y_list[0]:
  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()]

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

Solution (Python):
a = list(map(int,input().split()))
x = list(map(int,input().split()))
y = list(map(int,input().split()))
x_max = max(x)
y_min = min(y)
X = a[2]
Y = a[3]
check = 'War'
for i in range(X+1,Y+1):
    if (x_max < i) and (y_min >= i):
        check = 'No War' 
print(check)

Solution (Python):
inputs = list(map(int, input().split()))
N = inputs[0]
M = inputs[1]
X = inputs[2]
Y = inputs[3]

Xposi = list(map(int, input().split()))
Yposi = list(map(int, input().split()))

Xposi.sort()
Yposi.sort()

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

Solution (Python):
def solve():
  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]:
    
    if X < y[0] <= Y:
      print('No War')
    else:
      print('War')
  else:
    print('War')


solve()

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

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

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

for i in list(map(int, input().split())):
    z = max(z, i)
z += 1

if z > y:
    print("War")
else:
    for i in list(map(int, input().split())):
        if z > i:
            print("War")
            break
    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):
def main():
    """
    """
    N, M, X, Y = map(int, input().split())
    *x, = map(int, input().split())
    *y, = map(int, input().split())

    x.append(X)
    y.append(Y)
    max_x = max(x)
    min_y = min(y)

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


if __name__ == '__main__':
    main()

Solution (Python):
import sys
input = sys.stdin.readline

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

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

z = [i+1 for i in range(max(x),min(y))]

for Z in z:
	if X < Z <= Y:
		print("No War")
		exit()

print("War")

Solution (Python):
n,m,nx,ny = 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[0]) and (nx < y[0]) and (x[n-1] < ny) and (nx < ny) :
   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 = max(x) + 1 
if (X < Z <= Y) and ( min(y) >= Z):
    print("No War")
else:
    print("War")

Solution (Python):
def main():
    data = list(map(int, input().split()))
    Xn = data[0]
    Yn = data[1]
    X = data[2]
    Y = data[3]

    Xs = list(map(int, input().split()))
    Ys = list(map(int, input().split()))

    mergin = list(range(X, Y))
    x_line = min(mergin)
    y_line = max(mergin)

    max_x = max(Xs)
    min_y = min(Ys)

    if (max_x < min_y):
        if ((max_x + min_y) // 2 in mergin):
            print('No War')
        else:
            print('War')
    else:
        print('War')

if __name__ == "__main__":
    main()

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

nowar = max(xs) <  min(ys)

if nowar:
    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.append(X)
ylist.append(Y)
xSorted = sorted(xlist)
ySorted= sorted(ylist)

xMax = xSorted[-1]
yMin = ySorted[0]

if xMax < yMin:
    print('No War')
else:
    print('War')

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

if Y - X > 0 and X <= max(xns)  and min(yns) <= Y and min(yns) - max(xns) > 0:
    print("No War")
else:
    print("War")

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

for i in range(x+1,y+1):
    
    if (max(X) < i) and (min(Y) >= i):
        
        flag=1
        break
if flag==1:
    print("No War")
else:
    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_max = max(lx)
ly_min = min(ly)

if lx_max >= ly_min:
  print('War')
else:
  print('No 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):
def run(N, M, X, Y, x, y):
    x.append(X)
    y.append(Y)
    max_x = max(x)
    min_y = min(y)
    if max_x < min_y:
        ret = 'No War'
    else:
        ret = 'War'
    return ret


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


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

Solution (Python):
N, M, X, Y = map(int, raw_input().split(' '))
Xs = sorted(map(int, raw_input().split(' ')) + [X])
Ys = sorted(map(int, raw_input().split(' ')) + [Y])

if max(Xs) < min(Ys):
    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())

rightX = max(xs)
leftY = min(ys)

z = leftY

if x < z <= y and rightX < z:
    print("No War")
else:
    print("War")

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

xs.append(x)
ys.append(y)

xs.sort()
xs.reverse()
ys.sort()

if(xs[0] >= ys[0]):
    print('War')
else:
    print('No War')

Solution (Python):
N, M, X, Y = map(int, input().split(" "))
Xs = [int(a) for a in input().split()]
Ys = [int(a) for a in input().split()]
maxX = X
minY = Y
for i in Xs:
    if i>maxX:
        maxX = i

for i in Ys:
    if i<minY:
        minY = i
        
if maxX < minY:
    print ("No War")
else:
    print ("War")

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

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

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

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

xak = list(map(int,input().split(" ")))
yak = list(map(int,input().split(" ")))

x_max = max(xak)
y_min = min(yak)

if x_max >= y_min:
    print("War")
else:
    for i in range(x_max+1,y_min+1):
        if x < i <= y:
            print("No War")
            break
    else:
        print("War")

Solution (Python):
import numpy as np,math,itertools

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

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

for i in range(-100,100):
   if not x<i<=y:continue
   if all([I<i for I in xs])and all([I>=i for I in ys]):rs=True;break

print(["War","No War"][int(rs)])

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

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

for i in range(yy):
  if max_x < i and i <= min_y and xx<i<=yy:
    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.sort()
y.sort()
if x[-1] < y[0] and X < y[0] and Y > x[-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()]

x.sort(reverse=True)
y.sort()

Z = y[0]
ans = "War"
if X < Z <= Y:
    if x[0] < Z:
        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()))

x.sort()
y.sort()
if Y-X <= 0 or x[-1] >= Y or y[0] <= X or x[-1] >= y[0]:
  print("War")
else:
  print("No War")

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

res = "War"
if xarray[-1] > yarray[0]:
    res = "War"
else:
    for i in range(xarray[-1], yarray[0]+1):
        if x < i <= y and xarray[-1] < i <= yarray[0]:
            res = "No War"
            break
print(res)

Solution (Python):
_, _, x, y = map(int, input().split())
x_cities = map(int, input().split())
y_cities = map(int, input().split())

max_x, min_y = max(x_cities), min(y_cities)
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 = sorted(map(int, input().split()))
y = sorted(map(int, input().split()))
for Z in range(X+1, Y+1):
    if x[-1] < Z and y[0] >= Z:
        print("No War")
        break
else:
    print("War")

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

x.append(x0)
y.append(y0)

x.sort()
y.sort()

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

Solution (Python):
def ketanowa(p):
    ans = 0
    p = str(p)
    for i in p:
        ans += int(i)
    return ans


def main():
    temp=input()
    temp=list(map(int,list(temp.split(" ")))) 
    X = temp[2]
    Y = temp[3]
    temp=input()
    temp=list(map(int,list(temp.split(" ")))) 
    x = max(temp)
    temp=input()
    temp=list(map(int,list(temp.split(" ")))) 
    y = min(temp)
    for z in range(X+1,Y+1):
        if x < z and z<=y:
            print("No War")
            return 0
    
    print("War")

if __name__ == '__main__':
    main()

Solution (Python):
nums = [int(num) for num in input().split()]
n = nums[0]
m = nums[1]
x = nums[2]
y = nums[3]
maxx =-100
miny =100
hogex = [int(num) for num in input().split()]
hogey = [int(num) for num in input().split()]
for i in range(n):
    maxx = max(hogex[i],maxx)
for i in range(m):
    miny = min(miny,hogey[i])

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

Solution (Python):
import sys

N, M, X, Y = list(map(int, sys.stdin.readline().strip().split(" ")))
x_list = list(map(int, sys.stdin.readline().strip().split(" ")))
y_list = list(map(int, sys.stdin.readline().strip().split(" ")))

x_max = max(x_list)
y_min = min(y_list)

for Z in range(X+1, Y+1):
    if x_max < Z and y_min >= Z:
        print("No War")
        sys.exit()
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()]

mx=max(x)
my=min(y)

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

Solution (Python):
from sys import stderr
from functools import reduce
from operator import add
def f(): return [int(i) for i in input().split()]
def yes(n): print("Yes" if n else "No")
def debug(*x, sep=" ", end="\n"):
    for item in x:
        stderr.write(str(item))
        stderr.write(sep)
    stderr.write(end)

n,m,X,Y = f()
x = f()
y = f()
max_x = max(x)
min_y = min(y)
if min_y - max_x >= 1:
    for i in range(max_x+1, min_y+1):
        if X < i <= Y:
            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()))
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()))

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

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

Solution (Python):
N, M, X, Y = map(int, input().split())
x = sorted(list(map(int, input().split())))
y = sorted(list(map(int, input().split())))
if X < Y and x[-1] < y[0]:
    for i in range(N):
        if x[i] >= Y:
            print("War")
            exit()
    for i in range(M):
        if y[i] <= X:
            print("War")
            exit()
    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())

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

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






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


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

else:
    print("War")

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

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

Solution (Python):
n, m , x, y = map(int, input().split())
X = [int(_)  for _ in input().split()]
Y = [int(_)  for _ in input().split()]
maxX = max(X)
maxX = max(maxX, x)
minY = min(Y)
minY = min(minY, y)
if minY - maxX >= 1:
    print("No War")
else:
    print("War")

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

x_l = list(map(int, input().split()))
y_l = list(map(int, input().split()))

xm = max(x_l)
ym = min(y_l)

ans = 'No War'

if xm >= ym:
    ans = 'War'

elif xm >= Y:
    ans = 'War'

elif X >= ym:
    ans = 'War'

elif X >= Y:
    ans = 'War'

print(ans)

Solution (Python):
N, M, X, Y = map(int, raw_input().split(' '))
Xs = sorted(map(int, raw_input().split(' ')))
Ys = sorted(map(int, raw_input().split(' ')))

if max(Xs) < min(Ys) and max(Xs) < Y and X < min(Ys):
    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()))

ans = False

for z in range(X+1,Y+1):
    x_flag = [x < z for x in x_list]
    y_flag = [y >= z for y in y_list]
    if sum(x_flag) == len(x_flag) and sum(y_flag) == len(y_flag):
        ans = True
        break

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

Solution (Python):
nmxy = list(map(int, input().split()))
n = nmxy[0]
m = nmxy[1]
x = nmxy[2]
y = nmxy[3]
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")

Solution (Python):

from itertools import takewhile
def solve():
    N,M,X,Y = list(map(int, input().split()))
    Xs = list(map(int, input().split()))
    Ys = list(map(int, input().split()))
    X1 = max(Xs)
    Y1 = min(Ys)
    Z0 = set(range(X+1, Y+1))
    Z1 = set(range(X1+1, Y1+1))
    Z = Z0&Z1
    if Z:
        res = "No War"
    else:
        res = "War"
    return str(res)

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

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

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

Solution (Python):

import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

sys.setrecursionlimit(10000)


def read_int():
    return int(input())


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


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(N, M, X, Y, x, y):
    mx = max(x)
    my = min(y)

    error_print(mx, my)
    if mx < my and (my > X and mx < Y):
        return 'No War'
    return 'War'


def main():
    N, M, X, Y = read_int_n()
    x = read_int_n()
    y = read_int_n()
    print(slv(N, M, X, Y, x, y))


if __name__ == '__main__':
    main()

Solution (Python):
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 min_y <= max_x or min_y <= X or Y <= max_x:
    print("War")
else:
    print("No War")

Solution (Python):
N, M, X, Y = [int(elem) for elem in input().split(' ')]
x_list = [int(elem) for elem in input().split(' ')]
assert len(x_list)== N
y_list = [int(elem) for elem in input().split(' ')]
assert len(y_list) == M

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

for Z in range(X + 1, Y + 1):
    if (max_x < Z and Z <= min_y):
        print("No War")
        break
    else:
        continue
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()) ))	

x.append(X)
x.sort()

y.append(Y)
y.sort()


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

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

X2 = X.copy()
X2.append(x)
X2.sort()

Y2 = Y.copy()
Y2.append(y)
Y2.sort()

if X2[-1] < Y2[0]:
    print('No War')
else:
    print('War')

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

x.sort(reverse=True)
y.sort()

Z=y[0]

if x[0]>=Z:
    print("War")
elif X>=Z:
    print("War")
elif Z>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()))

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

Solution (Python):


def main():
    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)
    Xs.sort()
    Ys.sort()

    if Xs[-1]+1 <= Ys[0]:
        print("No War")
        exit()
    print("War")


if __name__ == '__main__':
    main()

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

for z in range(X+1,Y+1):
    t = 1
    for p in range(N):
        if x[p] >= z:
            t = 0
            break
    for q in range(M):
        if y[q] < z:
            t = 0
            break
    if t == 1:
        print("No War")
        exit(0)
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)
mx = max(mx,X)
my = min(ys)
my = min(my,Y)
if mx >= my: 
    print("War")
else:
    print("No War")