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):
panels = input().split()
panels = [int(panel) for panel in panels]

N,M,X,Y = panels[:]
domain = set(range(X+1,Y+1))

x_enp = input().split()
x_enp = [int(place) for place in x_enp]
y_enp = input().split()
y_enp = [int(place) for place in y_enp]

x_max = max(x_enp)
y_min = min(y_enp)

if y_min <= x_max:
    print("War")
else:
    evaluation = set(range(x_max+1,y_min+1))
    
    if evaluation & domain:
        print("No War")
    else:
        print("War")

Solution (Python):
import math
n, m,x,y = list(map(int, input().split())) 
arrayx = list(map(int, input().strip().split()))
arrayy = list(map(int, input().strip().split()))
arrayx.sort()
arrayy.sort()


ans=0
for i in range(x+1,y+1):
    
    if i>arrayx[n-1]:
        if i<=arrayy[0]:
            ans=1
if ans==0:
    print("War")
if ans==1:
    print("No War")

Solution (Python):
def helper(n,m,x,y,X,Y):
	for i in range(x+1,y+1):
		if all(n<i for n in X) and all(n>=i for n in Y):
			return "No War"
	return "War"

n,m,x,y=map(int,raw_input().split(' '))
X = map(int,raw_input().split(' ')) 
Y = map(int,raw_input().split(' '))
print helper(n,m,x,y,X,Y)

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_max = max(x)
y_min = min(y)

def check_war():
    for z in range(X+1, Y+1):
        if x_max < z and z <= y_min:
            return 'No War'
    return 'War'

print(check_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()
res = False
for z in range(x+1, y+1):
    if X[-1] < z <= Y[0]:
        res = True
if(res):
    print('No War')
else:
    print('War')

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

line1 = input[0].split()
x = input[1].split()
y = input[2].split()

x = [int(n) for n in x]
y = [int(n) for n in y]

N = int(line1[0])
M = int(line1[1])
X = int(line1[2])
Y = int(line1[3])

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

if x_max > X:
    x_border = x_max
else:
    x_border = X
if y_min < Y:
    y_border = y_min
else:
    y_border = Y

if x_border < y_border:
    print('No War')
else:
    print('War')

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

Solution (Python):
l = input().split(" ")
n= int(l[0])
m= int(l[1])
x= int(l[2])
y= int(l[3])
xcon=[]
ycon= []

xcon = input().split(" ")
for i in range(n):
    xcon[i] = int(xcon[i])

ycon = input().split(" ")
for i in range(m):
    ycon[i]=int(ycon[i])

xcon = sorted(xcon)
ycon = sorted(ycon)

if max(x,xcon[-1]) < min(ycon[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(" ")))

flug1=False
flug2=False
Z=0
for i in range(X,Y+1):
    for j in range(N):
        if i<=x[j]:
            flug1=True
            break

    for j in range(M):
        if i>y[j]:
            flug1=True
            break

    if flug1==False:
        flug2=True
        Z=i
        
    flug1=False

if flug2:
    if Z>X and Z<=Y:
        print("No War")
    else:
        print("War")
else:
    print("War")

Solution (Python):
N,M,X,Y = map(int,input().split(" "))
list1 = list(map(int,input().split(" ")))
list2 = list(map(int,input().split(" ")))
list1.sort(reverse=True)
list2.sort()
while(True):
    if list1[0] >= Y:
        print("War")
        break
    if list2[0] <= X:
        print("War")
        break
    if list1[0] >= list2[0]:
        print("War")
        break
    elif list2[0] < Y:
        print("No War")
        break

Solution (Python):
s = list(map(int,input().split()))
t = list(map(int,input().split()))
u = list(map(int,input().split()))
if s[2] < max(t) < min(u) <= s[3]:
 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()
xList.reverse()
yList.sort()


if(yList[0]-xList[0]>=1):
  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()))
