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



Sample input:
3 2 10 20
8 15 13
16 22


Sample output:
No War

Submission status: Accepted

Solution code:
n,m,x,y=map(int,input().split())
xn=list(map(int,input().split()))
ym=list(map(int,input().split()))
xn.append(x)
ym.append(y)
if max(xn)<min(ym):
  print("No War")
else:
  print("War")

Submission status: Accepted

Solution code:
S = list(map(int,input().split()))
N = S[0]
M = S[1]
X = S[2]
Y = S[3]
x = list(map(int,input().split()))
y = list(map(int,input().split()))
x.append(X)
y.append(Y)
x_max = max(x)
y_min = min(y)
if x_max < y_min:
    print('No War')
else:
    print('War')

Submission status: Accepted

Solution code:
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+1):
  if(max_x < i <= min_y):
    print('No War')
    break
else:
  print('War')

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N, M, X, Y = map(int, input().split())
x_list = map(int, input().split())
y_list = map(int, input().split())

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

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

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

Submission status: Accepted

Solution code:
n, m, x, y = map(int, raw_input().split(" "))

x_max = max(map(int, raw_input().split(" ")))
y_min = min(map(int, raw_input().split(" ")))

if x <= x_max < y_min <= y:
    print("No War")
else:
    print("War")

Submission status: Accepted

Solution code:
N,M,X,Y=map(int,input().strip().split(" "))
x=input().strip().split(" ")
y=input().strip().split(" ")
x=[int(i) for i in x]
y=[int(i) for i in y]
count=0

x.sort()
y.sort()

for i in range(X+1,Y+1):
    if(x[-1]<i and y[0]>=i):
        count+=1

if(count>0):
    print("No War")
else:
    print("War")

Submission status: Accepted

Solution code:
n, m, x, y = map(int, input().split())
liX = map(int, input().split())
liY = map(int, input().split())
for i in range(max(liX) + 1, min(liY) + 1):
    if x < i <= y:
        print('No War')
        exit()
print('War')

Submission status: Accepted

Solution code:
N, M, X, Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))
Z = [z for z in range(-100, 101) if (X < z <= Y) and (max(x) < z <= min(y))]
if len(Z) is not 0: print('No War')
else: print('War')

Submission status: Accepted

Solution code:
n, m, x, y = list(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')

Submission status: Accepted

Solution code:
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()]

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

Submission status: Accepted

Solution code:
n,m,x,y = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
a_max = max(a)
b_min = min(b)
for i in range(x+1,y+1):
    if a_max < i and b_min >= i:
        print('No War')
        exit()
print('War')

Submission status: Accepted

Solution code:
# coding: utf-8
N, M, X, Y = map(int, input().split())

x = max(list(map(int, input().split())) + [X])
y = min(list(map(int, input().split())) + [Y])

ans = "War"
if x < y:
        ans = "No War"
print(ans)

Submission status: Accepted

Solution code:
# coding: utf-8
N, M, X, Y = map(int, input().split())

lst_x = list(map(int, input().split()))
lst_x.append(X)
lst_y = list(map(int, input().split()))
lst_y.append(Y)

x = max(lst_x)
y = min(lst_y)

ans = "War"
if x < y:
        ans = "No War"
print(ans)

Submission status: Accepted

Solution code:
# coding: utf-8
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"
print(ans)

Submission status: Accepted

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

flag = False
for z in range(X+1,Y+1):
    if mx<z and z<=my:
        flag=True

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

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

Solution code:
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(max(x),X)<min(min(y),Y) else "War")

Submission status: Accepted

Solution code:
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()))

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

Submission status: Accepted

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

x.sort()
y.sort()

if x[-1] < y[0] and y[0] <= Y and y[0] > X:
    ans = 'No War'
else:
    ans = 'War'

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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')

Submission status: Accepted

