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):
ni = lambda: int(input())
nl = lambda: list(map(int, input().split()))
nm = lambda: map(int, input().split())

n, m, x, y = nm()
xmax = max(nl()+[x])
ymin = min(nl()+[y])

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()))
def check(xs,ys,z):
    for x in xs:
        if z<=x:
            return
    for y in ys:
        if z>y:
            return 0
    return 1
if min(ys)<=max(xs):
    print("War")
else:
    f=1
    for z in range(max(xs)+1, min(ys)+1):
        if X<z and Y>=z:
            f=0
            print("No War")
            break
    if f:
        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+1, Y+1):
  if X < i <= Y and max(x) < i and min(y) >= i:
    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]

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

for Z in range(X+1, Y+1):
    result = True
    for xi in x:
        if xi >= Z:
            result = False
            break

    for yi in y:
        if yi < Z:
            result = False
            break
    if result:
        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()))

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

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

for i in range(X + 1, Y + 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()))
output = "War"
mx = max(X)
my = min(Y)

for i in range(x + 1, y + 1):
    if mx < i <= my:
        output = "No War"

print(output)

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

if max(x, max(xn)) < min(y, min(ym)):
    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())
z1=max(x)
z2=min(y)

print('No War' if min(z2,Y)>max(z1,X) else '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()
if xlist[-1]<ylist[0] and xlist[-1]>x and ylist[0]<=y:
    print('No War')
else:
    print('War')

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

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 Z<=min(y)):
        ans="No War"
        break
print(ans)

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

Solution (Python):
if __name__ == '__main__':
    N, M, X, Y = map(int, input().split())
    X_new = list(map(int, input().split()))
    Y_new = list(map(int, input().split()))
    X_new.append(X)
    Y_new.append(Y)
    X_new.sort()
    Y_new.sort()
    

    if X_new[N] < Y_new[0]:
        print('No War')
    else:
        print('War')

Solution (Python):
import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
input=lambda :sys.stdin.readline().rstrip()
def resolve():
    n,m,x,y=map(int,input().split())
    max_x=max(map(int,input().split()))
    min_y=min(map(int,input().split()))
    print("No War" if x<min_y<=y and max_x<min_y else "War")
resolve()

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(a)<min(b)and x<min(b)<=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 = map(int, input().split())
ls_x = list(map(int, input().split()))
ls_y = list(map(int, input().split()))

x = max(max(ls_x), x)
y = min(min(ls_y), y)

print('No War' if x < y else 'War')

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

if max(ls_x) < y and min(ls_y) > x and max(ls_x) < min(ls_y):
    print('No War')
else:
    print('War')

Solution (Python):
N,M,X,Y = [int(x) for x in input().split()]
x = [int(x) for x in input().split()]
x.sort()
y = [int(x) for x in input().split()]
y.sort()
for i in range(x[-1]+1,y[0]+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()))

X.sort()
Y.sort()

if X[-1] >= y or Y[0] <= x:
    print("War")
elif X[-1] >= Y[0]:
    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()))
if x<y and max(a)<min(b) and max(a)<y and x<min(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()))
count=0
for i in range(X+1,Y+1):
  if max(x)<i<=min(y):
    count+=1
if count==0:
  print("War")