x_max = max(xi)
y_min = min(yi)
a = 0
if x_max < y_min:
    if x < y_min and y > x_max:
        a += 1
if a >= 1:
    print("No War")
else:
    print("War")

Solution (Python):
from sys import stdin
def isWar_X(z, lst):
    for i in range(len(lst)):
        if lst[i] >= z:
            return True
    return False

def isWar_Y(z, lst):
    for i in range(len(lst)):
        if lst[i] < z:
            return True
    return False

def isWar(X, Y, xs, ys):
    for z in range(X+1, Y):
        if (not(isWar_X(z, xs)) and not(isWar_Y(z, ys))):
            return "No War"
    return "War"

N, M, X, Y = [int(x) for x in stdin.readline().rstrip().split()]
xs = [int(x) for x in stdin.readline().rstrip().split()]
ys = [int(x) for x in stdin.readline().rstrip().split()]
print(isWar(X,Y, xs, ys))

Solution (Python):
def main():
    n, m, x, y = list(map(int, input().split()))
    x_list = list(map(int, input().split()))
    y_list = list(map(int, input().split()))
    x_list.append(x)
    y_list.append(y)

    zx = max(x_list) + 1
    zy = min(y_list)

    if zx > zy :
        print('War')
    else:
        print('No 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 i in range(x[N-1]+1,y[0]+1):
  if i>X and i<=Y:
    print('No War')
    exit()
print('War')

Solution (Python):
N,M,X,Y= map(int, raw_input().split())
xlist= map(int, raw_input().split())
ylist= map(int, raw_input().split())
xlist.sort()
ylist.sort()
if X<xlist[-1]<Y<ylist[0] or xlist[-1]<X<Y<ylist[0] or X<xlist[-1]<ylist[0]<Y or xlist[-1]<X<ylist[0]<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()))
xmax = max(xlist)
ymin = min(ylist)
if xmax<ymin:
    for z in range(xmax+1, ymin+1):
        if X<z<=Y:
            print("No War")
            break
    else:
        print("War")
else:
    print("War")

Solution (Python):
import sys
import socket

hostname = socket.gethostname()

if hostname == 'F551C':
    sys.stdin = open('b1.in')


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


def read_str_list():
    return input().split()


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


def read_str():
    return input()


def main():
    N, M, X, Y = read_int_list()
    x = read_int_list()
    y = read_int_list()
    x.append(X)
    y.append(Y)
    if max(x) < min(y):
        res = 'No War'
    else:
        res = 'War'
    print(res)


main()

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

Solution (Python):
N, M, X, Y = list(map(int, input().split()))
cx = list(map(int, input().split()))
cy = list(map(int, input().split()))
if min(cy) - max(cx) < 1:
    print("War")
    exit()
z_max = min(cy)
z_min = max(cx) + 1
if z_min > Y or X+1 > z_max:
    print("War")
else:
    print("No War")

Solution (Python):
xy=input().split()
X=xy[2]
Y=xy[3]
n=input().split()
n.append(X)
n=[int(i) for i in n]
n=sorted(n)
m=input().split()
m.append(Y)
m=[int(i) for i in m]
m=sorted(m)
x=n[-1]
y=m[0]
if x>=y:
    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( )))
z_l=list(range(X+1,Y+1))
ans='War'
for z in z_l:
    x=list(filter(lambda x: x<z, x_l))
    y=list(filter(lambda y: y>=z, y_l))
    if len(x)==n and len(y)==m:
        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)
Z = min(min_y, Y)
if X < Z and max_x < Z:
	print("No War")
else:
	print("War")

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

print(["War","No War"][x[-1] < y[0]])

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

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

Solution (Python):
n, m, x, y = [int(i) for i in input().split(" ")]
x_range = [int(i) for i in input().split(" ")]
y_range = [int(i) for i in input().split(" ")]
war = True
for z in range(x, y):
    if x < z <= y and max(x_range) < z <= min(y_range[:m]):
        war = False