Solution code:
n, m, x, y = [int(i) for i in input().split()]
xl = [int(i) for i in input().split()]
yl = [int(i) for i in input().split()]
xma, ymi = max(xl), min(yl)
for z in range(x+1,y+1):
    if xma < z <= ymi:
        print("No War")
        break
else:
    print("War")

Submission status: Accepted

Solution code:
N,M,x,y = map(int,input().split())
X = list(map(int,input().split()))
Y = list(map(int,input().split()))
cnn=-1
for Z in range(-100,101):
    if (x<Z and Z<=y):
        cnt = 0
        for i in range(0,N):
            if (X[i]<Z):
                cnt = cnt + 1 
                if (cnt == N):
                    cnt=0
                    for r in range(0,M):
                        if (Z<=Y[r]):
                            cnt=cnt+1
                            if (cnt==M):
                                cnn= cnn+1
                                if (cnn==0):
                                    print ("No War")                 
            
if(cnn == -1):
    print("War")

Submission status: Accepted

Solution code:
N, M, X, Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))
for Z in range(max(x)+1, min(y)+1):
    if X < Z <= Y:
        print("No War")
        exit()
else:
    print("War")

Submission status: Accepted

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

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

maX = max(X)
miY = min(Y)

ans = ""
if maX < miY:
    ans = "No War"
else:
    ans = "War"

print(ans)

Submission status: Accepted

Solution code:
(N,M,X,Y),x,y=eval('map(int,input().split()),'*3)
print('No War'[3*(max(X,*x)>=min(Y,*y)):])

Submission status: Accepted

Solution code:
N,M,X,Y = input().split()

x_list = list(map(int, input().split()))
y_list = list(map(int, input().split()))

x_list.append(int(X))
y_list.append(int(Y))

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

Submission status: Accepted

Solution code:
a = [int(i) for i in input().split()] 
b = [int(i) for i in input().split()] 
c = [int(i) for i in input().split()] 
b.append(a[2])
c.append(a[3])
if max(b) >= min(c):
 print('War')
else:
 print('No War')

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-


def main():
    """Function."""
    n, m, x, y = map(int, input().split())

    xs = list(map(int, input().split()))
    ys = list(map(int, input().split()))

    x_val = max(xs)
    y_val = min(ys)

    flag = 0
    if x >= y_val or y <= x_val:
        flag = 1
    elif y_val <= x_val:
        flag = 1
    else:
        pass

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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
H, M, X, Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))
 
r = any(all(i < z for i in x) and all(i >= z for i in y) for z in range(X+1, Y+1))
print("No War" if r else "War")

Submission status: Accepted

Solution code:
NMXY = list(map(int, input().split()))
xlist = list(map(int, input().split()))
ylist = list(map(int, input().split()))

if max(xlist) < min(ylist) and NMXY[2] < NMXY[3] and max(xlist) < NMXY[3] and NMXY[2] < min(ylist):
    print('No War')
else:
    print('War')

Submission status: Accepted

Solution code:
def main():
    n, m, x, y = map(int, input().split())
    xs = [x] + list(map(int, input().split()))
    ys = [y] + list(map(int, input().split()))
    if max(xs) < min(ys):
        print('No War')
    else:
        print('War')


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

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

if(x_max<y_min and X < y_min<=Y):
    print("No War")
else:
    print("War")

Submission status: Accepted

Solution code:
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')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, M, X, Y = list(map(int, input().split()))
x = list(map(int, input().split()))
y = list(map(int, input().split()))
x.sort(reverse=True)
y.sort()
b = False
if(x[0] < y[0]):
  for z in range(X+1, Y+1):
    if z in range(x[0]+1, y[0]+1):
      b = True
      break
if(b):
  print("No War")
else:
  print("War")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,m,x,y=map(int,input().split())
p=[]
q=[]
p=list(map(int,input().split()))
q=list(map(int,input().split()))
p.sort()
q.sort()
a=p[-1]
b=q[0]
if a<b and x<b and b<=y:
  print('No War')
