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):
a,b,c,d = map(int,input().split(" "))
x = list(map(int,input().split(" ")))
y = list(map(int,input().split(" ")))
if max(x) < d and min(y) > c and 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()))
x.sort(reverse=True)
y.sort()
b = False
if(x[0] < y[0]):
  for z in range(X+1, Y+1):
    if z in range(x[0]+1, y[0]+1):
      b = True
      break
if(b):
  print("No War")
else:
  print("War")

Solution (Python):
N,M,X,Y=map(int,input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
x.sort(reverse=True)
y.sort()
a=0
for z in range(X+1,Y+1):
    if z>x[0] and z<=y[0]:
        a=1
        break
if a==1:
    print('No War')
else:
    print('War')

Solution (Python):
n,m,x,y=map(int,input().split())
p=[]
q=[]
p=list(map(int,input().split()))
q=list(map(int,input().split()))
p.sort()
q.sort()
a=p[-1]
b=q[0]
if a<b and x<b and b<=y:
  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()
y.sort()

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

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


if __name__ == "__main__":
    main()

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

if X < max(xlist):
    xmax = max(xlist)
else:
    xmax = X

if Y > min(ylist):
    ymin = min(ylist)
else:
    ymin = Y

if xmax + 1 <= 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()))

westernmost = max(x)
easternmost = min(y)
if max(X, westernmost) >= min(Y, easternmost):
    print("War")
else:
    print("No War")

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

if max(A[N-1],X) < min(B[0],Y):
    print('No War')
else:
    print('War')

Solution (Python):
from statistics import mean, median,variance,stdev
import sys
import math
import fractions
def j(a):
    if a: print("No War")
    else :print("War")


def ct(x,y):
    if (x>y):print("")
    elif (x<y): print("")
    else: print("")

def ip():
    return int(input())




n,m,x,y= (int(i) for i in input().split())  




a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]
ma = max(a)
mb = min(b)
z = set([i+1 for i in range(ma,mb)])
xy  =  set([i+1 for i in range(x,y)])
a = xy.intersection(z)
j(len(a))

Solution (Python):
n, m, x, y = map(int, input().split())
X_list = list(map(int, input().split()))
Y_list = list(map(int, input().split()))
z = min(Y_list)
if x < z <= y and max(X_list) < z: print('No War')
else: print('War')

Solution (Python):
temp = input().rstrip().split(" ")
N = int(temp[0])
M = int(temp[1])
X = int(temp[2])
Y = int(temp[3])
xi = []
yi = []
temp = input().rstrip().split(" ")
for i in range(N):
    xi.append(temp[i])
temp = input().rstrip().split(" ")   
for i in range(M):
    yi.append(temp[i])
count = 0
flag = 1
for i in range(X+1 , Y+1):
    Z = i
    flagX = 1
    flagY = 1
    for j in range(N):
        if int(xi[j]) >= Z:
            flagX = 0
    for j in range(M):
        if int(yi[j]) < Z:
            flagY = 0
    if flagX == 1 and flagY == 1:
        flag = 0
if flag == 0:
    print("No War")
else:
    print("War")

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

x = max(b)
y = min(c)

p = max(a[2],x)
q = min(a[3],y)

if q-p > 0:
    print("No War")
else:
    print("War")

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

if max(xi) < min(yi):
  print("No War")
else:
  print("War")

Solution (Python):
if __name__ == '__main__':
    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()]

    result = "War"

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

    print(result)

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

Solution (Python):
n, m, x, y = map(int, input().split())
xs = list(map(int, input().split())) + [x]
ys = list(map(int, input().split())) + [y]
xs.sort()
ys.sort()
print("No War" if xs[-1] < ys[0] else "War")

Solution (Python):
flag = "No War"
N,M,X,Y = map(int,input().split())
x_r = list(map(int,input().split()))
y_r = list(map(int,input().split()))
x_r.sort()
y_r.sort()
if x_r[-1] - y_r[0] >=0:
    flag = "War"
if x_r[-1] >= Y or X >= y_r[0]:
    flag = "War"
print(flag)

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

xi = list(map(int,input().split()))
yi = list(map(int,input().split()))
xi.append(x)
yi.append(y)
xi.sort()
yi.sort()

if xi[-1] < yi[0]:
    print("No War")
else:
    print("War")

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

l_x.append(X)
l_y.append(Y)
if max(l_x) >= min(l_y):
    print('War')
else:
    print('No War')

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