else:
  print("No 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()

if x_list[-1] >= y_list[0]:
    print('War')
else:
    z_list = [z for z in range(x_list[-1], y_list[0]+1)]
    z_list.sort()
    if z_list[0] <= X or z_list[-1] > Y:
        print('War')
    else:
        print('No War')

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

x, y = max(xs), min(ys)
print("No War" if y - x >= 1 and X < y < Y else "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()]
Xs.append(X)
Ys.append(Y)
print("No War" if max(Xs) < min(Ys) 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 = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))
x.append(X)
y.append(Y)


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

Solution (Python):
n, m, x, y = map(int, input().split())
xMax = max(map(int, input().split()))
yMin = min(map(int, input().split()))
swi = "No War"

if yMin < xMax+1:
    swi = "War"
else:
    for i in range(xMax+1, yMin+1):
        if not(x+1 <= i <= y):
            swi = "War"
            break
print(swi)

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
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

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

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

Solution (Python):

from math import sin, cos, radians

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

if __name__ == '__main__':
    main()

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

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

x_max = max(xl)
y_min = min(yl)
z = {i for i in range(x+1,y+1)}
x_y_interval = {i for i in range(x_max+1,y_min+1)} 


if not x_y_interval:
    print('War')
elif z &x_y_interval:
    print('No War')
else:
    print('War')

Solution (Python):
def war():
  print('War')
  exit()

def nowar():
  print('No War')
  exit()
  
N,M,X,Y= map(int, input().split())
if Y -X < 1: war()

xmax = max(list(map(int,input().split())))
ymin = min(list(map(int,input().split())))
for z in range(X+1,Y+1):
  if xmax < z and ymin >= z: nowar()

war()

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

ans=0
for i in range(maxx+1,miny+1):
  if i>X and i<=Y:
    ans=1
    break
print("No War" if ans else "War")

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

print(ans)

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

Solution (Python):
def slove():
    import sys
    input = sys.stdin.readline
    n, m, x, y = list(map(int, input().rstrip('\n').split()))
    mx = max(list(map(int, input().rstrip('\n').split())))
    my = min(list(map(int, input().rstrip('\n').split())))
    for i in range(x + 1, y + 1):
        if mx < i <= my:
            print("No War")
            exit()
    print("War")


if __name__ == '__main__':
    slove()

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()))+[x]
Y=list(map(int,input().split()))+[y]
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)
x_min, y_min, x_max, y_max = min(x), min(y), max(x), max(y)

if x_max >= y_min and y_max >= x_min:
    print("War")
else:
    print("No War")

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

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

    z_min = max(x) + 1
    z_max = min(y)
    if z_min <= z_max:
        if z_max <= X or Y < z_min:
            print("War")
        else:
            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()))
ans ='War'
for i in range(X+1, Y+1):
  if max(x) < i and min(y) >= i:
    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()))
ans = "War"

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

print(ans)

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

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


for z in range(X+1,Y+1):
    Flag = True
    for i in range(N):
        if x[i] >= z:
            Flag = False
            break
    for i in range(M):
        if y[i] < z or not(Flag):
            Flag = False
            break
    if Flag:
        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):
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):
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()))
if max(x)<min(y) and max(x)<Y and 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()))
if max(max(X),x)<min(min(Y),y):
    print('No War')
else:
    print('War')

Solution (Python):
n,m,X,Y = map(int,input().split())
x = list(map(int,input().split()))
y = list(map(int,input().split()))
x.append(X)
y.append(Y)
x.sort()
y.sort()
print('No War' if x[-1] < y[0] else 'War')

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

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

p_x=[int(j) for j in input().split()]
p_y=[int(i) for i in input().split()]

max_x=max(p_x)
Z=min(p_y)

if max_x<Z and (X<Z and Z<=Y):
    print('No War')
else:
    print('War')

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

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

Solution (Python):
_, _, X, Y = map(int, input().split())
maxx = max(list(map(int, input().split())))
miny = min(list(map(int, input().split())))
flag = False
for i in range(X+1, Y+1):
    if maxx < i <= miny:
        flag = True
print('No War' if flag == True else 'War')

Solution (Python):
n,m,X,Y=map(int,input().split())
xn=list(map(int,input().split()))
ym=list(map(int,input().split()))
if max(xn)<min(ym) and max(xn)<Y and X<min(ym):
    print('No War')
else:
    print('War')

Solution (Python):
N,M,X,Y=[int(s) for s in input().split()]
lsx=[int(s) for s in input().split()]
lsy=[int(s) for s in input().split()]
lsx.append(X)
lsy.append(Y)
x=max(lsx)
y=min(lsy)
if x<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 = sorted(x)[::-1]
y = sorted(y)

if x[0] < y[0] and x[0] < Y and X < y[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()))
xmax = max(X, max(xs))
ymin = min(Y, min(ys))
if xmax < ymin:
  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+[X])<min(y+[Y]):
    print("No War")
else: print("War")

Solution (Python):
N,M,X,Y = map(int, raw_input().split())
X_list = map(int,raw_input().split())
Y_list = map(int,raw_input().split())
X_list_max = max(X_list)
Y_list_min = min(Y_list)

Z_list = []

for i in range(X+1,Y+1):
    if i > X_list_max:
        Z_list.append(i)
ans = "War"

for i in Z_list:
    if i <= Y_list_min:
        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()))

