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 solve(empireA, empireB):
    if min(empireB) - max(empireA) >= 1:
        return "No War"
    else:
        return "War"


if __name__ == "__main__":
    firstline = list(map(int, input("").split(" ")))
    empireA = list(map(int, input("").split(" ")))
    empireB = list(map(int, input("").split(" ")))
    empireA.append(firstline[2])
    empireB.append(firstline[3])
    print(solve(empireA, empireB))

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

if (max_x < min_y) and (X < max_x+1 <= Y):
    print('No War')
else:
    print('War')

Solution (Python):
N,M,X,Y=map(int,input().split())
xN =list(map(int, input().split()))
xN.append(X)
maxX=max(xN)

yM =list(map(int, input().split()))
yM.append(Y)
minY=min(yM)
if(maxX>=minY):
    print("War")
else:
    
    print("No War")

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

a = max(li1)
b = min(li2)

war = "War"

for i in range(a+1,b+1):
    if x < i <= y:
        war = "No War"
        break

print(war)

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

z = x+1
check = True
while z <= y and check:
    tempcheck = True

    for i in range(n):
        if xx[i] >= z:
            tempcheck = False
    for i in range(m):
        if yy[i] < z:
            tempcheck = False
    
    if tempcheck:
        print('No War')
        check = False
    z += 1
if check:
    print("War")

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

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

Solution (Python):
N, M, X, Y = [int(s) for s in input().split()]
x = [int(s) for s in input().split()]
y = [int(s) for s in input().split()]
print("War" if max([X] + x) >= min([Y] + y) else "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()]

Z = sorted(x, reverse=True)[0] + 1
if Z <= sorted(y)[0] and X < Z <= Y:
  print('No War')
else:
  print('War')

Solution (Python):
a = list(map(int, input().split()))
b = max(map(int, input().split()))
c = min(map(int, input().split()))
print("No War" if b+1<a[3] and a[2]+1<c and b<c else "War")

Solution (Python):
n,m,x,y=map(int,input().split())
xs=list(map(int,input().split()))
ys=list(map(int,input().split()))
xs2=sorted(xs)
ys2=sorted(ys)
if xs2[n-1]<ys2[0] and xs2[n-1]<y and ys2[0]>x:
  print('No War')
else:
  print('War')

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

Solution (Python):

a= [int(i) for i in input().split()] 
b= sorted([int(i) for i in input().split()] )
c= sorted([int(i) for i in input().split()] )
x =0
for z in range(-100,101):
    if a[2] < z <= a[3]:
       if b[-1]<z:
         if c[0]>=z:
              x = 1
if x == 0:
    print("War") 
if x == 1:
    print("No War")

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

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

Solution (Python):
n,m,x,y = list(map(int, input().split()))
xx=list(map(int, input().split()))
yy=list(map(int, input().split()))
print('No War' if max(xx)<min(yy)and x<min(yy) and max(xx)<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.sort(reverse=True) 
y.sort() 


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

Solution (Python):
import sys
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[n-1]>=ly[0] or ly[0]<=x or ly[0]>y:
    print('War')
    sys.exit()
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()))
c=False
for z in range(x+1,y+1):
  if all([l<z for l in a]) and all([l>=z for l in b]):
    c=True
    break
if c==True:
  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=max(a)
b_min=min(b)
for i in range(x+1,y+1):
    if a_max<i and i<=b_min:
        print("No War")
        exit()
print("War")

Solution (Python):
n,m,x,y = map(int, input().strip().split())
mx = max([int(t) for t in input().strip().split()])
my = min([int(t) for t in input().strip().split()])
for z in range(mx+1, my+1):
    if x < z < y:
        print("No War")
        exit(0)
print("War")

Solution (Python):
import sys
n,m,x,y=map(int,input().split())
listx=list(map(int,input().split()))
listy=list(map(int,input().split()))
listx.sort(reverse=True)
listy.sort()
for i in range(x+1,y+1):
    if listx[0]<i<=listy[0]:
        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()]