else:
  print('War')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    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")


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
N, M, X, Y = map(int, input().split())
xlist = list(map(int, input().split()))
ylist = list(map(int, input().split()))

if X < max(xlist):
    xmax = max(xlist)
else:
    xmax = X

if Y > min(ylist):
    ymin = min(ylist)
else:
    ymin = Y

if xmax + 1 <= ymin:
    print("No War")
else:
    print("War")

Submission status: Accepted

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

westernmost = max(x)
easternmost = min(y)
if max(X, westernmost) >= min(Y, easternmost):
    print("War")
else:
    print("No War")

Submission status: Accepted

Solution code:
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[N-1],X) < min(B[0],Y):
    print('No War')
else:
    print('War')

Submission status: Accepted

Solution code:
from statistics import mean, median,variance,stdev
import sys
import math
import fractions
def j(a):
    if a: print("No War")
    else :print("War")


def ct(x,y):
    if (x>y):print("")
    elif (x<y): print("")
    else: print("")

def ip():
    return int(input())

#x = ip()                              #入力整数1つ
#x,y = (int(i) for i in input().split())      #入力整数横2つ
#x,y,z = (int(i) for i in input().split())    #入力整数横3つ
n,m,x,y= (int(i) for i in input().split())  #入力整数横4つ
#a = [int(i) for i in input().split()]        #入力整数配列
#a = input()                                  #入力文字列
#a = input().split()                          #入力文字配列

a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]
ma = max(a)
mb = min(b)
z = set([i+1 for i in range(ma,mb)])
xy  =  set([i+1 for i in range(x,y)])
a = xy.intersection(z)
j(len(a))

Submission status: Accepted

Solution code:
n, m, x, y = map(int, input().split())
X_list = list(map(int, input().split()))
Y_list = list(map(int, input().split()))
z = min(Y_list)
if x < z <= y and max(X_list) < z: print('No War')
else: print('War')

Submission status: Accepted

Solution code:
temp = input().rstrip().split(" ")
N = int(temp[0])
M = int(temp[1])
X = int(temp[2])
Y = int(temp[3])
xi = []
yi = []
temp = input().rstrip().split(" ")
for i in range(N):
    xi.append(temp[i])
temp = input().rstrip().split(" ")   
for i in range(M):
    yi.append(temp[i])
count = 0
flag = 1
for i in range(X+1 , Y+1):
    Z = i
    flagX = 1
    flagY = 1
    for j in range(N):
        if int(xi[j]) >= Z:
            flagX = 0
    for j in range(M):
        if int(yi[j]) < Z:
            flagY = 0
    if flagX == 1 and flagY == 1:
        flag = 0
if flag == 0:
    print("No War")
else:
    print("War")

Submission status: Accepted

Solution code:
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))

x = max(b)
y = min(c)

p = max(a[2],x)
q = min(a[3],y)

if q-p > 0:
    print("No War")
else:
    print("War")

Submission status: Accepted

Solution code:
n, m, x, y = map(int, input().split())
xi = list(map(int, input().split())) + [x]
yi = list(map(int, input().split())) + [y]

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

Submission status: Accepted

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

    result = "War"

    for i in range(-100, 101):
        if X < i and Y >= i and max(x) < i and min(y) >= i:
            result = "No War"

    print(result)

Submission status: Accepted

Solution code:
i=input;x=i().split();print('No '*(max(map(int,i().split()+x[2:3]))<min(map(int,i().split()+x[3:4])))+'War')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
flag = "No War"
N,M,X,Y = map(int,input().split())
x_r = list(map(int,input().split()))
y_r = list(map(int,input().split()))
x_r.sort()
y_r.sort()
if x_r[-1] - y_r[0] >=0:
    flag = "War"
if x_r[-1] >= Y or X >= y_r[0]:
    flag = "War"
print(flag)

