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: Wrong Answer

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(-100,101):
    if x < z <= y and max(X) < z <= min(Y):
        print("Np War")
        exit()

print("War")

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
n,m,x,y=map(int,input().split(" "))
a=map(int,input().split())
b=map(int,input().split())
X=max(a)
Y=min(b)
ans="War"
if(X<Y):
    for i in range(x,y+1):
        if(i>X and i<=Y):
        #print(i)
            ans="No War"
print(ans)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
n,m,x,y=map(int,input().split(" "))
a=map(int,input().split())
b=map(int,input().split())
X=max(a)
Y=min(b)
ans="War"
for i in range(x,y+1):
    if(i>X and i<=Y):
        #print(i)
        ans="No War"
print(ans)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
n,m,x,y=map(int,input().split(" "))
a=map(int,input().split())
b=map(int,input().split())
X=max(a)
Y=min(b)
ans="War"
for i in range(x,y+1):
    if(i>X and i<=Y):
        print(i)
        ans="No War"
print(ans)

Submission status: Wrong Answer

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

for i in range(N):
 X[i] = int(X[i])
for i in range(M):
 Y[i] = int(Y[i])
X.sort()
Y.sort()

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

Submission status: Wrong Answer

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

for i in range(N):
 X[i] = int(X[i])
for i in range(M):
 Y[i] = int(Y[i])
X.sort()
Y.sort()

if((X[-1]+1)<Y[0]):
  print('No war')
else:
  print('war')

Submission status: Wrong Answer

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

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

    print('War')


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

    for i in range(max(x), min(y)):
        if X < i and i <= Y:
            print('No War')
            exit()

    print('War')


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
N,M,X,Y=map(int,input().split())
x=max(map(int,input().split()))
y=min(map(int,input().split()))
print('War' if x >= y or Y < x or X >= y else 'No War')

Submission status: Wrong Answer

Solution code:
N,M,X,Y=map(int,input().split())
x=max(map(int,input().split()))
y=min(map(int,input().split()))
print('War' if x>y or Y <= x or y <= X else 'No War')

Submission status: Wrong Answer

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

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) < min(Yl):
    print("War")
else:
    print("No War")

Submission status: Wrong Answer

Solution code:
N,M,X,Y = map(int,input().split())
x = list(map(int,input().split()))
y = list(map(int,input().split()))
tmp = list(range(X,Y+1))
tmp2 = list(range(max(x),min(y)+1))
if list(set(tmp) & set(tmp2)) == []:
  print('War')
else:
  print('No War')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N, M, X, Y = [int(i) for i in input().split()]
x_ls = [int(i) for i in input().split()]
y_ls = [int(i) for i in input().split()]
max_x = max(x_ls)
min_y = min(y_ls)
flg = 0
for z in range(int(X + 0.00001), int(Y)):
    if max_x < z <= min_y:
        flg = 1
if flg > 0:
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
N, M, X, Y = [int(i) for i in input().split()]
x_ls = [int(i) for i in input().split()]
y_ls = [int(i) for i in input().split()]
max_x = max(x_ls)
min_y = min(y_ls)
flg = 0
for z in range(int(X + 0.00001), int(Y)):
    if max_x < z <= min_y:
        flg = 1
if flg > 0:
    print("War")
else:
    print("No War")

Submission status: Wrong Answer

Solution code:

# coding: utf-8

# In[10]:


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


# In[11]:


sorted_x = sorted(x)
sorted_y = sorted(y)


# In[13]:


if X < Y:
    if sorted_x[-1] < sorted_y[0]:
        print("No War")
    else:
        print("War")
else:
    print("War")

Submission status: Wrong Answer

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

domain = set([i for i in range(X+1,Y+1)])

Z = set([i for i in range(max(X_list)+1,min(Y_list)+1)])
if len(domain and Z)!=0:
  print("No War")
else:
  print("War")

Submission status: Wrong Answer

Solution code:
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) > 1:
  print("No War")
else:
  print("War")

Submission status: Wrong Answer

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

if min(y)-max(x)>=2 and X-Y>=2:
  print('No War')
else:
  print('War')

Submission status: Wrong Answer

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

if min(y)-max(x)>=2:
  print('No War')
else:
  print('War')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n,m,x,y=map(int,input().split())
xlist=[int(i) for i in input().split()]
ylist=[int(i) for i in input().split()]

if x<y and xlist<ylist:
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n, m, x, y = map(int, input().split())
x_li = list(map(int, input().split()))
y_li = list(map(int, input().split()))
if  x < y and max(x_li) < min(y_li):
    print("No War")
