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):
from typing import List


def answer(n: int, m: int, x: int, y: int, xs: List[int], ys: List[int]) -> str:
    xs.append(x)
    ys.append(y)
    if min(ys) <= max(xs):
        return 'War'
    return 'No War'


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


if __name__ == '__main__':
    main()

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

ans="War"

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

print(ans)

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

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

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

Solution (Python):
n,m,x,y = map(int,input().split())
xl = list(map(int,input().split()))
yl = list(map(int,input().split()))
z = [i for i in range(x+1,y+1)]
for i in range(len(z)):
  if max(xl) < z[i] <= min(yl):
    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 = [X+1, Y]

x.sort()
y.sort()

Z[0] = max(x[-1]+1, Z[0])
Z[1] = min(y[0], Z[1])

print("No War" if Z[0]<=Z[1] else "War")

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

def main(n,m,x,y,xx,yy):
    xx.append(x)
    yy.append(y)
    xx.sort()
    yy.sort()
    if xx[-1]<yy[0]:
        return 'No War'
    else:
        return 'War'

if __name__=='__main__':
    n,m,x,y,xx,yy=readinput()
    ans=main(n,m,x,y,xx,yy)
    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(max(a),x) < min(min(b),y):
  print("No War")
else:
  print("War")

Solution (Python):

url = "https://atcoder.jp//contests/abc110/tasks/abc110_b"

def main():
    n, m, x, y = list(map(int, input().split()))
    xs = list(map(int, input().split()))
    ys = list(map(int, input().split()))
    xs.sort()
    ys.sort()
    if xs[-1] >= ys[0]:
        print('War')
        exit()
    for i in range(xs[-1] + 1, ys[0] + 1):
        if x < i <= y:
            print('No War')
            exit()
    print('War')


if __name__ == '__main__':
    main()

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

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

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

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 max(x_list)<y and x<min(y_list):
  print("No War")
else:
  print("War")

Solution (Python):
n,m,x,y = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]
b = [int(x) for x in input().split()]
max_x = max(a)
min_y = min(b)
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())
xs = list(map(int, input().split()))
ys = list(map(int, input().split()))
xs.append(x)
ys.append(y)
if max(xs) < min(ys):
    print("No War")
else:
    print("War")

Solution (Python):
def mapt(fn, *args):
    return tuple(map(fn, *args))


def Input():
    return mapt(int, input().split(" "))


def main():
    n, m, x, y = Input()
    x_data = Input()
    y_data = Input()
    x_max = max(x_data)
    y_min = min(y_data)
    ans = False

    for i in range(-100, 101):
        if x_max < i <= y_min and x < i <= y:
            ans = True
            break

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

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

for z in range(x+1,y+1):
  if max_x < z <= min_y:
    print("No War")
    exit()
else:
  print("War")

Solution (Python):
n,m,a,b = 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 a<i<b:
            print("No War")
            break
    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()))
sx = sorted(x)
sy = sorted(y)

if sx[-1] < sy[0] and X < sy[0] and sx[-1] < Y:
    print('No War')
else:
    print('War')

Solution (Python):
import numpy as np

n, m, x, y = map(int, input().split())
px = np.array([int(i) for i in input().split()])
py = np.array([int(i) for i in input().split()])

res = 'War'
for i in range(x+1, y+1):
    if np.count_nonzero(px < i) == n and np.count_nonzero(py >= i) == m:
        res = 'No War'
        break
print(res)

Solution (Python):
import sys
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 and min(y)>=i:
    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(max(X), x) < min(min(Y), y):
    print("No War")
else:
    print("War")

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

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

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

if max(X,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()))

left = max(a)
right = min(b)

if left < right and (x <= left < y or x < right <= y):
    print('No War')
else:
    print('War')

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

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

ans = "War"
for Z in range(X+1, Y+1):

    if x_max < Z <= y_min:
        ans = "No War"
        break

print(ans)

Solution (Python):
n, m, x, y = map(int, input().split())
x_list = list(map(int, input().split()))
y_list = list(map(int, input().split()))
flag = False
if max(x_list) < min(y_list):
    flag = True
if flag:
    for i in range(max(x_list) + 1, min(y_list) + 1):
        if x < i <= y:
            flag = True
            break
        else:
            flag = False
if flag:
    print('No War')
else:
    print('War')

Solution (Python):
mod = 1000000007
eps = 10**-9


def main():
    import sys
    input = sys.stdin.readline

    N, M, XX, YY = map(int, input().split())
    X = list(map(int, input().split()))
    Y = list(map(int, input().split()))
    X.append(XX)
    Y.append(YY)
    if max(X) < min(Y):
        print("No War")
    else:
        print("War")


if __name__ == '__main__':
    main()

