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()))
if max(X) < y and max(X) < min(Y) and min(Y) > x:
    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()]

for Z in range(X+1, Y+1):
   if (max(x) < Z and min(y) >= Z):
      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()))
if max(X,max(x))<min(Y,min(y)): print("No War")
else: print("War")

Solution (Python):
N,M,X,Y=map(int,input().split())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
A.append(X)
B.append(Y)
a=sorted(A)
b=sorted(B)

if a[-1]<b[0]:
  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()))
MA = max(max(A), X)
mB = min(min(B), Y)
if MA < mB:
  print("No War")
else:
  print("War")

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

Solution (Python):
n, m, x, y = map(int, input().split())
X = list(map(int, input().split()))
Y = list(map(int, input().split()))
X_max = max(X)
Y_min = min(Y)
if X_max >= Y_min:
    print("War")
    exit()
else:
    XY = [i for i in range(x+1, y)]
    if Y_min in XY:
        print("No War")
    else:
        print("War")

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

if Y <= max(xs) or min(ys) <= X or min(ys) <= max(xs):
    print('War')

else:
    print('No War')

Solution (Python):
a,b,x,y=map(int,input().split())
print(['War','No War'][sorted([x]+[int(i) for i in input().split()])[-1]<sorted([y]+[int(i) for i in input().split()])[0]])

Solution (Python):
import sys

n, m, X, Y = map(int, sys.stdin.readline().split())
*x, = map(int, sys.stdin.readline().split())
*y, = map(int, sys.stdin.readline().split())

def main():
    return 'No War' if max(X, max(x)) < min(Y, min(y)) else 'War'

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

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















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

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

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

x = x_list[-1]
y = y_list[0]
if x < y and any([X < z <= Y for z in range(x+1, y+1)]):
    print('No War')
else:
    print('War')

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

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

x_max = max(X)
y_min = min(Y)

for i in range(x+1,y+1):
  if x_max < i and y_min >= i:
    print("No War")
    exit()

print("War")

Solution (Python):
import sys

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

if X <= Y:
	Z = list(range(X+1,Y+1))
else:
	print('War')
	sys.exit()

Z_x = max(x)+1
Z_y = min(y)
if Z_x <= Z_y:
	Z_xy = list(range(Z_x,Z_y+1))
else:
	print('War')
	sys.exit()

for i in Z_xy:
	if i in Z:
		print('No War')
		sys.exit()
print('War')

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

xl = list(map(int,input().split()))
yl = list(map(int,input().split()))

ans = 'War'

for i in range(x + 1 ,y + 1):
    if max(xl) < i <= min(yl):
        ans = 'No War'
        break

print(ans)

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

x_z = max(x) + 1  
y_z = min(y)  

if x_z <= y_z:
  if X < x_z <= Y:
    ans = "No War"
  else:
    for i in range(abs(y_z - x_z)):
      if X < x_z <= Y:
       ans = "No War"
       break
      else:
        x_z += 1
  if not X < x_z <= Y:
    ans = "War"
else:
  ans = "War"

print(ans)

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

Solution (Python):
n,m,x,y = map(int,input().split())
a = max([int(i) for i in input().split()])
b = min([int(i) for i in input().split()])
if a < b and x < a+1 <= y:
  print('No War')
else:
  print('War')

Solution (Python):
import sys
input = sys.stdin.readline
N, M, X, Y = map(int, input().split())
li_x = list(map(int, input().split()))
li_y = list(map(int, input().split()))
li_x.append(X)
li_y.append(Y)
li_x.sort()
li_y.sort()
if li_x[0] <= li_y[0] <= li_x[-1] or li_x[0] <= li_y[-1] <= li_x[-1]:
    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()))

Z = max(x) + 1

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

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

ans="War"

if xx[-1]<yy[0] and xx[-1]<y and x<yy[0]:
  ans="No War"

print(ans)

Solution (Python):

n, m, x, y = map(int, input().split())
xs = max(list(map(int, input().split())))
ys = min(list(map(int, input().split())))

print("No War" if xs < ys and x <= xs and ys <= 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()))
for i in range(X+1, Y+1):
  if max(x) < i <= min(y):
    print('No War')
    exit()