max_X = max(Xi)
min_Y = min(Yi)




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=map(int,input().split())
xx=sorted(map(int,input().split()))
yy=sorted(map(int,input().split()))
print(["","No "][(x<yy[0])and(xx[-1]<yy[0])and(xx[-1]<y)]+"War")

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

war = True

for z in range(-100,101):
    new_xs = xs + [z]
    new_ys = ys + [z]
    new_xs.sort()
    new_ys.sort()
    if new_xs[-1] == z and new_xs[-2] != z and new_ys[0] == z and x<z<=y:
        war = False
        
if war:
    print('War')
else:
    print('No War')

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

for a in range(len(x_box)):
    x_box[a]=int(x_box[a])
for a in range(len(y_box)):
    y_box[a]=int(y_box[a])

for i in range(X+1,Y+1):
    if max(x_box)< i <=min(y_box):
        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 max(x) < z <= min(y):
        print("No War")
        exit()
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()))
zl=[i for i in range(x+1,y)]
flag=False
for i in zl:
    if i>max(xl) and min(yl)>=i:
        flag=True

if flag:
    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(" ")))
f = True
for i in range(X+1,Y+1):
  r =  [j for j in x if j < i]
  r2 = [j for j in y if j >= i]
  if len(r) == N and len(r2) == M:
      print("No War")
      f = False
      break
        
if f:
    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_max = max(x_list)
y_min = min(y_list)
war = 'War'
for i in range(y+1):
    if x_max < i and i <= y_min and x < i and i <= y:
        war = 'No 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()))

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

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

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

Solution (Python):
n,m,x,y = map(int, input().split())
X = tuple(map(int, input().split()))
Y = tuple(map(int, input().split()))
for Z in range(x+1, y+1):
    ok = True
    for i in X:
        if i >= Z:
            ok = False
    for i in Y:
        if i < Z:
            ok = False
    if ok:
        print("No War")
        exit(0)
print("War")

Solution (Python):


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

if __name__ == "__main__":
    n, m, X, Y  = read_int_n()
    x = read_int_n()
    y = read_int_n()
    x.append(X)
    y.append(Y)
    x_max = max(x)
    y_min = min(y)
    if y_min > x_max:
        print("No War")
    else:
        print("War")

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

a=input().split()
b=input().split()

flag=0
for z in range(int(x)+1,int(y)+1):
  flag1=0
  for i in range(int(n)):
    if int(a[i]) < z:
      flag1+=1
  flag2=0
  for j in range(int(m)):
    if z <= int(b[j]):
      flag2+=1
  if flag1==int(n) and flag2==int(m):
    flag=1
print('No War' if flag==1 else 'War')

Solution (Python):
N,M,X,Y = map(int,input().split())
x = [_ for _ in map(int,input().split())]
y = [_ for _ in map(int,input().split())]
Z = [z for z in range(-100,101)]
x.sort(reverse=True)
y.sort()
num = 0

for z in Z:
    if X<z and z<=Y:
        if x[0]<z and y[0]>=z:
            print('No War')
            num += 1
            break
    else:
        continue
if num == 0:
    print('War')

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

maxx = max(list(map(int,input().split())))
miny = min(list(map(int,input().split())))

if x < y :
    candidate = []
    for i in range(x+1,y+1) :
        candidate.append(i)

    for i in candidate :
        if maxx < i and i <= miny :
            print("No War")
            exit(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()))
z=max(X)+1

print("No War" if x<z <= min(Y) and z<=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()))
war = "War"
x_max = max(x)
y_min = min(y)

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

Solution (Python):
def m_i():
    return map(int, input().split())
N,M,X,Y = m_i()
Z = max(m_i()) + 1
min_y = min(m_i())
print("No War" if (X < Z) and (Z <= min(min_y,Y)) else "War")

Solution (Python):
def m_i():
    return map(int, input().split())
N,M,X,Y = m_i()
Z = max(m_i()) + 1
min_y = min(m_i())
print("No War" if (X < Z) and (Z <= min_y) and (Z <= Y) else "War")

Solution (Python):
N,M,X,Y = map(int, input().split())
Z = max(map(int, input().split())) + 1
min_y = min(map(int, input().split()))
print("No War" if (X < Z) and (Z <= min_y) and (Z <= Y) else "War")

Solution (Python):



def main():
    n, m, x, y = map(int, input().split())
    xs = list(map(int, input().split())) + [x]
    ys = list(map(int, input().split())) + [y]

    if max(xs) < min(ys):
        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.sort()