Submission status: Accepted

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

xi = list(map(int,input().split()))
yi = list(map(int,input().split()))
xi.append(x)
yi.append(y)
xi.sort()
yi.sort()

if xi[-1] < yi[0]:
    print("No War")
else:
    print("War")

Submission status: Accepted

Solution code:
N, M, X, Y = (int(i) for i in input().split())
l_x = [int(x) for x in input().split()]
l_y = [int(y) for y in input().split()]

l_x.append(X)
l_y.append(Y)
if max(l_x) >= min(l_y):
    print('War')
else:
    print('No War')

Submission status: Accepted

Solution code:
N, M, X, Y = map(int, input().split())
Xi = list(map(int, input().split()))
Yi = list(map(int, input().split()))

max_X = max(Xi)
min_Y = min(Yi)

# min_X < Z <= max_Y
# X < Z <= Y

if max_X < min_Y and X < min_Y and max_X < Y:
    print('No War')
else:
    print('War')

Submission status: Accepted

Solution code:
n,m,x,y=map(int,input().split())
xx=sorted(map(int,input().split()))
yy=sorted(map(int,input().split()))
print(["","No "][(x<yy[0])and(xx[-1]<yy[0])and(xx[-1]<y)]+"War")

Submission status: Accepted

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

war = True

for z in range(-100,101):
    new_xs = xs + [z]
    new_ys = ys + [z]
    new_xs.sort()
    new_ys.sort()
    if new_xs[-1] == z and new_xs[-2] != z and new_ys[0] == z and x<z<=y:
        war = False
        
if war:
    print('War')
else:
    print('No War')

Submission status: Accepted

Solution code:
N,M,X,Y=map(int,input().split())
x_box=input().split()
y_box=input().split()

for a in range(len(x_box)):
    x_box[a]=int(x_box[a])
for a in range(len(y_box)):
    y_box[a]=int(y_box[a])

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

Submission status: Accepted

Solution code:
# coding: utf-8
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()
else:
    print("War")

Submission status: Accepted

Solution code:
n,m,x,y=map(int,input().split())
xl=list(map(int,input().split()))
yl=list(map(int,input().split()))
zl=[i for i in range(x+1,y)]
flag=False
for i in zl:
    if i>max(xl) and min(yl)>=i:
        flag=True

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

Submission status: Accepted

Solution code:
N,M,X,Y = list(map(int,input().split(" ")))
x = list(map(int,input().split(" ")))
y = list(map(int,input().split(" ")))
f = True
for i in range(X+1,Y+1):
  r =  [j for j in x if j < i]
  r2 = [j for j in y if j >= i]
  if len(r) == N and len(r2) == M:
      print("No War")
      f = False
      break
        
if f:
    print("War")

Submission status: Accepted

Solution code:
n, m, x, y = map(int, input().split())
x_list = list(map(int, input().split()))
y_list = list(map(int, input().split()))
x_max = max(x_list)
y_min = min(y_list)
war = 'War'
for i in range(y+1):
    if x_max < i and i <= y_min and x < i and i <= y:
        war = 'No War'
print(war)

Submission status: Accepted

Solution code:
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')

Submission status: Accepted

Solution code:
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) and x < y:
    print('No War')
else:
    print('War')

Submission status: Accepted

Solution code:
n,m,x,y = map(int, input().split())
X = tuple(map(int, input().split()))
Y = tuple(map(int, input().split()))
for Z in range(x+1, y+1):
    ok = True
    for i in X:
        if i >= Z:
            ok = False
    for i in Y:
        if i < Z:
            ok = False
    if ok:
        print("No War")
        exit(0)
print("War")

Submission status: Accepted

Solution code:
# coding: utf8

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

if __name__ == "__main__":
    n, m, X, Y  = read_int_n()
    x = read_int_n()
    y = read_int_n()
    x.append(X)
    y.append(Y)
    x_max = max(x)
    y_min = min(y)
    if y_min > x_max:
        print("No War")
    else:
        print("War")