x.append(X)
y.append(Y)
x.sort()
y.sort()
if x[N] < y[0]:
    print("No War")
else:
    print("War")

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

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

listx.sort()
maxX = max(listx[n-1],X)
listy.sort()
minY = min(listy[0],Y)

if maxX >= minY:
    print("War")
else:
    print("No War")

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

listx.sort()
listy.sort()

if max(listx[n-1],x) < min(listy[0],y):
    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)

xi.sort()
xi.reverse()
yi.sort()

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

Solution (Python):
LL = input().split(" ")

LX = list(map(int,input().split()))
LY = list(map(int,input().split()))
	
LX.sort(reverse = True)
LY.sort()

CO = 0

for R in range(int(LL[2])+1,int(LL[3])):
	if LX[0]  >= LY[0]:
		break
	elif LX[0] <= R  <= LY[0] :
		print("No War")
		CO = 1
		break
		
if CO == 0:
	print("War")

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

x = max(x)
y = min(y)

ans = 'War'
if x < 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()))

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

if X < Y and max_x < min_y:
    X += 1
    max_x += 1
    if (X <= max_x and max_x <= Y) or (X <= min_y and min_y <= Y):
        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()))

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

m = max(x)
n = min(y)


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

zx = list(range(max(x)+1,101))
zy = list(range(-100, min(y)+1))
kanou = set(zx) & set(zy)
if len(kanou) == 0:
    print('War')
else:
    for i in kanou:
        if X < i <= Y:
            print('No War')
            break
    else:
        print('War')

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

Solution (Python):
n,m,x,y = map(int, input().split())
lix = list(map(int, input().split()))
liy = list(map(int, input().split()))
lix.sort()
liy.sort()
flag = 0
for i in range(x+1,y+1):
    if lix[-1] < i and i <= liy[0]:
        flag = 1
        break

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

Solution (Python):
n, m, x, y = map(int, raw_input().split())
x = max(x, *map(int, raw_input().split()))
y = min(y, *map(int, raw_input().split()))
print ['War', 'No War'][x < y]

Solution (Python):

from sys import stdin

N, M, X, Y = [int(x) for x in stdin.readline().rstrip().split()]
lx = [int(x) for x in stdin.readline().rstrip().split()]
ly = [int(x) for x in stdin.readline().rstrip().split()]

lx.append(X)
ly.append(Y)

if max(lx) >= min(ly):
    print("War")