Solution (Python):
import bisect,collections,copy,heapq,itertools,math,string
import sys
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
n, m, x, y = M()
xlist = LI()
ylist = LI()
ans = 'War'
for i in range(-100, 101):
    if x < i and y >= i and max(xlist) < i and min(ylist) >= i:
        ans = 'No War'
        break
print(ans)

Solution (Python):
import sys
from collections import deque
mapin = lambda: map(int, sys.stdin.readline().split())
listin = lambda: list(map(int, sys.stdin.readline().split()))
inp = lambda: sys.stdin.readline()

N,M,X,Y = mapin()
veca = listin()
vecb = listin()
max_x = -10000
min_y = 10000
for i in veca:
    if max_x < i:max_x = i
for i in vecb:
    if min_y > i:min_y = i
if max_x < min_y and max_x > X and min_y < Y:
    print("No War")
else:print("War")

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

for Z in range(X+1, Y+1):
    if max_X < Z <= min_Y:
        print("No War")
        exit()
else:
    print("War")

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

x_max = max(x_lis)
y_min = min(y_lis)

ans = "War"
for Z in range(X+1,Y+1):
  if x_max < Z <= y_min:
    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()))
if X < min(y) <= Y and min(y) - max(x) >= 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()))
x = sorted(x, reverse=False)[-1]
y = sorted(y, reverse=False)[0]
flg = 'War'
if x < x+1 <= y:
    if x+1 > X:
        if x+1 <= Y:
            flg = 'No War'

print(flg)

Solution (Python):
N,M,X,Y = map (int, input ().split ())
lx = [int (x) for x in input().split()]
lx.append (X)
ly = [int (y) for y in input().split()]
ly.append (Y)
if X >= Y or max(lx) >= min(ly):
  print ('War')
else:
  print ('No War')

Solution (Python):
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


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

    def judge():
        for Z in range(X + 1, Y + 1):
            if all(p < Z for p in x) and all(p >= Z for p in y):
                return True
        return False

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


if __name__ == '__main__':
    main()

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

Mx = max(x)
My = min(y)

if Mx >= My or Mx >= Y or X >= My:
  print("War")
else:
  print("No War")

Solution (Python):
_,_,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)
flag = False
for z in range(X+1,Y+1):
  if x_max < z <= y_min:
    flag = True
print("No War" if flag else "War")

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

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

for i in range(x + 1, y + 1):
  if all(j < i for j in a) and all(k >= i for k in b):
    print("No War")
    break
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()))

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

Solution (Python):
import sys

read = sys.stdin.read
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7


def main():
    N, M, X, Y = map(int, readline().split())
    x_max = max(list(map(int, readline().split())))
    y_min = min(list(map(int, readline().split())))
    if max(X,x_max)<min(Y,y_min):
        print('No War')
    else:
        print('War')



if __name__ == '__main__':
    main()

Solution (Python):
n, m, X, Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))
cnt = 0
for z in range(-100, 101):
    if X < z and z <= Y and max(x) < z and min(y) >= z:
        print("No War")
        break
    else:
        cnt += 1
        if cnt == 201:
            print("War")
            break

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 min(y)>X else "War")

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

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

print('War')

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

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

if X < z <= Y and x_max < z:
  print('No War')
else:
  print('War')

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

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

xx = max(xl)
xx = max(xx,x)
yy = min(yl)
yy = min(yy,y)

if xx<yy:
    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 = list(map(int,input().split()))
y = list(map(int,input().split()))
xr = max(x)
yl = min(y)

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

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

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

Solution (Python):
n,m,x,y=map(int,input().split())
lx=list(map(int,input().split()))
ly=list(map(int,input().split()))
z=max(lx)+1 if max(lx)>=x else x+1

if min(ly)<z or y<z:
  print("War")
  
else:
  print("No War")

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

Z_start=x[-1]+1
Z_end=y[0]

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

print("War")

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

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

if min(Y)-max(X) >= 1:
    print("No War")
else:
    print("War")

Solution (Python):
n, m, x, y = list(map(int, input().split()))
xn = list(map(int, input().split()))
yn = list(map(int, input().split()))
maxx = max(xn)
miny = min(yn)
if x < miny and miny <= y and miny > maxx:
    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)
if max(xlist)<min(ylist):
  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()))
z = 'War'
for i in range(x+1,y+1):
    if max(xl) < i and i <= min(yl):
        z = 'No War'
        break
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.sort()
y.sort()

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

isWar = True
z = min(y_list)
if (x<z<=y) and (max(x_list)<z):
    isWar = False

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

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

p = list(map(int, input().split()))
q = list(map(int, input().split()))

if max(max(p), x) < min(min(q), y):
    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())))

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

Solution (Python):
import sys
import itertools

import time
import math
import heapq
from collections import defaultdict
from collections import Counter
sys.setrecursionlimit(10 ** 7)
 
INF = 10 ** 18
MOD = 10 ** 9 + 7
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines



import sys
import itertools

import time
import math
import heapq
from collections import defaultdict
from collections import Counter
sys.setrecursionlimit(10 ** 7)
 