Submission status: Accepted

Solution code:
n,m,x,y=input().split()
#print(n,m,x,y)
a=input().split()
b=input().split()
#print(a,b)
flag=0
for z in range(int(x)+1,int(y)+1):
  flag1=0
  for i in range(int(n)):
    if int(a[i]) < z:
      flag1+=1
  flag2=0
  for j in range(int(m)):
    if z <= int(b[j]):
      flag2+=1
  if flag1==int(n) and flag2==int(m):
    flag=1
print('No War' if flag==1 else 'War')

Submission status: Accepted

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

maxx = max(list(map(int,input().split())))
miny = min(list(map(int,input().split())))

if x < y :
    candidate = []
    for i in range(x+1,y+1) :
        candidate.append(i)

    for i in candidate :
        if maxx < i and i <= miny :
            print("No War")
            exit(0)

print("War")

Submission status: Accepted

Solution code:
n,m,x,y=map(int,input().split())
X=list(map(int,input().split()))
Y=list(map(int,input().split()))
z=max(X)+1

print("No War" if x<z <= min(Y) and z<=y else "War")

Submission status: Accepted

Solution code:
N, M, X, Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))
war = "War"
x_max = max(x)
y_min = min(y)

for i in range(Y+1):
	if X < i <= Y:
		if x_max < i:
			if y_min >= i:
				war = "No War"
print(war)

Submission status: Accepted

Solution code:
def m_i():
    return map(int, input().split())
N,M,X,Y = m_i()
Z = max(m_i()) + 1
min_y = min(m_i())
print("No War" if (X < Z) and (Z <= min(min_y,Y)) else "War")

Submission status: Accepted

Solution code:
def m_i():
    return map(int, input().split())
N,M,X,Y = m_i()
Z = max(m_i()) + 1
min_y = min(m_i())
print("No War" if (X < Z) and (Z <= min_y) and (Z <= Y) else "War")

Submission status: Accepted

Solution code:
N,M,X,Y = map(int, input().split())
Z = max(map(int, input().split())) + 1
min_y = min(map(int, input().split()))
print("No War" if (X < Z) and (Z <= min_y) and (Z <= Y) else "War")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-


def main():
    n, m, x, y = map(int, input().split())
    xs = list(map(int, input().split())) + [x]
    ys = list(map(int, input().split())) + [y]

    if max(xs) < min(ys):
        print('No War')
    else:
        print('War')


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
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+1):
    if (x[N-1] < Z) and (Z <= y[0]):
        print("No War")
        exit()
print("War")

Submission status: Accepted

Solution code:
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 z in range(X+1,Y+1):
    if mx < z <= my:
        print('No War')
        exit()
print('War')

Submission status: Accepted

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

x=x+[X]
y=y+[Y]

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

Submission status: Accepted

Solution code:
import sys
stdin = sys.stdin

sys.setrecursionlimit(10**5)

def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

n,m,x,y = li()
xs = [x]
ys = [y]

xs = xs + list(li())
ys = ys + list(li())

print("No War") if max(xs) < min(ys) else print("War")

Submission status: Accepted

Solution code:
n,m,x,y = map(int,raw_input().split())
xx = map(int,raw_input().split())+[x]
yy = map(int,raw_input().split())+[y]
mxx = max(xx)
miyy = min(yy)
if mxx < miyy:
    print "No War"
else:
    print "War"

Submission status: Accepted

Solution code:
N, M, X, Y =(int(x) for x in input().split(" "))

x = max([int(x) for x in input().split(" ")])
y = min([int(x) for x in input().split(" ")])

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

Submission status: Accepted

Solution code:
#!/usr/bin/python
# -*- coding: utf-8 -*-