l = max(x)
r = min(y)
flag = False
for z in range(X+1,Y+1):
    if l<z and z<=r:
        flag = True
        break
print('No War' if flag else 'War')

Solution (Python):
"""
【ABC110】
B_1_Dimensional_Worlds_Tale



import sys


def ILI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def ISI(): return map(int, sys.stdin.readline().rstrip().split())
def II(): return int(sys.stdin.readline().rstrip())
def ISS(): return sys.stdin.readline().rstrip().split()
def IS(): return sys.stdin.readline().rstrip()

N, M, X, Y = ISI()
x = ILI()
y = ILI()
good = False
for i in range(X+1, Y+1):
    if max(x) < i and min(y) >= i:
        good = True
        break
if good == True:
    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=sorted(x)
y=sorted(y)

if x[-1] < y[0] and X < y[0] and x[-1] < 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)

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

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

Solution (Python):
n, m, x, y = map(int, input().split())
x_list = [int(i) for i in input().split()]+[x]
y_list = [int(i) for i in input().split()]+[y]
if max(x_list) < min(y_list):
    print("No War")
else:
    print("War")

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

MAX_X = max(x)
MIN_Y = min(y)
for num in range(X + 1, Y + 1):
    if num > MAX_X and num <= MIN_Y:
        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()))
ans = 'War'
for i in range(x+1,y+1):
    if i <= max(lx):
        pass
    else:
        if i <= min(ly):
            ans = 'No War'
            print(ans)
            break
        else:
            pass
if ans == 'War':
    print(ans)

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

def main():
    N,M,X,Y = map(int, input().split())
    z = [i for i in range(X+1,Y+1)]
    x = list(map(int, input().split()))
    y = list(map(int, input().split()))
    x.sort()
    y.sort()
    b = False
    for i in z:
        if x[-1] < i and i <= y[0]:
            b = True        
    if b:
        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.append(x)
Y.append(y)
print('No War'if max(X)<min(Y) else'War')

Solution (Python):
N, M, X, Y = map(int, input().split())
maxNum = max(list(map(int, input().split())))
minNum = min(list(map(int, input().split())))

ans = "War"

if maxNum < minNum:
    for i in range(maxNum+1, minNum+1):
        if X < i and i <= Y:
            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()))
s=max(x)
t=min(y)
if s<X and X+1<=Y and Y<t:
  print("No War")
elif X<s and s+1<=t and t<Y:
  print("No War")
elif s<X and X+1<=t and t<Y:
  print("No War")
elif X<s and s+1<=Y and Y<t:
  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 = [i for i in range(X + 1, Y + 1)]

for i in Z:
    if max(x) < i <= min(y):
        print('No War')
        exit()
    else:
        continue
print('War')

Solution (Python):


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

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

xs.append(X)
ys.append(Y)
print('No War' if max(xs) < min(ys) else 'War')

Solution (Python):
N,M,X,Y=map(int,input().split())
x=[int(_) for _ in input().split()]
y=[int(_) for _ in input().split()]
x.sort()
y.sort()
if x[-1]<y[0] and x[-1]>X and y[0]<=Y:
    print('No War')
else:
    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()))

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

if __name__ == "__main__":
    main()

Solution (Python):
n,m,x,y = map(int,input().split())
li1 = list(map(int,input().split()))
li2 = list(map(int,input().split()))
flag = False
for z in range(x+1,y+1):
    if all([i < z for i in li1]) and all([i >= z for i in li2]):
        flag = True
        
        break
        
if flag == True:       
    print("No War")
else:
    print("War")

Solution (Python):
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  

n, m, x, y = na()
xxx = na()
yyy = na()
ans = "War"
for z in range(x+1, y+1):
    if max(xxx) < z <= min(yyy):
        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()))

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

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

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
sa = lambda h: [list(map(int, stdin.readline().split())) for i in range(h)]

n, m, x, y = na()
xs = na()
ys = na()

zmin = max(xs) + 1
zmax = min(ys)
if zmin <= zmax and x < zmin and zmax <= y: 
    print("No War")
else:
    print("War")

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

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

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

Solution (Python):
n, m, x, y = map(int, input().split())
x_max = max(list(map(int, input().split()))+[x])
y_min = min(list(map(int, input().split()))+[y])

if x_max < y_min:
  print('No War')
else:
  print('War')

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

Solution (Python):
n, m, X, Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))
x += [X]
y += [Y]
max_x = max(x)
min_y = min(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.sort()
y.sort()
for z in range(-100, 101):
    if X < z and z <= Y and x[N - 1] < z and z <= y[0]:
        print("No War")
        exit()
print("War")

Solution (Python):
N,M,X,Y= [int(i) for i in input().split()]
A = [int(x) for x in input().split()]
B = [int(x) for x in input().split()]
A.append(X)
B.append(Y)
A = sorted(A)
B = sorted(B)
print("War"if A[N] >= B[0] else "No War")

Solution (Python):
nmxy=list(map(int,input().split()))
x=list(map(int,input().split()))
y=list(map(int,input().split()))
xm=0
ym=0
if max(x)>nmxy[2]:
    xm=max(x)
else:
    xm=nmxy[2]
if min(y)<nmxy[3]:
    ym=min(y)
else:
    ym=nmxy[3]
if ym<=xm:
    print('War')
else:
    print('No War')

Solution (Python):
def main():
    import sys
    input = sys.stdin.readline
    n, m, x, y = list(map(int, input().rstrip('\n').split()))
    X = list(map(int, input().rstrip('\n').split()))
    Y = list(map(int, input().rstrip('\n').split()))
    mx = max(X)
    my = min(Y)
    for z in range(x + 1, y + 1):
        if mx < z <= my:
            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()))

z = list(range(max(x)+1, min(y)+1))
if len(list(filter(lambda x: X < x <= Y, z))) == 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()))
if max(max(x),X) < min(min(y),Y):
  print("No War")
else:
  print("War")

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

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

Solution (Python):

N,M,X,Y=map(int, input().split())
x=list(map(int, input().split()))
y=list(map(int, input().split()))
if max(X,max(x))<min(Y,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()))

if Y-X>=1:
    Z=range(X+1,Y+1)
    for z in Z:
        if max(x)<z and min(y)>=z:
            print("No War")
            exit()
print("War")

Solution (Python):
n, m, x0, y0 = 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 x_max < y_min:
    if x0 < y_min and x_max < y0:
        print("No War")
    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()))
List=[]
for i in range(X+1,Y+1):
  num=0
  for j in range(n):
    if i>x[j]:
      pass
    else:
      num+=1  
  for k in range(m):
    if i<=y[k]:
      pass
    else:
      num+=1
  List.append(num)
if 0 in List:
  print('No War')
else:
  print('War')

Solution (Python):
def test():
    n,m,x,y = map(int,input().split())
    a = list(map(int,input().split()))
    b = list(map(int,input().split()))
    flag = 0
    for i in range(x+1,y+1):
        c = i
        if all(k<c for k in a) and all(c<=m for m in b):
            flag = 1
            break

    if flag == 0:
        print("War")
    elif flag == 1:
        print("No War")


if __name__ == "__main__":
    test()

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

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

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

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

a1.sort()
a2.sort()

left = a1[-1]
right = a2[0]

flag = False
for i in range(x+1,y):
    if i > left and i <= right:
        flag = True

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

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

    for i in range(X+1, Y):
        if max_x < i and min_y >= i:
            print('No War')
            exit()

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

if Y-X>=1:
    Z=range(X+1,Y+1)
    for z in Z:
        if max(x)<z and min(y)>=z:
            print("No War")
            exit()
print("War")

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

xs.sort()
ys.sort()
flag=0
if xs[-1]<y:
  z=xs[-1]+1
  if z==x or z==y:
    pass
  elif ys[0]>=z:
      print('No War')
      flag=1
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()))
print("No "*(max(X,max(x))<min(Y,min(y)))+"War")

Solution (Python):
def main():
    N, M, X, Y = map(int, input().split())
    A = [int(x) for x in input().split()]
    B = [int(y) for y in input().split()]
    for Z in range(X+1, Y+1):
        isFound = True
        for i in range(N):
            if A[i] >= Z:
                isFound = False
                break
        if isFound:
            for j in range(M):
                if B[j] < Z:
                    isFound = False
                    break
        if isFound:
            return "No War"
    return "War"

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

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)

print("No War" if min(y_list) - max(x_list) >= 1 else "War")