else:
    print("No 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()))
x_max = max(x_l)
y_min = min(y_l)

def f():

  if x <= x_max <= y and x <= y_min <= y:

    if x_max < y_min:
      return 'No War'
  
  return 'War'


print(f())

Solution (Python):

n, m, x, y = map(int, input().split())
x_max = max(list(map(int, input().split())))
y_min = min(list(map(int, input().split())))
if x_max < y and x_max < y_min and x < y_min:
    print('No War')
else:
    print('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]

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

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


if __name__ == '__main__':
    main()

Solution (Python):
n,m,X,Y = map(int,input().split())
ans = "War"
if X < Y:
    x = list(map(int,input().split()))
    y = list(map(int,input().split()))
    if max(x) < min(y) and X < min(y) <= Y :
        ans = "No War"
print(ans)

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

Solution (Python):
N,M,X,Y,*xy=map(int,open(0).read().split())
for Z in range(max(X,max(xy[:N]))+1,min(Y,min(xy[N:]))+1):
    print("No War")
    exit()
print("War")

Solution (Python):
n,m,X,Y = (int(x) for x in input().split())
x_list = [int(x) for x in input().split()]
y_list = [int(x) for x in input().split()]
x_list.sort(reverse=True)
y_list.sort()
for z in range(X+1,Y):
    if x_list[0] < z and y_list[0] >= z:
        print("No War")
        break
else:
    print("War")

Solution (Python):
def getinputdata():

    array_result = []    
    array_result.append(input().split(" "))

    flg = True

    try:
        while flg:

            data = input()

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = True

            else:

                flg = False
    finally:

        return array_result

arr_data = getinputdata()

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

arr_x=list(map(int, arr_data[1]))
arr_y=list(map(int, arr_data[2]))
max_x=max(arr_x)
min_y=min(arr_y)

print("No War" if x<max_x and min_y<y and max_x<min_y else "War")

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

Solution (Python):
cnds = [int(i) for i in input().split()]

posX = [int(i) for i in input().split()]
posY = [int(i) for i in input().split()]
posX.sort()
posY.sort()

max_x = posX[-1]
min_y = posY[0]
if cnds[2] < cnds[3]:
    if max_x < min_y and cnds[2] < min_y and max_x < cnds[3]:
        print('No War')
    else:
        print('War')
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()]

x_list.append(x)
x_list.sort()
y_list.append(y)
y_list.sort()

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

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

f=0


for i in range(x+1,y+1):
    if i<=b[0] and i>a[0]:
        
        f=1 
        break 
if f==1:
    print("No War")
else:
    print("War")

Solution (Python):
from sys import stdin


n, m, x, y = [int(x) for x in stdin.readline().rstrip().split()]

xList = [int(x) for x in stdin.readline().rstrip().split()]
yList = [int(x) for x in stdin.readline().rstrip().split()]


isOk = True

xMax = max(xList)
yMin = min(yList)

ret = [int(z) for z in range(xMax+1, yMin+1) if (x < z) and (z <= y)]

if len(ret) > 0:
    print("No War")
else:
    print("War")

Solution (Python):
n, m, X, Y = list(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())
num_list = [list(map(int, input().split())) for _ in range(2)]
 
x_max = max(num_list[0])
y_min = min(num_list[1])
 
if x_max >= y_min:
    print('War')
elif x_max < X or y_min > Y:
    print('War')
else:
    print('No War')

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

xn.sort(reverse = True)
ym.sort()

z = ym[0]

if xn[0] < z:
    if x < z:
        if z < y:
            print("No War")
            exit()
print("War")

Solution (Python):
import numpy as np
N, M, X, Y = list(map(int, input().split()))
A = np.array(list(map(int, input().split())))
B = np.array(list(map(int, input().split())))
num = X+1
result = False
while num <= Y:
    resultA = np.array([num for _ in range(N)])
    resultB = np.array([num for _ in range(M)])
    if np.all(resultA > A) and np.all(resultB <= B):
        result = True
        break
    num += 1

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

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

if xmax >= ymin:
  print("War")
elif set(range(xmax+1, ymin+1)) & set(range(X+1, Y+1)) != set():
  print("No War")
else:
  print("War")

Solution (Python):
n, m, X, Y = list(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 = (int(i) for i in input().split())
x_list = [int(i) for i in input().split()]
y_list = [int(i) for i in input().split()]

x_list.append(x)
y_list.append(y)

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

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

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 = [int(i) for i in input().split()]
y = [int(i) for i in 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 = [int(_) for _ in input().split()]
x_list.append(x)
y_list = [int(_) for _ in input().split()]
y_list.append(y)
x_max = max(x_list)
y_min = min(y_list)
if x_max < y_min:
    print("No War")
else:
    print("War")

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

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

Solution (Python):
s=list(map(int,input().split()))
x=list(map(int,input().split()))
y=list(map(int,input().split()))
ma, mi = -10000, 10000
for i in x:
    ma = max(ma, i)
for j in y:
    mi = min(mi, j)
ma = max(ma, s[2])
mi = min(mi, s[3])
if (ma < mi):
    print("No War")
else:
    print("War")

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

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

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

xline = list(map(int,input().split()))
yline = list(map(int,input().split()))

a = max(xline)
b = min(yline)

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

Solution (Python):
N, M, X, Y = map(int, raw_input().split())
xlst = map(int, raw_input().split())
ylst = map(int, raw_input().split())
xlst.sort()
ylst.sort()
ans = 'War'
if xlst[N-1] < Y and X < ylst[0] and xlst[N-1] < ylst[0]:
	ans = 'No ' + ans

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

Solution (Python):
N, M, X, Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))
last_x = sorted(x)[-1]
farst_y = sorted(y)[0]
if (last_x < Y) and (X < farst_y) and (last_x < farst_y):
  print("No War")
else:
  print("War")

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

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

if max(x) < min(y):
     
     
     range(max(x), min(y))
     
     for i in range(max(x)+1, min(y)+1):
          if i > max(x) and i <= min(y):
               if i > n[2] and i <= n[3]:
                    print("No War")
                    result = False
                    break
     if result:
          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)
 
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)

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