print("War" if war else "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_max = max(xs)
y_min = min(ys)
def get_war(x_max, y_min, X, Y):
    if y_min > x_max:
        for z in list(range(x_max+1, y_min + 1)):
            if (z > X) and (z <= Y):
                return 'No War'
            else:
                pass
        else:
            return 'War'
    else:
        return 'War'
print(get_war(x_max, y_min, X, Y))

Solution (Python):
n, m, X, Y = map(int,input().split())
x = [int(x) for x in input().split()]
y = [int(x) for x in input().split()]
if X>= Y:
  print('War')
else:
  xmax = max(x)
  ymin = min(y)
  if xmax >= ymin:
    print('War')
  elif xmax>=Y:
    print('War')
  elif X>= ymin:
    print('War')
  else:
    print('No War')

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


xs = xs + [x]
ys = ys + [y]

max_x = sorted(xs)[-1]
min_y = sorted(ys)[0]



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())
x = list(map(int,input().split()))
y = list(map(int,input().split()))
x.append(X)
y.append(Y)
x = sorted(x)
y = sorted(y)

for z in range(-100,101):
    if z > max(x) and z <= min(y):
        ans = "No War"
        break
    else:
        ans = "War"
print(ans)

Solution (Python):
N, M, X, Y = map(int, input().split())
list_x = list(map(int,input().split(' ')))
list_y = list(map(int,input().split(' ')))
 
 
min_range = max(list_x)
max_range = min(list_y)
 
ans = 0
 
for i in range(X+1, Y+1):
  if(i > min_range and i <= max_range):
    ans = 1
 
if (ans == 1):
  print("No War")
elif (ans == 0):
  print("War")

Solution (Python):
head=[int(n) for n in input().split()]
list_x=[int(n) for n in input().split()]
list_x.append(head[2])
list_y=[int(n) for n in input().split()]
list_y.append(head[3])
if max(list_x) < min(list_y):
    print("No War")
else:
    print("War")

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

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

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

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

for z in range(X+1, Y+1):
    if x_max < z and y_min >= z:
        print("No War")
        break
else:
    print("War")

Solution (Python):
import sys

AN, BM, AX, BY = [int(x) for x in input().split()]
As = [int(x) for x in input().split()]
Bs = [int(x) for x in input().split()]

Z = BY

for loct in Bs:
    if loct < Z:
        Z = loct
        if Z <= AX:
            print('War')
            sys.exit()

for loct in As:
    if loct >= Z:
        print('War')
        sys.exit()

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

Solution (Python):
N,M,X,Y = map(int,input().split(" "))
list1 = list(map(int,input().split(" ")))
list2 = list(map(int,input().split(" ")))
list1.sort(reverse=True)
list2.sort()
while(True):
    if list1[0] >= Y:
        print("War")
        break
    if list2[0] <= X:
        print("War")
        break
    if list1[0] >= list2[0]:
        print("War")
        break
    else:
        print("No War")
        break

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

a=max(x)+1
b=min(y)

def judge(a,b):
    if(a>b):
        return print("War")
    else:
        z=range(a,b+1)
        for i in z:
            if(i>X and i<=Y):
                return print("No War")
        else:
            return print("War")
        
judge(a,b)

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 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()))
flag=0
for i in range(N):
  if x[i]>=Y:
    flag+=1
for i in range(M):
  if y[i]<=X:
    flag+=1
if X>Y:
  flag+=1
if flag>0:
  print("War")
else:
  if min(y)>max(x):
    print("No War")
  else:
    print("War")

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

a = int(e[0])
b = int(e[1])
c = int(e[2])
d = int(e[3])

xmax = max(x)
ymax = min(y)

if xmax < ymax:
    if c < ymax:
        if xmax < d:
            print("No War")
        else:
            print("War")
    else:
        print("War")
else:
    print("War")

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

def check(Z):
    if not(X < Z and Z <= Y):
        return False

    for i in x:
        if not(i < Z):
            return False
    for i in y:
        if not(i >= Z):
            return False
    return True