y.sort()

for Z in range(X+1, Y+1):
    if (x[N-1] < Z) and (Z <= y[0]):
        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()))
mx = max(xs)
my = min(ys)

for z in range(X+1,Y+1):
    if mx < z <= my:
        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=x+[X]
y=y+[Y]

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

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

sys.setrecursionlimit(10**5)

def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

n,m,x,y = li()
xs = [x]
ys = [y]

xs = xs + list(li())
ys = ys + list(li())

print("No War") if max(xs) < min(ys) else print("War")

Solution (Python):
n,m,x,y = map(int,raw_input().split())
xx = map(int,raw_input().split())+[x]
yy = map(int,raw_input().split())+[y]
mxx = max(xx)
miyy = min(yy)
if mxx < miyy:
    print "No War"
else:
    print "War"

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

x = max([int(x) for x in input().split(" ")])
y = min([int(x) for x in input().split(" ")])

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

Solution (Python):



s = raw_input()
n, m, x, y = [int(x) for x in s.split()]
xx = [int(a) for a in raw_input().split()]
yy = [int(a) for a in raw_input().split()]
xx = sorted(xx)
yy = sorted(yy)

if xx[-1] >= y or yy[0] <= x or xx[-1] >= yy[0]:
    print 'War'
else:
    print 'No War'

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

xi.append(X)
yi.append(Y)

if max(xi) < min(yi):
    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 = max(a)
b = min(b)
for z in range(x+1,y+1):
    if a < z <= b:
        print('No War')
        exit()
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())
print "No War" if max(x+[X])<min(y+[Y]) else "War"

Solution (Python):



def solve():
    _, _, X, Y = map(int, input().split())
    xn = max(map(int, input().split()))
    ym = min(map(int, input().split()))

    Z = xn + 1

    if X < Z <= Y and xn < Z <= ym:
        print('No War')
        exit()
    else:
        print('War')


if __name__ == '__main__':
    solve()

Solution (Python):



def solve():
    _, _, x, y = map(int, input().split())
    Xn = max(map(int, input().split()))
    Ym = min(map(int, input().split()))

    for z in range(x + 1, y + 1):
        if Xn < z <= Ym:
            print('No War')
            exit()
    else:
        print('War')


if __name__ == '__main__':
    solve()

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

Z = max(xs) + 1

if X < Z and Z <= Y and Z <= min(ys):
    print("No War")
else:
    print("War")

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

    if max(x) < min(y) and max(x) < Y and min(y) > X:
        print("No War")
    else:
        print("War")
    
if __name__ == "__main__":
    main()

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

max_x = max(list(map(int, input().split())))
min_y = min(list(map(int, input().split())))

if min_y - max_x > 0 and max_x+1 <= Y and X+1 <= 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()))
Z = -100
message = 'No War'

if X <= Y:
    Z = X+1
    for xi in x:
        if Z < xi:
            Z = xi+1
    for yi in y:
        if Z <= yi:
            pass
        else:
            message = 'War'
            break
    if Z > Y:
        message = 'War'
else:
    message = 'War'

print(message)

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

print('No War' if max(xs) < min(ys) and max(xs) < y and min(ys) > 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()))
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):
N,M,X,Y=map(int,input().split())
xi=list(map(int, input().split()))
yi=list(map(int, input().split()))
xi+=[X]
yi+=[Y]

if max(xi)<min(yi):
    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)
 
for i in range(X + 1, Y + 1):
  if( x[N-1] < i <= y[0]):
    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 i in range(Y-X):
	if max(x)<i+X+1<=min(y):
		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()))
x.sort()
y.sort()
ans=False
for i in range(X+1,Y+1):
    if(x[-1]<i and y[0]>=i):
        ans=True
        break
if(ans):
    print('No War')
else:
    print('War')

Solution (Python):
n,m,x,y=list(map(int,input().split()))
l_x=list(map(int,input().split()))
l_y=list(map(int,input().split()))
x_max=max(l_x)
y_min=min(l_y)
for i in range(x_max+1,y_min+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()))
c=0
for i in range(Y-X):
	if max(x)<i+X+1<=min(y):
		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()))

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

Solution (Python):
def dimensional_world_tale(x, y, xs, ys):
    xs = sorted(xs)
    maxx = xs[-1]
    if not(x < maxx <= y):
        return "War"
    ys = sorted(ys)
    miny = ys[0]
    if not(x < miny <= y):
        return "War"
    if not(maxx < miny):
        return "War"
    return "No War"

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

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

