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())
xn = [int(i) for i in input().split()]
ym = [int(i) for i in input().split()]
if max(xn) >= y:
    print("War")
elif min(ym) <= x:
    print("War")
elif max(xn) >= min(ym):
    print("War")
else:
    print("No War")

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

found = False
for Z in range(X+1, Y+1):
    if max(X_list) < Z and min(Y_list) >= Z:
        found = True
        print("No War")
        break
if not found:
    print("War")

Solution (Python):
n, m, x, y = [int(i) for i in input().split()]
x_list = [int(i) for i in input().split()] + [x]
y_list = [int(i) for i in input().split()] + [y]
print("No War" if max(x_list) < min(y_list) else "War")

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

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

xx = max(xs)
yy = min(ys)

for i in range(x+1,y+1):
  if xx < i <= yy:
    print('No War')
    break
else:
  print('War')

Solution (Python):

import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

N, M, X, Y = lr()
x = lr(); x.append(X)
x.sort()
y = lr(); y.append(Y)
y.sort()
bl = y[0] > x[-1]
print('No War' if bl else 'War')

Solution (Python):

import sys
import math
from bisect import bisect_left, bisect_right, insort_left, insort_right
from collections import defaultdict, deque, Counter
from copy import deepcopy
from fractions import gcd
from functools import lru_cache, reduce
from heapq import heappop, heappush
from itertools import accumulate, groupby, product, permutations, combinations, combinations_with_replacement
from math import ceil, floor, factorial, log, sqrt, sin, cos
from operator import itemgetter
sys.setrecursionlimit(10**7)
rs = lambda: sys.stdin.readline().rstrip()
ri = lambda: int(rs())
rf = lambda: float(rs())
rs_ = lambda: [_ for _ in rs().split()]
ri_ = lambda: [int(_) for _ in rs().split()]
rf_ = lambda: [float(_) for _ in rs().split()]
INF = float('inf')
MOD = 10 ** 9 + 7
PI = math.pi


N, M, X, Y = ri_()
x = ri_()
y = ri_()
ans = 'War'
for Z in range(-100, 101):
    if X < Z <= Y and max(x) < Z and min(y) >= Z:
        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()))

flag = False

for i in range(X + 1, Y + 1):
  if max(x) < i <= min(y):
    flag = True
    break

if flag:
  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.append(X)
Y_list.append(Y)
if max(X_list) < min(Y_list):
    print('No War')
else:
    print('War')

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

x_max = max(xl)
y_min = min(yl)
for z in range(x+1, y+1):
    if x_max < z <= y_min:
        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.sort(reverse=True)
xmax = max(x[0], X)
y.sort()
ymin = min(y[0], Y)

if ymin - xmax > 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)
xmax = max(x[0], X)
y.sort()
ymin = min(y[0], Y)

if ymin - xmax > int(0):
    print("No War")
else:
    print("War")

Solution (Python):
import sys
N,M,X,Y=[int(x) for x in input().rstrip().split()]
x_n=[int(x) for x in input().rstrip().split()]
y_m=[int(x) for x in input().rstrip().split()]
x_max=max(x_n)
y_max=min(y_m)
for z in range(X+1,Y+1):
  if x_max<z and z<=y_max:
    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) 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()))
max_x = max(x)
min_y = min(y)
for i in range(X + 1, Y):
    if i > max_x and i <= min_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()))
X.append(x)
Y.append(y)
print('No War' if max(X)<min(Y) else 'War')

Solution (Python):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil
from operator import itemgetter
from copy import deepcopy
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
inf = 10**17
mod = 10**9 + 7

n,m,x,y=MI()
X=LI()
Y=LI()
X=sorted(X,reverse=True)
Y=sorted(Y)
if X[0]<Y[0] and X[0]<y and Y[0]>x:
    print("No War")
else:
    print("War")

Solution (Python):
n, m, X, Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))
Z = []
Z_x = []
f_y = False
for i in range(X+1, Y+1):
    Z.append(i)  


for i in range(len(Z)):
    cnt_x = 0
    for j in range(len(x)):
        if Z[i] > x[j]:
            cnt_x += 1
    if cnt_x == len(x):
        Z_x.append(Z[i])


for i in range(len(Z_x)):
    cnt_y = 0
    for j in range(len(y)):
        if Z_x[i] <= y[j]:
            cnt_y += 1
    if cnt_y == len(y):
        f_y = True
        break

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