print('War')

Solution (Python):
import sys
input = sys.stdin.readline
li = [int(i) for i in input().split()]
N = li[0]
M = li[1]
X = li[2]
Y = li[3]
x = [int(i) for i in input().split()]
y = [int(i) for i in input().split()]
maxx = -1000
for i in range(N) :
    maxx = max(maxx,x[i])
miny = 1000
a = "War"
for i in range(M) :
    miny = min(miny,y[i])
maxx = max(X,maxx)
miny = min(Y,miny)
if maxx < miny :
    a = "No War"
print(a)

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

zx = max(x, max(X)); zy = min(y, min(Y))
print('No War') if zx < zy else print('War')

Solution (Python):
import bisect
import cmath
import heapq
import itertools
import math
import operator
import os
import re
import string
import sys
from collections import Counter, deque, defaultdict
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter, mul, add, xor

import numpy as np

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7


N, M, X1, Y1 = list(map(int, sys.stdin.buffer.readline().split()))
X = list(map(int, sys.stdin.buffer.readline().split()))
Y = list(map(int, sys.stdin.buffer.readline().split()))

X = np.array(X + [X1], dtype=int)
Y = np.array(Y + [Y1], dtype=int)
ok = X.max() < Y.min()
if ok:
    print('No War')
else:
    print('War')

Solution (Python):



(n,m,x,y) = [int(i) for i in input().rstrip().split(" ")]

xlist = [int(i) for i in input().rstrip().split(" ")]
ylist = [int(i) for i in input().rstrip().split(" ")]

xlist.append(x)
ylist.append(y)

xlist = sorted(xlist)
xlist.reverse()

ylist = sorted(ylist)

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

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

Solution (Python):
N,M,X,Y=map(int,input().split())
x=max([int(i) for i in input().split()])
y=min([int(i) for i in input().split()])
flg=False
for i in range(X+1,Y+1):
  if x<i<=y:
    flg=True
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()))

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

Solution (Python):
n, m, X, Y = map(int, input().split())
x_lst = list(map(int, input().split()))
y_lst = list(map(int, input().split()))
x_lst.append(X)
y_lst.append(Y)
print('No War' if max(x_lst) < min(y_lst) else '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)
print('No War' if max_X<min_Y and max_X<y and x<min_Y else '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)
X_max = max(X)
Y_min = min(Y)

if X_max < Y_min:
    print('No War')
else:
    print('War')

Solution (Python):
import numpy as np

N, M, X, Y = map(int, input().split())
lst_x = list(map(int, input().split()))
lst_y = [int(y) for y in input().split()]

lst = np.arange(X + 1, Y + 1)
lst = [x for x in lst if x > max(lst_x)]
lst = [y for y in lst if y <= min(lst_y)]

print('War') if len(lst) == 0 else print('No 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):
    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()
ans = min(y_list[0], y) - max(x_list[-1], x)
if ans >= 1:
    print("No War")
else:
    print("War")

Solution (Python):
import sys

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

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

def check_x(x, Z):

    for element in x:
        if element >= Z:
            return False
    
    return True

def check_y(y, Z):

    for element in y:
        if element < Z:
            return False
    
    return True


for Z in range(X+1, Y+1, 1):
    if check_x(x, Z)==True and check_y(y, Z)==True:
        print("No War")
        sys.exit()


print("War")

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

if max(X,max(x1)) < min(Y,min(x2)):   
    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(),b.sort()

if max(a[-1],x) < min(y,b[0]):
    print("No War")
else:
    print("War")

Solution (Python):
A = list(map(int,input().split(" ")))
B = list(map(int,input().split(" ")))
C = list(map(int,input().split(" ")))
max_x = max(B)
min_y = min(C)
X = A[2]
count = -100
Y = A[3]
for i in range(200):
    if X < count <= Y and max_x < count and count <= min_y:
        print("No War")
        exit()
    count += 1
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 = min(y)

if X<z<=Y and max(x)<z and min(y)>=z:
    print('No War')

else:
    print('War')

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

max_x = max(lstx)
min_y = min(lsty)

for i in range(1,y-x+1):
    z = x+i
    if max_x < z and min_y >= z : 
        ans = "No War"
        break
else:
    ans = "War"

print(ans)

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

for i in range(x+1,y):
  if X<i<=Y:
    print("No War")
    s=1
    break
if s==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()))

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

Solution (Python):
N=list(map(int,input().split()))
X=list(map(int,input().split()))
Y=list(map(int,input().split()))
if(max(X)<min(Y) and N[2]<max(X) and N[3]>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()))
A=max(x)
B=min(y)
if A>=B:
    print("War")