INF = 10 ** 18
MOD = 10 ** 9 + 7
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines



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

min_z = max(X) + 1
max_z = min(Y)
ok = False
for z in range(min_z, max_z + 1):
    if A < z <= B:
        ok = True
if ok:
    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()))
for i in range(x+1, y+1):
    if max(xx) < i <= min(yy):
        print('No War')
        exit()
print('War')

Solution (Python):
n,m,x,y = map(int,input().split())
xl = list(map(int,input().split()))+[x]
yl = list(map(int,input().split()))+[y]
if max(xl)+1<=min(yl):
    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"
x.append(X)
y.append(Y)
if max(x)<min(y):
        ans="No War"
print(ans)

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

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

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

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

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

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


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

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

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

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

Solution (Python):
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


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

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

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

    return


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

Solution (Python):
import sys
n, m, x, y = map(int, input().split())
x1 = max(list(map(int, input().split())))
y1 = min(list(map(int, input().split())))


for i in range(x+1, y+1):
    if x1 < i <= y1:
        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()))

xmax = max(xl)
ymin = min(yl)

isWar = True
for i in range(x+1, y+1):
    if (xmax < i and ymin >= i):
        isWar = False
        break
if (isWar):
    print("War")
else:
    print("No 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()))
maxX = max(X_list)
minY = min(Y_list)
for z in range(maxX+1, minY+1):
    if z > X and Y >= z:
        print("No War")
        exit()
print("War")

Solution (Python):
import sys


stdin = sys.stdin
def ns(): return stdin.readline().rstrip()
def ni(): return int(stdin.readline().rstrip())
def nm(): return map(int, stdin.readline().split())
def nl(): return list(map(int, stdin.readline().split()))


def main():
    n, m, x, y = nm()
    X = nl()
    Y = nl()
    xx = max(X)
    yy = min(Y)
    for z in range(-100, 101):
        if x < z <= y and xx < z <= yy:
            print('No War')
            return
    print('War')


if __name__ == '__main__':
    main()

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

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

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

if lx[-1] < ly[0]:
        print('No War')
else:
    print('War')

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

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

print('No War' if max(A) < min(B) 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 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=map(int,input().strip().split(" "))
ar1=[int(i) for i in input().strip().split(" ")]
ar2=[int(i) for i in input().strip().split(" ")]
ar1.append(x)
ar2.append(y)
m1=max(ar1)
m2=min(ar2)
if m2>m1:
    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()))

l = max(X)
r = min(Y)

print('No War' if l < r and not (y <= l or r <= x) else 'War')

Solution (Python):
N, M, X, Y = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
flg = False
for Z in range(-100,101):
    if X<Z<=Y and max(A)<Z and min(B) >= Z:
        flg = True
if flg:
    print("No War")
else:
    print("War")

Solution (Python):
N, M, X, Y = list(map(lambda a: int(a), input().split(" ")))
x = list(map(lambda b: int(b), input().split(" ")))
y = list(map(lambda c: int(c), 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()))
 
x.sort(reverse=True)
y.sort()
 
 
flag=0
for i in range(X+1,Y+1):
  if x[0]<i and y[0]>=i:
    flag=1
    break
  
 
  else:
    flag=0
    
if flag==1:
  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()))
    x.sort()
    y.sort()

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

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

l = []

for i in range(x+1, y+1):
    l.append(i)
    
for i in l:
    if max(l_X) < i:
        if min(l_y) >= i:
            print('No War')
            exit()
            
print('War')

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

Solution (Python):
N,M,X,Y = (int(T) for T in input().split())
ACityMax = sorted(int(T) for T in input().split())[-1]
BCityMin = sorted(int(T) for T in input().split())[0]
if ACityMax<BCityMin and ACityMax<Y and X<BCityMin:
    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 mx<my:
    for i in range(mx+1,my+1):
        if x<i<=y:
            print("No War")
            exit()
    print("War")
    
        
    

else:
    print("War")

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

city_a = []
city_b = []

v = input().split()
w = input().split()

for i in range(n):
    city_a.append(int(v[i]))
for i in range(m):
    city_b.append(int(w[i]))

city_a.sort()
city_b.sort()

p = city_a.pop()
q = city_b[0]

check = False

for i in range(x + 1, y+1):
    if p < i <= q:
        check = True
        break

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

Solution (Python):
*_,x,y=map(int,input().split())
for i in [i for i in range(max(list(map(int,input().split())))+1,min(list(map(int,input().split())))+1)]:
  if x<i<=y: print('No War');break
else:
  print('War')

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

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

	flg = False
	
	if (Y[0] <= x):
		flg = True
	
	elif (y <= X[n-1]):
		flg = True
	
	elif (X[n-1] >= Y[0]):
		flg = True
 
	if flg:
		print("War")
	else:
		print("No War")

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

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

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