Solution (Python):
N, M, X, Y = map(int, input().split())
xls = list(map(int, input().split()))
yls = list(map(int, input().split()))
xls.sort(reverse=True)
yls.sort()
if xls[0] < yls[0] and X < yls[0] and xls[0] < Y:
    print('No War')
else:
    print('War')

Solution (Python):

import sys
N,M,X,Y = input().split()

X = int(X)
Y = int(Y)

x = list(map(int, input().split()))
y = list(map(int, input().split()))

maxX = max(x)
minY = min(y)

if maxX >= minY:
    print("War")
else:
    for Z in range(maxX+1,minY+2):
        if ( X < Z and Z <= Y ) and ( maxX < Z and minY >=Z ):
            print("No War")
            sys.exit()
        else:
            print("War")
            sys.exit()

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

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

Solution (Python):
n,m,x,y = map(int,input().split())
a = list(map(int,input().split()))
a.append(x)
b = list(map(int,input().split()))
b.append(y)
for i in range(x+1,y+1):
  if max(a) < i <= min(b):
    print("No War")
    break
else:
  print("War")

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

enpire_A = input().split()
enpire_B = input().split()

enpire_Ai = [int(enpire_A[i]) for i in range(n)]
enpire_Bi = [int(enpire_B[i]) for i in range(m)]

enpire_Ai.append(X)
enpire_Bi.append(Y)


if max(enpire_Ai) < min(enpire_Bi):
    print('No War')
    exit()

print('War')

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

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

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

li_x.extend([x])
li_y.extend([y])

max_x = max(li_x)
min_y = min(li_y)

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

Solution (Python):
n,m,x,y = map(int,input().split())
xcity = list(map(int,input().split()))
ycity = list(map(int,input().split()))
if max([x] + xcity) < min([y] + ycity):
    print("No ",end='')
print("War")

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

if xl[n] < yl[0]:
    print("No War")
else:
    print("War")

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

for i in range(X + 1, Y + 1):
    if max(x) < i and i <= min(y):
        z.append(i)

if len(z) == 0:
    print('War')
else:
    print('No War')

Solution (Python):
n,m,x,y = map(int,input().split())
if max([int(a) for a in input().split()]+[x]) < min([int(b) for b in input().split()]+[y]):
    print('No',end=' ')
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()]

for i in range(0,N):
    if X < x[i]:
        X = x[i]

for j in range(0,M):
    if Y > y[j]:
        Y = y[j]

if Y-X > 0:
    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()))

x_max = max(X_list)
y_min = min(Y_list)

war = True
for Z in range(X+1, Y+1):    
    if x_max < Z <= y_min:
        war = False
        break

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

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

Solution (Python):
n, m, X, Y = map(int, input().split())
xlist = list(map(int, input().split()))
ylist = list(map(int, input().split()))
xlist.append(X)
ylist.append(Y)
xlist.sort()
ylist.sort()