s = raw_input()
n, m, x, y = [int(x) for x in s.split()]
xx = [int(a) for a in raw_input().split()]
yy = [int(a) for a in raw_input().split()]
xx = sorted(xx)
yy = sorted(yy)

if xx[-1] >= y or yy[0] <= x or xx[-1] >= yy[0]:
    print 'War'
else:
    print 'No War'

Submission status: Accepted

Solution code:
N, M, X, Y = map(int, input().split())
xs = [int(x) for x in input().split()]
ys = [int(y) for y in input().split()]
if max(xs) < min(ys) and max(xs) < Y and min(ys) > X: 
    print('No War')
else:
    print('War')

Submission status: Accepted

Solution code:
# 値の取得
N, M, X, Y = map(int, input().split())
# X国の支配地を取得
xi = list(map(int, input().split()))
# Y国の支配地を取得
yi = list(map(int, input().split()))
# 各リストに国の首都をついか
xi.append(X)
yi.append(Y)
# 配列間同士で重複があるか確認
if max(xi) < min(yi):
    print('No War')
else:
    print('War')

Submission status: Accepted

Solution code:
n,m,x,y = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
a = max(a)
b = min(b)
for z in range(x+1,y+1):
    if a < z <= b:
        print('No War')
        exit()
print('War')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# https://beta.atcoder.jp/contests/abc110/tasks/abc110_b


def solve():
    _, _, X, Y = map(int, input().split())
    xn = max(map(int, input().split()))
    ym = min(map(int, input().split()))

    Z = xn + 1

    if X < Z <= Y and xn < Z <= ym:
        print('No War')
        exit()
    else:
        print('War')


if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
# https://beta.atcoder.jp/contests/abc110/tasks/abc110_b


def solve():
    _, _, x, y = map(int, input().split())
    Xn = max(map(int, input().split()))
    Ym = min(map(int, input().split()))

    for z in range(x + 1, y + 1):
        if Xn < z <= Ym:
            print('No War')
            exit()
    else:
        print('War')


if __name__ == '__main__':
    solve()

Submission status: Accepted

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

Z = max(xs) + 1

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

Submission status: Accepted

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

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

Submission status: Accepted

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

max_x = max(list(map(int, input().split())))
min_y = min(list(map(int, input().split())))

if min_y - max_x > 0 and max_x+1 <= Y and X+1 <= min_y:
    print("No War")
else:
    print("War")

Submission status: Accepted

Solution code:
N, M, X, Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))
Z = -100
message = 'No War'

if X <= Y:
    Z = X+1
    for xi in x:
        if Z < xi:
            Z = xi+1
    for yi in y:
        if Z <= yi:
            pass
        else:
            message = 'War'
            break
    if Z > Y:
        message = 'War'
else:
    message = 'War'

print(message)

Submission status: Accepted

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

print('No War' if max(xs) < min(ys) and max(xs) < y and min(ys) > x else 'War')

Submission status: Accepted

Solution code:
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'
print(ans)

Submission status: Accepted

Solution code:
N,M,X,Y=map(int,input().split())
xi=list(map(int, input().split()))
yi=list(map(int, input().split()))
xi+=[X]
yi+=[Y]

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N,M,X,Y=map(int,input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
x.sort()
y.sort()
ans=False
for i in range(X+1,Y+1):
    if(x[-1]<i and y[0]>=i):
        ans=True
        break
if(ans):
    print('No War')
else:
    print('War')

Submission status: Accepted

Solution code:
n,m,x,y=list(map(int,input().split()))
l_x=list(map(int,input().split()))
l_y=list(map(int,input().split()))
x_max=max(l_x)
y_min=min(l_y)
for i in range(x_max+1,y_min+1):
    if x<i<=y:
        print('No War')
        exit()
print('War')

Submission status: Accepted

Solution code:
N,M,X,Y=map(int,input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
c=0
for i in range(Y-X):
	if max(x)<i+X+1<=min(y):
		print("No War")
		exit()
else:
	print("War")