elif x >= y or max(x_li) >= min(y_li):
    print("War")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n, m, x, y = map(int, input().split())
x_li = list(map(int, input().split()))
y_li = list(map(int, input().split()))
if  (x+1) < y and (max(x_li)+1) < min(y_li):
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
n, m, x, y = map(int, input().split())
x_li = list(map(int, input().split()))
y_li = list(map(int, input().split()))
if  x < y and (max(x_li)+1) < min(y_li):
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
n, m, x, y = map(int, input().split())
x_li = list(map(int, input().split()))
y_li = list(map(int, input().split()))
if  x < y and (max(x_li)+1) <= min(y_li):
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
n, m, x, y = map(int, input().split())
x_li = list(map(int, input().split()))
y_li = list(map(int, input().split()))
if  x < y and max(x_li)+1 < min(y_li):
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
n, m, x, y = map(int, input().split())
x_li = list(map(int, input().split()))
y_li = list(map(int, input().split()))
if min(y_li) > max(x_li):
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
n, m, x, y = map(int, input().split())
x_li = list(map(int, input().split()))
y_li = list(map(int, input().split()))
if (min(y_li) > max(x_li)):
        print("No War")
else:
        print("War")

Submission status: Wrong Answer

Solution code:
n, m, x, y = map(int, input().split())
x_li = list(map(int, input().split()))
y_li = list(map(int, input().split()))
if y - x > 0 and (min(y_li) - max(x_li)) >= 0:
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
n, m, x, y = map(int, input().split())
x_li = list(map(int, input().split()))
y_li = list(map(int, input().split()))
if y - x > 0 and (min(y_li) - max(x_li)) > 0:
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
n, m, x, y = map(int, input().split())
x_li = list(map(int, input().split()))
y_li = list(map(int, input().split()))
if (min(y_li) - max(x_li)) >= 0:
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
_,b,c,d,*e=map(int,open(0).read().split())
print((len(set(range(max(e[:b]),min(e[b:])+1))&set(range(c,d+1)))>0)*"No "+"War")

Submission status: Wrong Answer

Solution code:
_,b,c,d,*e=map(int,open(0).read().split());print((max(e[:b])<min(e[b:])and(c<d))*"No "+"War")

Submission status: Wrong Answer

Solution code:
_,b,c,d,*e=map(int,open(0).read().split());print((c<max(e[:b])and min(e[b:])<d and c<d)*"No "+"War")

Submission status: Wrong Answer

Solution code:
_,b,c,d,*e=map(int,open(0).read().split());print((max(e[:b])<min(e[b:]))*"No "+"War")

Submission status: Wrong Answer

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)

for i in range(len(x)):
	for j in range(i, len(x)):
		if (x[i] == x[j]) or (y[i] == y[j]):
			print('War')
			exit()

if max(x) >= min(y):
	print('War')
	exit()

print('No War')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n,m,x,y = map(int,input().split())
x_list = list(map(int,input().split()))
y_list = list(map(int,input().split()))
if max(x_list) <= min(y_list) and x <min(y_list) and y > max(x_list):
    print('No war')
else:
    print('War')

Submission status: Wrong Answer

Solution code:
from sys import stdin
N,M,X,Y=[int(x) for x in stdin.readline().rstrip().split()]
datax=[int(x) for x in stdin.readline().rstrip().split()]
datay=[int(x) for x in stdin.readline().rstrip().split()]
if sorted(datax)[-1]+1 <= sorted(datay)[0] and X+1 <= Y:
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
from sys import stdin
N,M,X,Y=[int(x) for x in stdin.readline().rstrip().split()]
datax=[int(x) for x in stdin.readline().rstrip().split()]
datay=[int(x) for x in stdin.readline().rstrip().split()]
if sorted(datax)[-1]+1 <= sorted(datay)[0]:
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
from sys import stdin
N,M,X,Y=[int(x) for x in stdin.readline().rstrip().split()]
datax=[int(x) for x in stdin.readline().rstrip().split()]
datay=[int(x) for x in stdin.readline().rstrip().split()]
if sorted(datax)[-1] <= sorted(datay)[0]:
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
from sys import stdin
N,M,X,Y=[int(x) for x in stdin.readline().rstrip().split()]
datax=[int(x) for x in stdin.readline().rstrip().split()]
datay=[int(x) for x in stdin.readline().rstrip().split()]
if sorted(datax)[-1] < sorted(datay)[0]:
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