if xlist[-1] < ylist[0]:
   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)
xlist.sort()
ylist.sort()
xlist.reverse()

if xlist[0] < ylist[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()))

def war():
 if max([X]+x) < min([Y]+y):
    print('No War')
 else:
   print('War')

war()

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

ans = 'No War' if max([X] + x) < min([Y] + y) else 'War'
print(ans)

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

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

Solution (Python):
def main():
  n, m, X, Y = map(int, input().split())
  x = [X] + [int(i) for i in input().split()]
  y = [Y] + [int(i) for i in input().split()]
  print("War" if (min(y) - max(x) < 1) else "No War")
main()

Solution (Python):

 
n, m, x, y = map(int, input().split())
xn = list(map(int, input().split()))
ym = list(map(int, input().split()))
xn.append(x)
ym.append(y)
flag = 0

if max(xn) < min(ym):
    print("No War")
else:
    print("War")

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

if max(xline)<min(yline):
  print("No War")
else:
  print("War")

Solution (Python):
print("No War" if (lambda a:max(a[0][2],max(a[1]))<min(a[0][3],min(a[2])))([[int(j) for j in input().split()] for i in range(3)]) else "War")

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

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

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

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

X = int(a[2])
Y = int(a[3])

Z = list(range(X+1,Y+1))

def max(x):
    max = x[0]
    for i in range(1,len(x)):
        if max < x[i]:
            max = x[i]
    return max

def min(x):
    min = x[0]
    for i in range(1,len(x)):
        if min > x[i]:
            min = x[i]
    return min

bmax = max(b)
cmin = min(c)

if bmax >= cmin:        
    print("War")

else:
    X = list(range(bmax+1,cmin+1))
    for i in X:
        if i in Z:
            print("No War")
            break
    else:
        print("War")

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

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

x = list(map(int, input().split()))
y = list(map(int, input().split()))

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

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

if x[0] < y[0]:
    print("No War")
else:
    print("War")

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

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

Solution (Python):
N,M,X,Y = map(int, input().split())
num_list = [list(map(int, input().split())) for _ in range(2)]

Z = list(range(X+1,Y+1))

for z in Z:
    if max(num_list[0]) < z and min(num_list[1]) >= z:
        print('No War')
        break
    if z == Z[-1]:
        print('War')

Solution (Python):
a = input().split()
for i in range(len(a)):
    a[i]=int(a[i])

x = input().split()
for i in range(len(x)):
    x[i]=int(x[i])

y = input().split()
for i in range(len(y)):
    y[i]=int(y[i])
    
X = [a[2]]
Y = [a[3]]
X_and_x = X + x
Y_and_y = Y + y

if min(Y_and_y)> max (X_and_x):
    print("No War")
else:
        print("War")

Solution (Python):
a = raw_input().strip().split()
[n,m,X,Y] = [int(i) for i in a]
x = raw_input().strip().split()
x = [int(i) for i in x] + [X]
y = raw_input().strip().split()
y = [int(i) for i in y] + [Y]
x_m = max(x)
y_m = min(y)
if (x_m < y_m):
	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()))


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

print(ans)

Solution (Python):
import sys

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

    z = Y
    while z > X:
        if max(x) < z <= min(y):
            ans = "No War"
        z -= 1

    print(ans)

main()

Solution (Python):
def main():
    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 <= min(y):
            ans = "No War"
            break

    print(ans)

main()

Solution (Python):
def solv():
    count = 0
    for i in field:
        if i > 1:
            print("War")
            return
        if i == 1:
            count += 1
        if count == N+1:
            print("No War")
            return


N, M, X, Y = map(int, input().split())
x = [int(i)+100 for i in input().split()]
y = [int(i)+100 for i in input().split()]
field = [0 for _ in range(201)]
field[X+100] += 1
field[Y+100] += 2
for i in x:
    field[i] += 1
for i in y:
    field[i] += 2
solv()