ans = False
for i in range(-200, 200):
    ans = ans | check(i)

print ('No War' if ans else 'War')

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

def is_war(x,y,xs,ys):
    mx = max(xs)
    my = min(ys)
    z = (mx + my) / 2
    if my <= mx or my <=x:
        return True
    if mx >=my or mx >=y:
        return True
    if x < z <=y:
        return False
    return True
    
    
    
    
    
    
    
    

if is_war(x,y,xs,ys):
    print("War")
else:
    print("No War")

Solution (Python):
nmxy = [int(i) for i in input().split()]
xx = [int(i) for i in input().split()]
yy = [int(i) for i in input().split()]

if(nmxy[2]>=nmxy[3]):
  print("War")
elif(max(xx)>=min(yy) or max(xx)>=nmxy[3] or nmxy[2]>=min(yy)):
  print("War")
else:
  print("No War")

Solution (Python):


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

x_arr = []
x_list = input().split()
for xi in x_list:
    x_arr.append(int(xi))

y_arr = []
y_list = input().split()
for yi in y_list:
    y_arr.append(int(yi))

x_arr.sort()
y_arr.sort()

if(x_arr[-1]>x):
    xn = x_arr[-1]
else:
    xn = x


if(y_arr[0]<y):
    yn = y_arr[0]
else:
    yn = y

if(yn>xn):
    print('No War')
else:
    print('War')

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


x_n = input().split()
y_m = input().split()

x_int = [int(x_n[i]) for i in range(n)]
y_int = [int(y_m[i]) for i in range(m)]
x_int.append(x)
y_int.append(y)

max_x = max(x_int)
min_y = min(y_int)



if(max_x < min_y):
      if(x < y):
            print("No War")
      else:
            print("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()))
l=a[0]
r=b[0]
for i in a:
    l=max(l,i)
        
    
           
for i in b:
    r=min(r,i)
if l==r:
    if r==y:
        print('No War')
    else:
        print('War')
elif l>r:
    print('War')
elif l>x and r<=y:
    print('No War')
else:
    print('War')

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

Solution (Python):
N, M, X, Y =map(int,input().split())
x=[int(i) for i in input().split()]
y=[int(j) for j in input().split()]
x.sort()
y.sort()
if (x[N-1]<Y) and (x[N-1]<y[0]) and (X<y[0]):
  print('No War')
else:
  print('War')

Solution (Python):
N,M,X,Y = map(int,input().split())
XX = list(map(int,input().split()))
YY = list(map(int,input().split()))
XX.append(X)
YY.append(Y)
XX.sort()
YY.sort()
if(XX[-1]<YY[0]):
    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()))
x_max = max(xi)
x_min = min(xi)
y_max = max(xi)
y_min = min(yi)
a = 0
if x_max < y_min:
    if x < y_min and y > x_max:
        a += 1
if a >= 1:
    print("No War")
else:
    print("War")

Solution (Python):


from collections import deque
import itertools as it
import sys
import math

sys.setrecursionlimit(1000000)

N, M, X, Y = map(int, raw_input().split())
x = map(int, raw_input().split()) + [X]
y = map(int, raw_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)
war=0

nx=sorted(x)
ny=sorted(y)

if nx[N] >= ny[0]:
  print('War')
else:
  print('No War')

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

x = [i for i in map(int, input().split())]
x.sort()

y = [i for i in map(int, input().split())]
y.sort()

if X in x:
    print("War")
elif Y in y:
    print("War")
else:
    x.append(X)
    y.append(Y)
    if len(x) != len(set(x)):
        print("War")
    elif len(y) != len(set(y)):
        print("War")
    elif max(x) >= min(y):
        print("War")
    elif X >= Y:
        print("War")
    else:
        print("No War")

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

xarr.sort(reverse=True)
yarr.sort()