Solution (Python):
def is_war_by_list(x_list, y_list) :
	max_x = max(x_list)
	min_y = min(y_list)
	
	if (max_x < min_y) :
		return False
	else :
		return True

def is_war_by_number(x,y,z) :
	if (x < z and z <= y) :
		return False
	else :
		return True
	


read_line = [int(i) for i in input().split()]
N = read_line[0]
M = read_line[1]
X = read_line[2]
Y = read_line[3]

x_list = [int(i) for i in input().split()]
y_list = [int(i) for i in input().split()]

if (is_war_by_list(x_list,y_list) or is_war_by_number(X,Y, min(y_list))) :
	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())) 
set1 = set()
set2 = set()
c = 0
maxa = max(a)
minb = min(b)
if maxa < minb:
  for i in range(maxa+1,minb+1):
    set1.add(i)
if x < y:
  for i in range(x+1,y+1):
    set2.add(i)
set3 = set1 & set2
if len(set3) >= 1:
  print("No War")
else:
  print("War")

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

x_n = list(map(int,input().split()))
y_m = list(map(int,input().split()))

if x < max(x_n) and max(x_n) <min(y_m) and min(y_m) <=y:
    print("No War")
else:
    print("War")

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

x_max = -100
y_min = 100

for i in range(0,N):
    x = xlist[i]
    x_max = max(int(x),x_max)

for j in range(0,M):
    y = ylist[j]
    y_min = min(int(y),y_min)

if X < Y\
    and int(x_max) < int(y_min)\
    and X < int(y_min)\
    and int(x_max) < Y:
    print("No War")
else:
    print("War")

Solution (Python):
N ,M ,X ,Y = list(map(int,input().strip().split()))
xlist = list(map(int,input().strip().split()))
ylist = list(map(int,input().strip().split()))
 
x_max = X
y_min = Y
 
for i in range(0,N):
    x_max = max(int(xlist[i]),x_max)
 
for i in range(0,M):
    y_min = min(int(ylist[i]),y_min)

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

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

if x < max(a) and max(a) < min(b) and min(b) <= y:
  print("No War")
else:
  print("War")

Solution (Python):
N, M, X, Y = map(int, input().split())
a = list(map(int, input().split()))
for i in range(N):
    if(i == 0):
        mx= a[i]
    else:
        mx = max(a[i],mx)
a = list(map(int, input().split()))
if(mx >= Y):
    print("War")
    quit()
for i in range(M):
    if(i == 0):
        my = a[i]
    else:
        my = min(a[i],my)
if(my <= X):
    print("War")
    quit()
if(mx >= my):
    print("War")
else:
    print("No War")

Solution (Python):
n,m,a,b = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))
x = max(x)
y = min(y)
for z in range(x+1,y+1):
    if a < z and z <= b:
        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()))
M_x = max(x)
m_y = min(y)
if M_x < m_y and M_x < Y and m_y > X:
  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.sort()
ly.sort()
if lx[-1]>=ly[0]:
    print('War')
for i in range(lx[-1]+1,ly[0]+1):
    if x<i<=y:
        print("No War")
        break
    else:
        print('War')

Solution (Python):
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b



def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)



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


def main():
    N, M, X, Y = map(int, input().split())
    Xs = list(sorted(list(map(int, input().split()))))
    Ys = list(sorted(list(map(int, input().split()))))

    for z in range(-101, 101):
        if X < z <= Y:
            if Xs[-1] < z <= Ys[0]:
                print("No War")
                return
    print("War")


if __name__ == '__main__':
    main()

Solution (Python):
xy = list(map(int, input().split()))
x = xy[2]
y = xy[3]
xn = list(map(int, input().split()))
ym = list(map(int, input().split()))
xn.append(x)
ym.append(y)
if max(xn) < min(ym):
    print("No War")
else:
    print("War")

Solution (Python):
def abc110_b():
    _, _, x, y = map(int, input().split())
    city_x = list(map(int, input().split()))
    city_y = list(map(int, input().split()))
    if max(city_x) < min(city_y):
        for i in range(max(city_x), min(city_y)+1):
            if x >= i or i > y:
                return "War"
        return "No War"
    else:
        return "War"


print(abc110_b())

Solution (Python):


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

ax = list(map(int, input().rstrip().split()))
ay = list(map(int, input().rstrip().split()))