Solution (Python):
n,m,x,y=map(int,input().split())
p=list(map(int,input().split()))
q=list(map(int,input().split()))
if y-x>=1:
  kouho=[]
  for k in range(x+1,y+1):
    kouho.append(k)
  p.sort()
  q.sort()
  c=0
  for i in range(0,len(kouho)):
    c+=1
    if p[-1]<kouho[i]<=q[0]:
      print("No War")
      break
    if c==len(kouho):
      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()))
jdg = False
if max(x) < min(y):
    if min(y)>X and max(x)<Y:jdg=True

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

Solution (Python):

import sys
try:
    from typing import List
except ImportError:
    pass


def solve(N: int, M: int, X: int, Y: int, x: "List[int]", y: "List[int]"):
    xs = set(x)
    xs.add(X)
    ys = set(y)
    ys.add(Y)
    x1 = min(xs)
    x2 = max(xs)
    y1 = min(ys)
    y2 = max(ys)
    print("No War" if (x2 < y1 or y2 < x1) else "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):
n,m,x,y=map(int,input().split())
x=sorted(list(map(int,input().split()))+[x])
y=sorted(list(map(int,input().split()))+[y])
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()))

xl.append(x)
yl.append(y)

if max(xl) < min(yl):
    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()))


ans="War"

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

print(ans)

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

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

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

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

m_x = sorted(x,reverse=True)
m_y = sorted(y)

ans = "War"

for i in range(m_x[0]+1,m_y[0]+1):
    if X<i<=Y:
        ans = "No War"


print(ans)

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

m_x = sorted(x,reverse=True)
m_y = sorted(y)

ans = "War"

for i in range(X+1,Y+1):
    if m_x[0]<i<=m_y[0]:
        ans = "No War"
 
print(ans)

Solution (Python):
import sys
def input(): return sys.stdin.readline().rstrip()

def main():
    _, _, X, Y = map(int, input().split())
    max_x = max(map(int, input().split() + [X]))
    min_y = min(map(int, input().split() + [Y]))

    if max_x < min_y:
        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()))
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())
x = list(map(int, input().split()))
y = list(map(int, input().split()))

ans = 'War'

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

ans = 'War'

for z in range(X+1, Y+1):
    if len(list(filter(lambda x: x < z, x))) == N and len(list(filter(lambda x: x >= z, y))) == M:
        ans = 'No War'
        break

print(ans)

Solution (Python):
n, m, x, y = map(int, input().split())
X = sorted(list(map(int, input().split()))+[x])[-1]
Y = sorted(list(map(int, input().split()))+[y])[0]
print('No War' if Y-X >= 1 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 all([i < Z for i in x]) and all([i >= Z for i in y]):
    print('No War')
    exit()

print('War')

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

Solution (Python):
MOD = 10 ** 9 + 7
INF = 10 ** 10
import sys
sys.setrecursionlimit(100000000)
dy = (-1,0,1,0)
dx = (0,1,0,-1)

def main():
    n,m,x,y = map(int,input().split())
    X = list(map(int,input().split()))
    Y = list(map(int,input().split()))
    t = max(X)
    s = min(Y)
    if max(t,x) < min(s,y):
        print('No War')
    else:
        print('War')
if __name__ == '__main__':
    main()

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

XN.sort()
YM.sort()

print("No War" if max(X,XN[N-1]) < min(Y,YM[0]) 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())))
print("No War" if any([X<z<=Y for z in range(x+1,y+1)]) 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())))
for z in range(x+1,y+1):
    if X<z<=Y:
        print("No War")
        break
else:
    print("War")

Solution (Python):
"""MILOY"""
n,m,x,y=list(map(int,input().split()))
line1=list(map(int,input().split()))
line2=list(map(int,input().split()))
t=0
try:
    for i in range(x+1,y+1):
        c=0
        s=0
        for j in line1:
            if (i<=j):
                c+=1
            
        for j in line2:
            if(i>j):
                s+=1
              
        if ( c==0 and s==0):
            t=t+1
           
    
    if(t==0):
        print('War')
    if(t!=0):
        print('No War')
        
except:
    print('War')

Solution (Python):
n,m,x,y=list(map(int,input().split()))
line1=list(map(int,input().split()))
line2=list(map(int,input().split()))
t=0
try:
    for i in range(x+1,y+1):
        c=0
        s=0
        for j in line1:
            if (i<=j):
                c+=1
            
        for j in line2:
            if(i>j):
                s+=1
              
        if ( c==0 and s==0):
            t=t+1
           
    
    if(t==0):
        print('War')
    if(t!=0):
        print('No War')
        