if x+1 >= y or xarr[0] >= yarr[0] or xarr[0] >= y or yarr[0] <= x:
    print('War')
else:
    print('No War')

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

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

c=min(min(y),Y)-max(max(x),X)

if c>=1:
    print("No War")
else:
    print("War")

Solution (Python):
n, m, xx, yy = map(int, input().split())
x = sorted(list(map(int, input().split())))
y = sorted(list(map(int, input().split())))
for i in range(xx + 1, yy):
    if x[-1] < i <= y[0]:
        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()))

l = range(X+1,Y)

x.sort()
y.sort()

maxx = x[N-1]
miny = y[0]

def decs():
    for i in l:
        if maxx < i and i <= miny:
            return True
        
    return False

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

Solution (Python):
i=lambda t: list(map(int,t.split()))
l=i(input())
x=i(input())
y=i(input())
x.append(l[2])
y.append(l[3])
x.sort()
y.sort()
if l[3]-l[2]<1:
    print("War")
elif y[0]-x[l[0]]<1:
    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()))
c=max(a);d=min(b)
if c<d and c<y and d>x:print('No War')
else:print('War')

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

x_max = max(x)
y_min = min(y)
if X < Y:
    z = [i for i in range(X+1, Y+1)]
    
    for i in z:
        if x_max < i and i <= y_min:
            accept = True
            break
if accept:
    print("No War")
else:
    print("War")

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

start = int(n[2]) + 1
end = int(n[3]) + 1
for i in range(start, end):
    check = 0
    for x_c in x:
        if i <= int(x_c):
            check = 1
            break
    for y_c in y:
        if i > int(y_c):
            check = 1
            break 
    if check == 0:
        print("No War")
        exit()
print("War")

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

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

    lx = max(mx, X)
    ly = min(my, Y)
    if lx < ly:
        print("No War")
    else:
        print("War")

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

for z in range(-114, 114):
    if x < z <= y and xs[n - 1] < z <= ys[0]:
        print("No ", end = "")
        break

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)

x_min = min(Xs)
x_max = max(Xs)
y_min = min(Ys)
y_max = max(Ys)

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

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


for i in range(max(xs) + 1, min(ys) + 1):
    if x < i <= y:
        print("No War")
        break
else:
    print("War")

Solution (Python):
n,m,x,y = [int(_) for _ in input().split()]
xList = sorted([int(_) for _ in input().split()])
yList = sorted([int(_) for _ in input().split()])

if xList[-1] < yList[0] and x < yList[0] <= y:
  print("No War")
else:
  print("War")

Solution (Python):

f = lambda: map(int, input().split())
N, M, X, Y = f()
XS = sorted(f())
YS = sorted(f())

print('War' if XS[-1] >= YS[0] or max(X, XS[-1]) >= min(Y, YS[0]) else 'No War')

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

