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

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

flag = False

for z in range(X + 1, Y + 1):
    count_x = 0
    count_y = 0
    for i in x:
        if i < z:
            count_x += 1
    for i in y:
        if i >= z:
            count_y += 1
    
    if count_x == n and count_y == m:
        flag = True
        
if flag:
    print("No War")
else:
    print("War")

"""
count_x = 0
count_y = 0
ans = 0
for Z in range(-100, 101):
    
    if X <= Z <= Y:
        for i in range(n):
            if x[i] < Z:
                count_x += 1
        for j in range(m):
            if y[j] >= Z:
                count_y += 1
        if count_x == n and count_y == m:
            ans = 1

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

Solution (Python):
N,M,X,Y = map(int,input().split())
x = [int(i) for i in input().split()]
x.append(X)
y = [int(i) for i in input().split()]
y.append(Y)
mx_x = max(x)
mn_y = min(y)

if mx_x < mn_y:
    print('No War')
    
else:
    print('War')

Solution (Python):
a = list(map(int, input().split(' ')))
s, t = a[2], a[3]
mi = max(map(int, input().split(' ')))
ma = min(map(int, input().split(' ')))
if not mi < ma:
  print('War')
  exit()
for i in range(mi+1, ma+1):
  if s < i <= t:
    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()))
z='No War' if max(x)<min(y) and X<min(y) and min(y)<=Y else 'War'
print(z)

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

if x[-1]<y[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()))

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

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

print("War")

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

for z in range(-100, 101):
    war = False
    if x < z and z <= y:
        for i in range(n):
            for j in range(m):
                if xn[i] >= z or ym[j] < z:
                    war = True
        if war == False:
            print("No War")
            exit()
print("War")

Solution (Python):
n,m,x,y=map(int,input().split())
tmpx=x
tmpy=y
li_x=list(map(int,input().split()))
li_y=list(map(int,input().split()))
for i in range(n):
  tmpx=max(tmpx,li_x[i])
for j in range(m):
  tmpy=min(tmpy,li_y[j])
if tmpx+1<=tmpy:
  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()]

c=0
for i in range(X+1,Y+1):
  c =0
  if (i >X and i <=Y) :
    c += 1
  if max(x) < i :
    c += 1
  if min(y) >= i :
    c += 1
  
  if c == 3:
   
    print("No War")
    exit()
  else:
    continue
    
    
print("War")

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

judge = 'War'
border_x = max(X, max(xs))
border_y = min(Y, min(ys))

if (border_x < border_y):
    judge = 'No War'

print(judge)

Solution (Python):
import sys
input = sys.stdin.readline
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 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())
x_L = list(map(int,input().split()))
y_L = list(map(int,input().split()))

L = []
for i in range(x+1,y+1):
    falg = True
    if max(x_L) < i and min(y_L) >= i:
        print("No War")
        exit()

print("War")

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

max_x = max(x_li)
min_y = min(y_li)
for i in range(X + 1, Y + 1) :
    if max_x < i and min_y >= i :
        print("No War")
        exit()
print("War")

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

xc = list(map(int,input().split()))
xc.sort()
yc = list(map(int,input().split()))
yc.sort()

if xc[-1]+1 <= yc[0] and x < xc[-1]+1 and y >= xc[-1]+1:
    print('No War')
else:
    print('War')

Solution (Python):
n,m,X,Y = map(int,input().split())
x = max(list(map(int,input().split())))
y = min(list(map(int,input().split())))
ok = False
for z in range(X+1,Y+1):
        if x < z and y >= z:
            ok = True
            break
if ok :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()))
s=max(X)
t=min(Y)
ans='War'
for i in range(x+1,y+1):
    if i>s:
        if i<=t:
            ans='No War'
            break

print(ans)

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

for i in range(x+1,y+1):
  if i > max(X):
    if i <= min(Y):
      a = 1
      break
  else:
    pass
  
if a == 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()))

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

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

print('War')

Solution (Python):
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    n,m,x,y=INTM()
    xs=LIST()
    xs.append(x)
    ys=LIST()
    ys.append(y)
    
    if max(xs)>=min(ys):
        print('War')
    else:
        print('No War')
    
    
if __name__ == '__main__':
    do()

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

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

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

if a < b and max(A) < b and min(B) > a and max(A) < min(B):
    print('No War')
else:
    print('War')

Solution (Python):
n,m,x,y=map(int,input().split())
x_list=list(map(int,input().split()))
y_list=list(map(int,input().split()))
ans="War"
z=max(x_list)+1
if z>x and z<=y and z<=min(y_list):
    ans="No War"
print(ans)

Solution (Python):
import sys
 
stdin = sys.stdin
inf = 1 << 60
mod = 1000000007
 
ni = lambda: int(ns())
nin = lambda y: [ni() for _ in range(y)]
na = lambda: list(map(int, stdin.readline().split()))
nan = lambda y: [na() for _ in range(y)]
ns = lambda: stdin.readline().rstrip()
nsn = lambda y: [ns() for _ in range(y)]
ncl = lambda y: [list(ns()) for _ in range(y)]
nas = lambda: stdin.readline().split()

N, M, X, Y = na()
x = na()
y = na()
miny = min(y)
maxx = max(x)
flag = False
for i in range(X + 1, Y + 1):
    if maxx < i and miny >= i:
        flag = True

print("No War" if flag else "War")

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

Solution (Python):
n, m, X, Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))
ans = "War"
for z in range(max(X, Y)+1):
    if X < z <= Y and len([i for i in x if i < z]) == len(x) and len([i for i in y if i >= z]) == len(y):
        ans = "No War"
        break
print(ans)

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

if min(y_)>max(x_):
            print('No War')
else:
            print('War')

Solution (Python):
f1=-1;f2=-1;z1=0;z2=0
N,M,X,Y=map(int,input().split())
x=sorted(list(map(int,input().split())))
y=sorted(list(map(int,input().split())))

z1=x[-1]+1
z2=y[0]
if z1<=z2:
  if X<=x[-1] and Y>=y[0]:
    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=sorted(x)
y=sorted(y)
flag=0 
for Z in range(X+1,Y+1):
    if x[N-1]<Z and y[0]>=Z:
        flag=1
print('No War' if flag==1 else 'War')

Solution (Python):
class Solution:
    def solve(self, N: int, M: int, X: int, Y: int, x, y) -> int:

        x_ub = max(x + [X])
        y_lb = min(y + [Y])

        if x_ub < y_lb:
            return "No War"
        else:
            return "War"


if __name__ == '__main__':

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

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

    
    solution = Solution()
    print(solution.solve(N, M, X, Y, x, y))

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

Solution (Python):

N,M,X,Y=map(int,input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
flg=True
if max(x)>=min(y) or X>=Y:
    flg=False
elif min(y)<=X or Y<=max(x):
    flg=False
print('No War' if flg else 'War')

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

flag = False
cnt = 0
Z = [i for i in range(X + 1, Y + 1)]
for z in Z:
    if max(x) < z and z <= min(y):
        flag = True
        break

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

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

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

ans = False
for i in range(X+1, Y+1):
    if i > x_max and i <= y_min:
        ans = True
        break

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

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

x=list(map(int,input().split()))
y=list(map(int,input().split()))
for i in range(X+1,Y+1,1):
    if max(x)<i and i<=min(y):
        print("No War")
        exit()
print("War")

Solution (Python):
num_s, *D,  = [list(map(int, s.split())) for s in open(0)] 
flag = 0
x, y = D[0], D[1]

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

if max_x > min_y:
    flag += 1
else:
    for i in range(max_x  + 1, min_y + 1):
        if i > num_s[2] and i <= num_s[3]:
            break 
    else:
        flag += 1
if flag:
    print("War")
else:
    print("No War")

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

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

ans=False

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

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

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


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

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

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

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

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

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

for z in range(x + 1, y + 1):
    if max(X_list) < z <= min(Y_list):
        print('No War')
        exit()
print('War')

Solution (Python):
N, M, X, Y = map(int, input().split())
l1 = [i for i in range(X+1, Y+1)]
s1 = set(l1)
X_list = list(map(int, input().split()))
Y_list = list(map(int, input().split()))
X_max = max(X_list)
Y_min = min(Y_list)
if X_max < Y_min:
    l2 = [i for i in range(X_max+1, Y_min+1)]
    s2 = set(l2)
    if s1 & s2:
        print('No War')
    else:
        print('War')
else:
    print('War')

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

for z in range(x+1, y+1):
    if max(x_city) < z <= min(y_city) :
        print("No War")
        sys.exit()
print("War")

Solution (Python):
N,M,X,Y=map(int,input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
mx=max(x)
my=min(y)
if mx>my or X>Y:
    print("War")
    exit(0)
for z in range(mx+1,my+1):
    if X<z<=Y:
        print("No War")
        exit(0)
print("War")

Solution (Python):
def is_collided(x: int, y: int, xn: list, ym: list) -> bool:
    xn_max = max(xn)
    ym_min = min(ym)

    if xn_max >= ym_min:
        return True
    
    return xn_max >= y or ym_min <= x

def main():
    line1 = list( map(lambda x:int(x), input().split(' ')) )
    line2 = list( map(lambda x:int(x), input().split(' ')) )
    line3 = list( map(lambda x:int(x), input().split(' ')) )
    print("War") if is_collided(line1[2], line1[3], line2, line3) else  print("No War")

if __name__=='__main__':
    main()

Solution (Python):




def main():
    N, M, X, Y = map(int, input().split())
    XN = list(map(int, input().split()))
    YM = list(map(int, input().split()))
    result = 'War'

    for z in range(X + 1, Y + 1):
        if X < z <= Y and max(XN) < z <= min(YM):
            result = 'No War'
    print(result)


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()))
print(("","No ")[max(max(x),X)<min(min(y),Y)]+"War")

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

Solution (Python):
n,m,x,y,*l=map(int,open(0).read().split());print((max(x,*l[:n])<min(y,*l[n:]))*"No "+"War")

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

for Z in range(max(x)+1, min(y)+1):
    if Z in range(X+1, 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()))

max_x = (max(x) + 1) 

ok = 0
dame = 0

for i in y:
    if max_x <= i:
        ok = ok + 1
    else:
        dame = dame + 1

if dame != 0:
    print("War")
elif (X < max_x <= Y) and dame == 0:
    print("No War")
else:
    print("War")

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

fl = True
for i in range(N):
    if x[i] < Z and (X<Z<=Y):
        continue
    else:
        fl = False
print('No War') if fl else print('War')

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)

xn.sort()
ym.sort()

if xn[-1] >= ym[0]:
    print("War")
else:
    print("No War")

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

for z in range(x + 1, y + 1):
  if max(xl) < z and min(yl) >= z:
    print("No War")
    break
else:
  print("War")

Solution (Python):
m,n,X,Y=map(int,input().split())
*x,=map(int,input().split())
*y,=map(int,input().split())
for z in range(X+1,Y+1):
	if z <= min(y) and max(x) < z:
		print('No War')
		exit(0)
print('War')

Solution (Python):
n,m,x,y = map(int,input().split())
xi = list(map(int,input().split()))
yi = list(map(int,input().split()))
an = 0
for i in range(x+1,y+1):
    if max(xi) < i <= min(yi):
        an+=1
    
if an > 0:
    print("No War")
else:
    print("War")

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

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

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

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

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

a+=list(map(int, input().split()))
b+=list(map(int, input().split()))

print("{}".format("No War" if max(a)<min(b) else "War"))

Solution (Python):
n,m,x,y=map(int,input().split())
a=max(list(map(int,input().split())))
b=min(list(map(int,input().split())))
print("No War" if a<b and x<b and a<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()))

xx=max(x)
z=min(y)

if xx<z and X<z and z<=Y:
    print("No War")
else:
    print("War")

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

lower = max(X)
upper = min(Y)
ans ='War'
  
for z_i in range(x+1,y+1):
  if lower < z_i <= upper:
    ans ='No War'
    
print(ans)

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


if __name__ == '__main__':
    main()

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

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

if max_x >= min_y:
    print('War')
    exit()

if X >= max_x:
    print('War')
    exit()

if min_y > Y:
    print('War')
    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()))
if x<y:
    X.append(x)
    Y.append(y)
    X.sort()
    Y.sort()
    if X[-1]<Y[0]:
        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()))
Z=0
flag=0
x.sort()
y.sort()



if (x[N-1]>=y[0]):
    print("War")
else:
    for i in range(X+1,Y+1):
        if (x[N-1]==i):
            flag=flag+1
        if(y[0]==i):
            flag=flag+1
    if flag==2:
        print("No War")
    else:
        print("War")

Solution (Python):
import sys

N,M,X,Y=list(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,1):
	if x[-1]<Z and y[0]>=Z:
		print("No War")
		sys.exit()

print("War")

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

max_x = max(x_coordinates)
min_y = min(y_coordinates)


if max_x >= min_y:
    print('War')
else :
    flag = False
    
    for i in range(max_x + 1, min_y +1):
        if i > X and i <= Y:
            flag = True
            break

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

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

Solution (Python):
n , m , x, y = map(int,input().split())
xlist = list(map(int,input().split()))
ylist = list(map(int,input().split()))
X = max(xlist)
Y = min(ylist)
for i in range(x+1, y+1):
     if X < i <=Y:
           print('No War')
           exit()
print('War')

Solution (Python):


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

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

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

if rightx < min(y, lefty) and x < lefty:
  print('No War')
else:
  print('War')

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()]
_X = max(X, max(x))
_Y = min(Y, min(y))
if _X < _Y:
    print("No War")
else:
    print("War")

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

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

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

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

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

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

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

Solution (Python):
"""
author : halo2halo
date : 23, Jan, 2020
"""

import sys



read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

N, M, X, Y = map(int, readline().split())
x = [int(x) for x in readline().split()]
y = [int(y) for y in readline().split()]

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


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

Solution (Python):
"""
author : halo2halo
date : 23, Jan, 2020
"""

import sys
import itertools
import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

N, M, X, Y = map(int, readline().split())
x = [int(x) for x in readline().split()]
y = [int(y) for y in readline().split()]

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


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

Solution (Python):
import sys

use_clipboard=True
bbn=1000000007
	


		
def main():
	n,m,x_c,y_c = map(int, input().split())
	xl=list(map(int, input().split()))
	yl=list(map(int, input().split()))
	xl.append(x_c)
	yl.append(y_c)
	
	
	if max(xl)+1 <= min(yl):
		print('No War')
	else:
		print('War')
	return 
	

isTest=False

def pa(v):
	if isTest:
		print(v)
		
class input_clipboard:
	def __init__(self,s):
		self.input_l=s.splitlines()
		self.ii=0
		
	def input(self):
		ret = self.input_l[self.ii]
		self.ii+=1
		return ret

if __name__ == "__main__":
	if sys.platform =='ios':
		if use_clipboard:
			import clipboard
			input_text=clipboard.get()
			ic=input_clipboard(input_text)
			input = lambda : ic.input()
			
		else:
			sys.stdin=open('inputFile.txt')
		isTest=True
	else:
		pass
		
			
	ret = main()
	if ret is not None:
		print(ret)

Solution (Python):
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
def input(): return sys.stdin.readline().rstrip()

def main():
    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):
        for xi in x:
            if xi>=Z:
                break
        else:
            for yi in y:
                if yi<Z:
                    break
            else:
                print('No War')
                exit()
    print('War')
            
                

if __name__ == '__main__':
    main()

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

max_x = max(x)
min_y = min(y)
z = [i for i in range(-100, 101) if X < i <= Y and max_x < i <= min_y]
if z:
    print("No War")
else:
    print("War")

Solution (Python):
def solve():
    N, M, X, Y = map(int, input().split())
    x = list(map(int, input().split()))
    y = list(map(int, input().split()))
    
    max_x = max(X, max(x))
    min_y = min(Y, min(y))
    if max_x < min_y:
        print('No War')
    else:
        print('War')


if __name__ == '__main__':
    solve()

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(max(x), X)
min_y = min(min(y), Y)

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

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

ans='War'
for i in range(xmax+1,ymin+1):
  if x<i<=y:
    ans='No War'
    break
print(ans)

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

if xmax>ymin: print('War')
else:
  ans='War'
  for i in range(xmax+1,ymin+1):
    if x<i<=y:
      ans='No War'
      break
  print(ans)

Solution (Python):
n,m,x,y = map(int,input().split())
l1 = list(map(int,input().split()))
l2 = list(map(int,input().split()))
l1.sort()
l2.sort()
for i in range(x+1,y+1):
  if l1[-1] < i <= l2[0]:
    print("No War")
    exit()
print("War")

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

judge = sorted(xList,reverse=True)[0]+1

if judge <= sorted(yList)[0] and x < judge <= 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)):
    if (X < min(y) and min(y) <= Y):
        print('No War')
        exit(0)
print('War')

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

for i in range(x+1, y+1):
  if i>max(lx) and i<=min(ly):
    z = True

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

Solution (Python):
from __future__ import print_function

import sys
input = sys.stdin.readline


def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)
    return

















































def reverse_range(a, b):  
    return range(b, a, -1)  


def main():
    n, m, x, y = map(int, input().strip().split())
    l_x = list(map(int, input().strip().split()))
    l_x.sort(reverse=True)
    l_y = list(map(int, input().strip().split()))
    l_y.sort()

    eprint("range ", end=": ")
    eprint([i for i in reverse_range(x, y)[::-1]])

    for i in reverse_range(x, y)[::-1]:
        if l_x[0] < i <= l_y[0]:
            print("No War")
            return
    print("War")
    return


if __name__ == '__main__':
    main()

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