else:
    if X<=A and B<=Y:
        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()
b.sort()
if a[-1]>=b[0]:
  print("War")
  exit()
if x<b[0]<=y:
  print("No War")
else:
  print("War")

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

mx = max(xs)
my = min(ys)

for i in range(x+1, y+1):
    if i <= mx or my < i:
        continue
    else:
        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()))
if max(x)<min(y) and X<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())
Xpoints=list(map(int, input().split()))
Ypoints=list(map(int, input().split()))
isWar='War'
for z in range(-99, 101):
    if X < z and z <= Y:
        if max(Xpoints) < z:
            if min(Ypoints) >= z:
                isWar = 'No War'
                break

print(isWar)

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

if max(X_list) < min(Y_list) and X < min(Y_list) and max(X_list) < Y:
    print("No War")
else:
    print("War")

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

xl = list(map(int, input().split()))
yl = list(map(int, input().split()))

for i in range(X + 1, Y):
    if max(xl) < i <= min(yl):
        print('No War')
        exit()

print('War')

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

x.sort()
y.sort()

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

Solution (Python):
n,m,X,Y=map(int,input().split())
k=list(map(int,input().split(" ")))
j=list(map(int,input().split(" ")))
print(["","No "][max(X,max(k))<min(min(j),Y)]+"War")

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

Solution (Python):
n, m, x, y = map(int, input().split())
l_a = list(map(int, input().split()))
l_b = list(map(int, input().split()))
l_a.append(x)
l_b.append(y)
l_a = sorted(l_a)
l_b = sorted(l_b)
if l_a[-1] < l_b[0]:
    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())))
ans = 'War'
for Z in range(X+1,Y+1):
    if x < Z <= 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()))
print("No War" if max(x)<min(y) and max(x)<Y and X<min(y) else "War")

Solution (Python):
import sys
import numpy as np
input = sys.stdin.readline
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()]
xmax = max(x)
ymin = min(y)
Z = [int(x) for x in range(X + 1, Y + 1)]
for z in Z:
    if xmax < z and ymin >= z:
        print("No War")
        sys.exit()
print("War")

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

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

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

Solution (Python):
n, m, x, y = map(int, input().split())
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())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
x = max(X,max(A))
y = min(Y,min(B))
 
if Y >= x and y > X and y > 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()))
x.append(X)
y.append(Y)
xmax=max(x)
ymin=min(y)
if ymin<=xmax:
  print('War')
else:
  print('No War')

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

Solution (Python):
n,m,x,y=map(int,input().split())
xi=sorted(list(map(int,input().split())))
yi=sorted(list(map(int,input().split())))
if(max(xi[-1],x)<min(yi[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()))
for i in range(x+1,y+1):
    if all(a<i for a in xi) and all(b>=i for b in yi):
        print("No War")
        break
else:
    print("War")

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

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

Z = max(x) + 1
if min(y) >= Z and X < Z <= Y:
    print('No War')
else:
    print('War')

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

Solution (Python):

import math
si = lambda: input()
ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))
n,m,x,y=nm()
X = nl()
Y = nl()
Z = []
z = 0
if max(X)<min(Y):
    z=max(X)+1
else:
    print('War')
    exit()

for i in range(z,min(Y)+1):
    Z.append(i)


if len(Z)==0:
    print('War')
    exit()

is_war = True
for i in range(len(Z)):
    if x<Z[i]<=y:
        is_war = False
    else:
        pass
if is_war:
    print('War')
else:
    print('No War')

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

xi.append(x)
yi.append(y)

ans = 0
for i in range(-100,100):
    check = 0
    for j in xi:
        if i <= j:
            check = 1
    for k in yi:
        if i > k:
            check = 1
    if check == 0:
        ans = 1
        break