bottom_x = max(ax)
top_y = min(ay)

result = 'War'
for Z in range(X + 1, Y + 1):
    if bottom_x < Z and Z <= top_y:
        result = 'No War'
        break

print(result)

Solution (Python):
n,m,x,y = map(int, input().split())
n = int(n)
m = int(m)
x = int(x)
y = int(y)
s = []
for i in range(2):
    a = input().split()
    s.append([int(m) for m in a])

s[0].append(x)
s[1].append(y)
p = max(s[0])
q = min(s[1])

if p >= q:
    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(reverse=True)
y.sort()
OK = True
for i in range(X+1,Y+1):
    if x[0]<i and i<=y[0]:
        OK = False
print('War' if OK else 'No War')

Solution (Python):
import sys


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

    x = max(x, max(xs))
    y = min(y, min(ys))

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


main()

Solution (Python):
n, m, x, y = map(int,input().split())
cx = list(map(int,input().split()))
cy = list(map(int,input().split()))
a = max(cx)+1
b = min(cy)
if a>b:
    print('War')
    exit()
for z in range(a, b+1):
    if x<z<=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(reverse=True)
y.sort()
if x[0]<Y and X<y[0] and x[0]<y[0]:
    print("No War")
else:
    print("War")

Solution (Python):
n, m, x, y= map(int, input().split())
arr_x= list(map(int, input().split()))
arr_y= list(map(int, input().split()))
arr_x.append(x)
arr_y.append(y)
max_x=max(arr_x)
min_y=min(arr_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(min(y) <= max(x)):
    print("War")
elif(min([min(y),Y-1]) - max([max(x)+1,X+1]) <0):
    print("War")
else:
    print("No War")

Solution (Python):
a,b,c,d=map(int,input().split())
e=list(map(int,input().split()))
f=list(map(int,input().split()))

e.sort()
f.sort()
if e[-1]<f[0]:
	if c<(e[-1]+f[0])/2<=d:
		print("No War")
	else:
		print("War")
else:
	print("War")

Solution (Python):
n, m, x, y = map(int, raw_input().split())
arrx = map(int, raw_input().split())
arry = map(int, raw_input().split())
arrx.append(x)
arry.append(y)
if max(arrx)+1 > min(arry):
    print "War"
else:
    print "No War"

Solution (Python):

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

x=input().split()
y=input().split()

for i in range(0,len(x)):
    x[i]=int(x[i])
for i in range(0,len(y)):
    y[i]=int(y[i])


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

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

xlst = list(map(int, input().split()))
ylst = list(map(int, input().split()))

t = 0

for i in range(x+1, y+1):
  
  xmax = max(xlst)
  ymin = min(ylst)
  if i > xmax and i <= ymin:
    print("No War")
    t = 1
    break
  else:
    continue


if t ==0:
  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())

x.sort()
y.sort()

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

Solution (Python):
lst = [int(s) for s in input().split()]
x = lst[2]
y = lst[3]
a = max([int(s) for s in input().split()])
b = min([int(s) for s in input().split()])

if a < b and x < b and b <= y:
    print("No War")
else:
    print("War")

Solution (Python):
def solution(a, b):
    if max(a) < min(b):
        return 'No War'
    else:
        return 'War'

def main():
    n, m, x, y = [int(i) for i in raw_input().strip().split()]
    a = [x] + [int(i) for i in raw_input().strip().split()]
    b = [y] + [int(i) for i in raw_input().strip().split()]
    print(solution(a, b))

if __name__ == '__main__':
    main()

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

max_x = max(x)
min_y = min(y)
Z = X + 1
done = False
while not done:
    if Z > Y:
        done = True
        s = "War"

    elif max_x < Z <= min_y:
        done = True
        s = "No War"

    Z += 1

print(s)

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

x = sorted(x)
y = sorted(y)
a = x[N-1]
b = y[0]
if (a >= b) or (a>=Y) or (b<=X):
    print("War")
else:
    print("No War")

Solution (Python):
n, m, x, y = map(int, raw_input().split())
arrx = map(int, raw_input().split())
arry = map(int, raw_input().split())
arrx.append(x)
arry.append(y)
if max(arrx)+1 > min(arry):
    print "War"
else:
    print "No War"

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

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



for Z in range(Y+1):
    if X < Z and Y >= Z:
        if x[N-1] < Z:
            if y[0] >= Z:
                print('No War')
                exit()

print('War')