except:
    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 accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
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()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

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

else:
	print("War")

Solution (Python):
N,M,X,Y = map(int,input().split())
listx = list(map(int,input().split()))
listy = list(map(int,input().split()))
x_max = max(listx)
y_min = min(listy)
z_list = [i for i in  range(-100,101,1) if X<i and i<= Y]
z_list1 = [1 for z in z_list if x_max < z and y_min>= z]
if len(z_list1)>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<min(y) and max(x)<Y):
    print("No War")
else:
    print("War")

Solution (Python):
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil
    

    
    

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

if __name__ == '__main__':
    main()

Solution (Python):
n,m,X,Y = map(int,input().split())
x = sorted(map(int,input().split())) + [X]
y = sorted(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=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()))
maxx = max(X)
miny = min(Y)
frag = 0
for i in range(x+1,y+1):
    if i >maxx and i <=miny :
        frag = 1
        break
if frag == 1:
    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()))
X.append(x)
Y.append(y)
X.sort()
Y.sort()

for i in range(-100,100):
    if X[-1] < i <= Y[0]:
        print("No War")
        exit()

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) >= min(y, Y):
    ans = "War"
else:
    ans = "No War"

print(ans)

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 or X >= y or X >= Y or Y <= x:
    ans = "War"
else:
    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()))

ans = "War"

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

print(ans)

Solution (Python):
n,m,X,Y = map(int,input().split())
x = sorted(list(map(int,input().split())))
y = sorted(list(map(int,input().split())))
if x[n-1] < y[0] and X < y[0] and x[n-1] < 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()))
if max([X,max(Xs)]) < min([Y,min(Ys)]):
  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()))
xl.sort()
yl.sort()
ans = False
if x < y and x < xl[n - 1] < yl[0] < y:
    ans = True
    
print("No War" if ans else "War")

Solution (Python):
import sys
from collections import deque

sys.setrecursionlimit(10 ** 6)


def input(): return sys.stdin.readline().rstrip()

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

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

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

Solution (Python):
import sys
sys.setrecursionlimit(10 ** 6)

def main():
    N, M, X, Y = map(int, sys.stdin.readline().rstrip().split())
    x = list(map(int, sys.stdin.readline().rstrip().split()))
    x = max(X, max(x))
    y = list(map(int, sys.stdin.readline().rstrip().split()))
    y = min(Y, min(y))
    if x < y:
        print('No War')
    else:
        print('War')


if __name__ == '__main__':
    main()

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

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

cities_x = [int(x) for x in input().split()]
cities_y = [int(x) for x in input().split()]

max_x = max(X, max(cities_x))
min_y = min(Y, min(cities_y))

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

def check(x,y,X,Y):
    
    x.append(X)
    y.append(Y)
    
    if min(y)>max(x):
        return True
    return False
if check(x,y,X,Y):
    print('No War')
else:
    print('War')

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

xx.sort()
yy.sort()
for i in range(x+1,y+1):
    if xx[-1] < i and yy[0] >= i:
        print('No War')
        quit()
print('War')

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

Solution (Python):
import sys

def main(lines):
  N, M, X, Y = map(int, lines[0].split()) 
  x = list(map(int, lines[1].split()))
  y = list(map(int, lines[2].split()))
  x.sort()
  y.sort()
  flag = 0
  for i in range(X + 1, Y + 1):
    if x[N - 1] < i and i <= y[0]:
      flag = 1
  if flag:
    print("No War")
  else:
    print("War")


if __name__ == '__main__':
    lines = []
    for l in sys.stdin:
        lines.append(l.rstrip('\r\n'))
    main(lines)

Solution (Python):
n,m,X,Y=map(int,input().split())
x=[0]*n
y=[0]*m
x=list(map(int,input().split()))
y=list(map(int,input().split()))
left=max(x)
right=min(y)

for i in range(X+1,Y+1):
  if (left<i<=right):
    print("No War")
    break
else:
  print("War")

Solution (Python):

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

wants_x.append(x)
wants_x.sort()

wants_y.append(y)
wants_y.sort()

print('War' if x >= y or max(wants_x) >= min(wants_y) else 'No War')

Solution (Python):
def main():
    N, M, X, Y = map(int, input().split())
    xlist = [int(a) for a in input().split()]
    ylist = [int(a) for a in input().split()]
    xlist.sort()
    ylist.sort()
    if X < ylist[0] <= Y and xlist[-1] < ylist[0]:
        print("No War")
    else:
        print("War")
main()

Solution (Python):