xmax = sorted(x, key=None ,reverse=True)[0]
ymin = sorted(y)[0]

if sorted(x, key=None ,reverse=True)[0] < sorted(y)[0]:
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

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

maxX = max(areaX)
minY = min(areaY)

if x < y and maxX < minY:
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

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

maxX = max(areaX)
minY = min(areaY)

if maxX < minY:
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

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

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

x.sort()
y.sort()

if x[-1] < y[0]:
    for i in range(x[-1], y[0]+1):
        if X < i <= Y:
            # print("X({}) < i({}) <= Y({})".format(X, i, Y))
            print("No War")
            exit()

print("War")

Submission status: Wrong Answer

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

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

x.sort()
y.sort()

if x[-1] < y[0]:
    for i in range(x[-1], y[0]+1):
        if X < i <= Y:
            print("X({}) < i({}) <= Y({})".format(X, i, Y))
            print("No War")
            exit()

print("War")

Submission status: Wrong Answer

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

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

x.sort()
y.sort()

if x[-1] < y[0]:
    for i in range(x[-1], y[0]):
        if X < i <= Y:
            print("X({}) < i({}) <= Y({})".format(X, i, Y))
            print("No War")
            exit()

print("War")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N, M, X, Y = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
minB = min(B)
maxA = max(A)
if minB >= maxA:
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
N, M, X, Y = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
minB = min(B)
ans = [minB]
maxA = max(A)
ans.append(maxA)
ans.sort()
for i in range(ans[0], ans[1]+1):
  if i < minB:
    continue
  if X < i and i <= Y:
    print("No War")
    exit()
print("War")

Submission status: Wrong Answer

Solution code:
N, M, X, Y = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
ans = [min(B)]
ans.append(max(A))
ans.sort()
for i in range(ans[0], ans[1]+1):
  if X < i and i <= Y:
    print("No War")
    exit()
print("War")

Submission status: Wrong Answer

Solution code:
N, M, X, Y = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
ans = [min(B)]
ans.append(max(A))
ans.sort()
for i in range(ans[0], ans[1]+1):
  if X < i and Y <= i:
    print("No War")
    exit()
  else:
    print("War")
    exit()

Submission status: Wrong Answer

Solution code:
N, M, X, Y = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
minB = min(B)
maxA = max(A)
for i in range(maxA, minB+1):
  if X < i and Y <= i:
    print("No War")
    exit()
  else:
    print("War")
    exit()

Submission status: Wrong Answer

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)

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

Submission status: Wrong Answer

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)

if(X[n-1]>=Y[0]):
    print('War')
else:
    print('No War')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

x_max = x[0]
y_min = y[0]
result = "War"
print(X,Y)
for z in range(X+1,Y+1):
    print(z)
    if x_max < z <= y_min:
        result = "No War"
        break

print(result)

Submission status: Wrong Answer

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

x_max = x[0]
y_min = y[0]
result = "War"

for z in range(X,Y):
    if x_max < z <= y_min:
        result = "No War"
        break

print(result)

Submission status: Wrong Answer

Solution code:
import numpy as np

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

min_x = np.min(x)
max_x = np.max(x)
min_y = np.min(y)
max_y = np.max(y)

if(X < Y): #ZはXより大きな整数であるため
    if((max_x < min_y) and (max_x <= Y) and (min_y > X)):
        print("No War")
    else:
        print("War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
import numpy as np

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

min_x = np.min(x)
max_x = np.max(x)
min_y = np.min(y)
max_y = np.max(y)


if(X < Y-1): #ZはXより大きな整数であるため
    if((max_x < min_y) and (max_x <= Y) and (min_y > X)):
        print("No War")
    else:
        print("War")
else:
    print("War")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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()]
if X < Y:
    max_x = max(x)
    min_y = min(y)
    if max_x < min_y:
        print("No War")
    else:
        print("War")
elif X > Y:
    min_x = min(x)
    max_y = max(y)
    if min_x > max_y:
        print("No War")
    else:
        print("War")
else:
    print("War")

Submission status: Wrong Answer

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()]
if X < Y:
    max_x = max(x)
    min_y = min(y)
    if max_x+1 < min_y:
        print("No War")
    else:
        print("War")
else:
    min_x = min(x)
    max_y = max(y)
    if min_x > max_y+1:
        print("No War")
    else:
        print("War")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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):
  print('No War')