if max(L_X) < min(L_Y) and X < min(L_Y) and max(L_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_max = max(x)
y_min = min(y)
result = False
if y_min <= x_max:
    result = True
if x_max >= Y or y_min <= X:
    result = True
if result:
    print("War")
else:
    print("No War")

Solution (Python):



line = input().split( )
line = [int(s) for s in line]
x = input().split( )
x = [int(a) for a in x]
y = input().split( )
y = [int(b) for b in y]
word = []
cx = max(x)
cy = min(y)
for z in range(line[2]+1, line[3] + 1):
    if z > cx and z <= cy:
        word.append(1)
    else:
        word.append(0)
if 1 in word:
    print("No War")
else:
    print("War")

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

for i in range(len(xList)):
  xList[i] = int(xList[i])
for j in range(len(yList)):
  yList[j] = int(yList[j])

xList.sort()
yList.sort()

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

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

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

if my - mx > 0:
    Z = mx
    for i in range(my - mx):
        Z += 1
        if X < Z and Z <= Y and mx < Z and Z <= my:
            print("No War")
            exit()
print("War")

Solution (Python):


n, m, x, y = map(int, input().split())
xx = list(map(int, input().split()))
yy = list(map(int, input().split()))
cnt=0

for i in range(x+1,y+1):
    for j in range(0,n):
        if xx[j]<i:
            cnt+=1

    for j in range(0,m):
        if yy[j]>=i:
            cnt+=1
    if cnt==n+m:
        print('No War')
        exit()
    cnt=0
print('War')

Solution (Python):
def main():
    n, m, cx, cy = [int(s) for s in input().split()]
    x = [int(s) for s in input().split()]
    y = [int(s) for s in input().split()]

    mx = max(cx, *x)
    my = min(cy, *y)

    if mx < my:
        print('No War')
    else:
        print('War')

main()

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

x = [int(i) for i in input().split()]
y = [int(i) for i in input().split()]
x.append(li[2])
y.append(li[3])

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

Solution (Python):
a = input().split() 
n = int(a[0])
m = int(a[1])
x = int(a[2])
y = int(a[3])
a = input().split()
a = [int(s) for s in a]
x_max = max(a)
a = input().split()
a = [int(s) for s in a]
y_min = min(a)
if x_max >= y or y_min <= x or x_max >= y_min:
    print("War")
else:
    print("No War")

Solution (Python):

NMXY =  list(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.append(NMXY[2])

y.append(NMXY[3])

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

Solution (Python):
def main():
    s = [int(item) for item in input().split()]
    _, _, X, Y = s
    xs = [int(item) for item in input().split()]
    ys = [int(item) for item in input().split()]
    mx = max(xs)
    my = min(ys)
    can = False
    for i in range(mx+1, my+1):
        if X < i <= Y:
            can = True
            break
    if can:
        print('No War')
    else:
        print('War')


if __name__ == '__main__':
    main()

Solution (Python):
a=input()
b=input()
c=input()

a=[int(x) for x in a.split(" ")]
b=[int(x) for x in b.split(" ")]
c=[int(x) for x in c.split(" ")]

b.sort(reverse=True)
c.sort()

for x in range(a[2]+1,a[3]+1):
    if b[0] < x and c[0] >= x:
        print("No War")
        break
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.sort()
ys.sort()
res = 'War'
for z in range(x+1,y+1):
    if xs[n-1] < z and ys[0] >= z:
        res = 'No War'
print(res)

Solution (Python):




"""








"""
def get_input():
    first = [int(i) for i in input().split(" ")]
    second = list(sorted([int(i) for i in input().split(" ")]))
    third = list(sorted([int(i) for i in input().split(" ")]))

    return first[2], first[3], second, third

def judge(x, y, x_list, y_list):
    """
    >>> judge(10,20,[8,15], [16,22])
    >>> judge(-48, -1, [-20,-35,-91,-23], [-22, 66])
    >>> judge(6,8, [-10,3,1,5,-100], [100,6,14])
    """
    x_max = max(x_list)
    y_min = min(y_list)

    if x_max >= y_min:
        return False
    if y <= x_max:
        return False
    if y_min <= x:
        return False
    return True

if __name__ == '__main__':
    
    
    res = judge(*get_input())
    if res:
        print("No War")
    else:
        print("War")

Solution (Python):



def main():
    N, M, X, Y = map(int, raw_input().split())
    x = [int(ele) for ele in raw_input().split()]  
    y = [int(ele) for ele in raw_input().split()]  

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


if __name__ == "__main__":
    main()

Solution (Python):
a = input().split() 
n = int(a[0])
m = int(a[1])
x = int(a[2])
y = int(a[3])
a = input().split()
a = [int(s) for s in a]
x_max = max(a)
a = input().split()
a = [int(s) for s in a]
y_min = min(a)
if x_max >= y:
    print("War")
elif y_min <= x:
    print("War")
else:
    if x_max < y_min: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()))
for i in range(X+1,Y+1):
    if max(x_l)<i and i<=min(y_l):
        print("No War")
        exit()
else:print("War")