import io

n, m, q, r = map(int, input().split())
highest = max(list(map(int, input().split())))
lowest = min(list(map(int, input().split())))
print('War' if highest >= lowest or r <= highest or q >= lowest else 'No War')

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



for z in range(a+1, b + 1):
  if max(x) < z <= min(y):
    print("No War")
    exit()

print("War")

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

X_city.append(X)
Y_city.append(Y)

if max(X_city) < min(Y_city) :
  print("No War")
else :
  print("War")

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

X_city.append(X)
Y_city.append(Y)

if max(X_city) < min(Y_city) or min(X_city) > max(Y_city) :
  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) and max(x) < Y:
    print('No War')
else:
    print('War')

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

x.sort()
y.sort()

for z in range(X+1, Y):
    if x[n-1] < z  <= y[0]:
        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()))


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().split())
x = list(map(int,input().split()))
y = list(map(int,input().split()))
MAX_x = max(x)
MIN_y = min(y)
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())
x = list(map(int, input().split()))
y = list(map(int, input().split()))
border_x = max(x)
border_y = min(y)
if border_x >= border_y:
    print("War")
elif border_x<= X or border_y>= Y:
    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()]
for z in range(X+1,Y,1):
    if z>max(x):
        if z<=min(y):
            print('No War')
            break
else:
    print('War')

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

X.sort(reverse=True)
Y.sort()

ok = False
for z in range(x + 1, y + 1):
    if X[0] < z and Y[0] >= z:
        ok = True
        break

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

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

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

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

Solution (Python):

def main():
    N,M,X,Y = map(int,input().split())
    x_s = list(map(int,input().split()))
    y_s = list(map(int,input().split()))

    ok = False
    for z in range(X+1,Y+1):
        if z > max(x_s) and z <= min(y_s):
            ok = True
            break

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


if __name__ == '__main__':
    main()

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


is_ok = True
x_koho = [X]
y_koho = [Y]


for x in x_list:
    if x>=X:
        x_koho.append(x)


for y in y_list:
    if y<=Y:
        y_koho.append(y)

x_max = max(x_koho)
y_min = min(y_koho)


if y_min-x_max>0:
    print("No War")
else:
    print("War")

Solution (Python):
n,m,x,y,*a=map(int,open(0).read().split())
X,Y=max(a[:n]),min(a[n:])
print("No War" if X<y and x<Y and X<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()))
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 = [int(i) for i in input().split()]
x_pos = [int(i) for i in input().split()]
y_pos = [int(i) for i in input().split()]

left, right = max(x_pos), min(y_pos)
ans = 'War'
for z in range(X + 1, Y + 1):
    if left < z <= right:
        ans = 'No War'
        break
print(ans)

Solution (Python):
n,m,x,y = map(int,input().split())
xi = list(map(int,input().split()))
yi = list(map(int,input().split()))
xi.sort()
yi.sort()
if x <= xi[-1] < yi[0] <= y:
    print("No War")
else:
    print("War")

Solution (Python):






n, y, x, y = map(int, input().split())
x_under = [int(i) for i in input().split()]
y_under = [int(i) for i in input().split()]
max_x_under = max(x_under)
min_y_under = min(y_under)

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

print("War")

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

Solution (Python):
N,M,X,Y,*H=map(int,open(0).read().split());print('NWoa rW a r'[max(max(H[:N]),X)>=min(min(H[N:]),Y)::2])

Solution (Python):
N, M, X, Y = map(int, input().split())
x_list = list(map(int, input().split()))
x_list.append(X)
y_list = list(map(int, input().split()))
y_list.append(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(map(int, input().split()))
Y = list(map(int, input().split()))

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

Solution (Python):
n,m,x,y=map(int,input().split())
xx=list(map(int,input().split()))
yy=list(map(int,input().split()))
a = True
for i in range(-100,100):
    if x < i <= y and max(xx) < i <= min(yy):
        a = False
        break
print('War' if a else 'No War')

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

c = max(a)+1
d = min(b)
e = 0

if c > d:
    print("War")
else:
    for i in range(c,d+1):
        if x < i and i <= y:
            print("No War")
            e = 1
            break
    if e == 0:
        print("War")

Solution (Python):
def i(): return list(map(int, input().split()))
*_, x, y = i()
print("No "*(max(i() + [x]) < min(i() + [y])) + "War")

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

for i in range(x,y+1):
    if all([p < i for p in a]) and all([q >=i for q in b]) and x < i <= y:
        print("No War")
        exit()
print("War")