else:
  print('War')

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
class Solver(object):
    def __init__(self):
        self.n, self.m, self.x, self.y = list(map(int, input().split(" ")))
        self.x_s = list(map(int, input().split(" ")))
        self.y_s = list(map(int, input().split(" ")))

    def solve(self):
        self.x_s.append(self.x)
        self.x_s.sort()
        self.y_s.append(self.y)
        self.y_s.sort()
        max_x = max(self.x_s)
        min_y = min(self.y_s)
        if max_x > min_y:
            print("War")
        elif max_x == self.x:
            print("War")
        else:
            print("No War")


if __name__ == "__main__":
    s = Solver()
    s.solve()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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+1<=Y:
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

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

x_arr.append(x)
y_arr.append(y)

if max(x_arr) < min(y_arr):
    print("No war")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
# Luis Yoichi Morales January 2019

from sys import stdin
import numpy as np



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


for i in range( 1, Y+1 ):
    condition_1 = condition_2 = condition_3 = False
    if X < i and i <= Y:
        condition_1 = True

    if x_max < i:
        condition_2 = True

    if y_min >= i:
        condition_3 = True

    if condition_1 == True and condition_2 == True and condition_3 == True:
        print 'No War'
        exit()

print 'War'

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
# Luis Yoichi Morales January 2019

from sys import stdin
import numpy as np



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

for i in range( 1, Y+1 ):
    condition_1 = condition_2 = condition_3 = False
    if X < i and i <= Y:
        condition_1 = True

    #if any(k < i for k in x):
    if all(k < i for k in x ):
        condition_2 = True

    if all(k >= i for k in y):
        condition_3 = True

    if condition_1 == True and condition_2 == True and condition_3 == True:
        print 'No War'
        exit()

print 'War'

Submission status: Wrong Answer

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)
flag = False
for i in range(X+1,Y+1):
  if (max_x <= i <= min_y):
    flag = True
    break
  else:
    flag = False
if flag == True:
  print("No War")
else:
  print("War")

Submission status: Wrong Answer

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

XA = list(map(int,input().split()))
YA = list(map(int,input().split()))

if(max(XA) < min(YA) and X <= min(YA) and Y >= max(XA) ):
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

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

XA = list(map(int,input().split()))
YA = list(map(int,input().split()))

if(max(XA) < min(YA) and X < min(YA) and Y >= max(XA) ):
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

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

x_li = list(map(int,input().split()))
y_li = list(map(int,input().split()))

if max(x_li) > min(y_li):
    print('War')
else:
    if x < min(y_li) and y > max(x_li):
        if x not in y_li or y not in x_li:
            print('No War')
        else:
            print('War')
    else:
        print('War')

Submission status: Wrong Answer

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

x_li = list(map(int,input().split()))
y_li = list(map(int,input().split()))

if max(x_li) > min(y_li):
    print('War')
else:
    if x < min(y_li) and y > max(x_li):
        if x in y_li or y in x_li:
            print('No War')
    else:
        print('War')

Submission status: Wrong Answer

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

x_li = list(map(int,input().split()))
y_li = list(map(int,input().split()))

if max(x_li) > min(y_li):
    print('War')
else:
    y_li.append(y)
    x_li.append(x)
    if x < min(y_li) and y > max(x_li):
        print('No War')
    else:
        print('War')

Submission status: Wrong Answer

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

x_li = list(map(int,input().split()))
y_li = list(map(int,input().split()))

if max(x_li) > min(y_li):
    print('War')
else:
    if x < min(y_li) and y > max(x_li):
        print('No War')
    else:
        print('War')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N,M,X,Y=map(int,input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
#print(N,M,X,Y,x,y)
x.append(X)
y.append(Y)
if(max(x)>min(y)):
  print('War')
else:
  print('No War')

Submission status: Wrong Answer

Solution code:
N,M,X,Y=map(int,input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
#print(N,M,X,Y,x,y)
x.append(X)
y.append(Y)
if(max(x)>min(y)):
  print('War')
else:
  print('Np War')

Submission status: Wrong Answer

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

if min(y_list) > max(x_list) and max(x_list)-min(y_list) > 1 and X < max(x_list) and Y > min(y_list):
  print('No War')
else:
  print('War')

Submission status: Wrong Answer

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

if min(y_list) > max(x_list) and max(x_list)-min(y_list) > 1:
  print('No War')
else:
  print('War')

Submission status: Wrong Answer

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

if min(y_list) > max(x_list) and max(x_list)-min(y_list) >= 1:
  print('No War')
else:
  print('War')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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