if ans == 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()))
if max(X,max(x))<min(Y,min(y)):
    print("No War")
else:
    print("War")

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

x1 = max(map(int,input().split())) + 1
y1 = min(map(int,input().split()))

if x1 <= y1 and x1 <= y and y1 > x:
    print('No War')
else:
    print('War')

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

x1 = max([int(i) for i in input().split()]) + 1
y1 = min([int(i) for i in input().split()])

if x1 <= y1 and x1 <= y and y1 > 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()))

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

if max(x[-1], X) < min(y[0], Y):
  print("No War")
else:
  print("War")

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

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

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

    if max(xx, X) < min(yy, Y):
        print("No War")
    else:
        print("War")


main()

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

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


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

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

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


if __name__ == '__main__':
    main()

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

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

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

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

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

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

if max(X,sorted(x)[-1])<min(Y,sorted(y)[0]): 
    print("No War")
else: 
    print("War")

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

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

Solution (Python):

import sys, math, itertools, heapq, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
sys.setrecursionlimit(10**8)
inf = float('inf')
ans = count = 0

n,m,x,y=map(int,input().split())
X=list(map(int,input().split()))
Y=list(map(int,input().split()))
x+=1
xm=max(X)+1;ym=min(Y)
if x>y or xm>ym:
    print("War")
    exit()
if xm<=y and ym>=x:
    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()))
flag=False
for z in range(x+1,y+1):
  
  if max(xlist)<z and min(ylist)>=z:
    flag=True
    
print("No War" if flag else "War")

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

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

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


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

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 + [X]) < min(B + [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()))

xa = max(x)
ya = min(y)

for i in range(X+1, Y+1):
    if xa < i <= ya:
        print('No War')
        exit()
print('War')

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

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

x.sort(key=lambda x: -x)
y.sort()
left = x[0]
right = y[0]

if left < right:
    flag = False
    while left != right:
        left = left + 1
        if X < left and left < Y and left <= right:
            flag = True
            break
    print('No War') if flag 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()))
if X>=Y:
    print("War")
    exit()
for Z in range(X,Y):
    if max(x)<=Z<min(y):
        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()))
if max(max(xlist),x) <min(min(ylist),y) :
    print("No War")
else :
    print("War")

Solution (Python):

import sys
if sys.platform =='ios':
    sys.stdin=open('input_file.txt')

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


x.append(x1)
y.append(y1)

x.sort()
y.sort()

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

Solution (Python):

n, m, x, y = [int(s) for s in input().split()]
x_cities_wants_A = [int(s) for s in input().split()]
y_cities_wants_B = [int(s) for s in input().split()]

is_break_out = 'War'

x_cities_wants_A.sort()
y_cities_wants_B.sort()

if y - x >= 1:
    for i in range(x + 1, y + 1):
        if i > max(x_cities_wants_A) and i <= min(y_cities_wants_B):
            is_break_out = 'No War'

print(is_break_out)

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

xl =  list(map(int,input().split()))
yl =  list(map(int,input().split()))	


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

Solution (Python):

import sys


def solve(N: int, M: int, X: int, Y: int, x: "List[int]", y: "List[int]"):
    ymin = min(min(y), Y)
    Z = ymin
    if max(max(x), X) < Z:
        print("No War")
    else:
        print("War")



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    M = int(next(tokens))  
    X = int(next(tokens))  
    Y = int(next(tokens))  
    x = [int(next(tokens)) for _ in range(N)]  
    y = [int(next(tokens)) for _ in range(M)]  
    solve(N, M, X, Y, x, y)

if __name__ == '__main__':
    main()

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

N, M, X, Y = MAP()
x = LIST()
y = LIST()

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

for Z in range(X+1, Y+1):
	if max_x < Z <= min_y:
		print("No War")
		break
else:
	print("War")

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy,copy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

def main():
    n, m, x, y = MAP()
    x_max = max(LIST())
    y_min = min(LIST())

    for z in range(x+1, y+1):
        if x_max < z <= y_min:
            print('No War')
            sys.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()]
print(("No " if max(X, *x) < min(Y, *y) else "") + "War")