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 = list(map(int, input().split()))
x = max(list(map(int, input().split())))
y = min(list(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) # x[0]が最大
y.sort() # y[0]が最小

# xの最大がyの最小以上はWar
if(x[0] >= y[0]):
    print("War")
else:
    if(y[0] <= X or x[0] > Y):
        print("War")
    else:
        print("No War")

Submission status: Wrong Answer

Solution code:
import sys
n,m,x,y=map(int,input().split())
lx=list(map(int,input().split()))
ly=list(map(int,input().split()))
lx.sort()
ly.sort()
if lx[n-1]>ly[0] or ly[0]<=x or ly[0]>y:
    print('War')
    sys.exit()
else:print('No War')

Submission status: Wrong Answer

Solution code:
import sys
n,m,x,y=map(int,input().split())
lx=list(map(int,input().split()))
ly=list(map(int,input().split()))
lx.sort()
ly.sort()
if lx[n-1]>ly[0]:
    print('War')
    sys.exit()
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()))
c=True
for z in range(x+1,y+1):
  if all([l<z for l in a]) and all([l>=z for l in b]):
    pass
  else:
    c=False
if c==True:
  print("No War")
else:
  print("War")

Submission status: Wrong Answer

Solution code:
import sys
n,m,x,y=map(int,input().split())
listx=list(map(int,input().split()))
listy=list(map(int,input().split()))
listx.sort(reverse=True)
listy.sort()
for i in range(x,y):
    if listx[0]<i<=listy[0]:
        print('No War')
        sys.exit()
print('War')

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
n,m,x,y = map(int,input().split())
xi = list(map(int,input().split()))
yi = list(map(int,input().split()))

xi.sort()
xi.reverse()
yi.sort()

if yi[0]-xi[0]>=2:
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
n,m,x,y = map(int,input().split())
xi = list(map(int,input().split()))
yi = list(map(int,input().split()))

xi.sort()
xi.reverse()
yi.sort()

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
n,m,x,y = map(int,input().split())
xi = list(map(int,input().split()))
yi = list(map(int,input().split()))

xi.sort()
xi.reverse()
yi.sort()

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

Submission status: Wrong Answer

Solution code:
LL = input().split(" ")

LX = list(map(int,input().split()))
LY = list(map(int,input().split()))
	
LX.sort(reverse = True)
LY.sort(reverse = True)

CO = 0

for R in range(int(LL[2])+1,int(LL[3])):
	if LX[0]  >= LY[0]:
		break
	elif LX[0] <= R and R <= LY[0] :
		print("No War")
		CO = 1
		break
		
if CO == 0:
	print("War")

Submission status: Wrong Answer

Solution code:
LL = input().split(" ")

LX = list(map(int,input().split()))
LY = list(map(int,input().split()))
	
LX.sort(reverse = True)
LY.sort(reverse = True)

CO = 0

for R in range(int(LL[2])+1,int(LL[3])):
	if LX[0]  <= LY[0]:
		break
	elif LX[0] <= R and R <= LY[0] :
		print("No War")
		CO = 1
		break
		
if CO == 0:
	print("War")

Submission status: Wrong Answer

Solution code:
LL = input().split(" ")

LX = list(map(int,input().split()))
LY = list(map(int,input().split()))
	
LX.sort(reverse = True)
LY.sort(reverse = True)

CO = 0

for R in range(int(LL[2])+1,int(LL[3])):
	if LX[0] <= R and R <= LY[0] :
		print("No War")
		CO = 1
		break
		
if CO == 0:
	print("War")

Submission status: Wrong Answer

Solution code:
n, m, x, y = map(int, raw_input().split())
x = max(x, map(int, raw_input().split()))
y = min(y, map(int, raw_input().split()))
print ['War', 'No War'][x < y]

Submission status: Wrong Answer

Solution code:
n, m, x, y = map(int, raw_input().split())
x = max(x, map(int, raw_input().split()))
y = max(y, map(int, raw_input().split()))
print ['War', 'No War'][x < y]

Submission status: Wrong Answer

Solution code:
import numpy as np

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

x_max = max(xs)
y_min = min(ys)

isWar = True
for Z in np.arange(X + 1, Y + 1):
    if x_max < Z and y_min >= Z:
        print('No War')
        isWar = False
if isWar:
    print('War')

Submission status: Wrong Answer

Solution code:
# 1 Dimensional World's Tale
n, m, x, y = map(int, input().split())
x_list = list(map(int, input().split()))
y_list = list(map(int, input().split()))
flag = False
for z in range(x+1, y+1):
    for s in x_list:
        if s < z:
            for t in y_list:
                if z > t:
                    break
                elif t == y_list[-1]:
                    flag = True
                else:
                    pass
        else:
            break
        if flag and s == x_list[-1]:
            print('No War')
            exit()
print('War')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
[n,m,x,y]=[int(i) for i in input().split()]
x1 = []
y1 = []
for i in input().split():
    x1.append(int(i))
for i in input().split():
    y1.append(int(i))

a = 0
b = max(x1)
c = min(y1)
if c - b > 0:
    for i in range(b,c+1):
        if (i > x and i <= y):
            a = a + 1
else:
    print("War")
    a = -1

if a >= 1:
    print("No War")
elif a == 0:
    print("War")

Submission status: Wrong Answer

Solution code:
def getinputdata():

    array_result = []    
    array_result.append(input().split(" "))

    flg = True

    try:
        while flg:

            data = input()

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = True

            else:

                flg = False
    finally:

        return array_result

arr_data = getinputdata()

n=int(arr_data[0][0])
m=int(arr_data[0][1])
x=int(arr_data[0][2])
y=int(arr_data[0][3])

arr_x=list(map(int, arr_data[1]))
arr_y=list(map(int, arr_data[2]))
max_x=max(arr_x)
min_y=min(arr_y)

print("No War" if x<max_x and min_y<y and max_x<=min_y else "War")

Submission status: Wrong Answer

Solution code:
N, M, _, _ = [int(inp) for inp in input().split(' ')]
X = [float(inp) for inp in input().split(' ')]
Y = [float(inp) for inp in input().split(' ')]
 
max_x = max(X)
min_y = min(Y)
 
if min_y < max_x:
    print('War')
else:
    is_nowar = False
    for z in range(-100, 100+1):
        if z > max_x and z <= min_y:
            is_nowar = True
 
    if is_nowar:
        print('No War')
    else:
        print('War')

Submission status: Wrong Answer

Solution code:
N, M, _, _ = [int(inp) for inp in input().split(' ')]
X = [float(inp) for inp in input().split(' ')]
Y = [float(inp) for inp in input().split(' ')]

max_x = max(X)
min_y = min(Y)

if min_y <= max_x:
    print('War')
else:
    is_nowar = False
    for z in range(-100, 100+1):
        if z > max_x and z <= min_y:
            is_nowar = True

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

Submission status: Wrong Answer

Solution code:
N, M, _, _ = [int(inp) for inp in input().split(' ')]
X = [float(inp) for inp in input().split(' ')]
Y = [float(inp) for inp in input().split(' ')]

is_war = False
for z in range(-100, 100+1):
    for xi in X:
        if xi >= z:
            is_war = True
    for yi in Y:
        if yi < z:
            is_war = True

if max(X) >= min(Y):
    is_war = True

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

Submission status: Wrong Answer

Solution code:
N, M, _, _ = [int(inp) for inp in input().split(' ')]
X = [float(inp) for inp in input().split(' ')]
Y = [float(inp) for inp in input().split(' ')]

is_war = False
for z in range(-100, 100+1):
    for xi in X:
        if xi >= z:
            is_war = True
    for yi in Y:
        if yi < z:
            is_war = True

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

Submission status: Wrong Answer

Solution code:
N, M, _, _ = [int(inp) for inp in input().split(' ')]
X = [float(inp) for inp in input().split(' ')]
Y = [float(inp) for inp in input().split(' ')]

is_war = False
for z in range(-100, 100+1):
    for xi in X:
        if xi >= z:
            print('xi {} {}'.format(xi, z))
            is_war = True
    for yi in Y:
        if yi < z:
            print('yi {} {}'.format(yi, z))
            is_war = True

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

Submission status: Wrong Answer

Solution code:
N, M, _, _ = [int(inp) for inp in input().split(' ')]
X = [int(inp) for inp in input().split(' ')]
Y = [int(inp) for inp in input().split(' ')]

is_war = False
for z in range(-100, 100+1):
    for xi in X:
        if xi >= z:
            is_war = True
    for yi in Y:
        if yi < z:
            is_war = True

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

Submission status: Wrong Answer

Solution code:
N, M, _, _ = [int(inp) for inp in input().split(' ')]
X = [int(inp) for inp in input().split(' ')]
Y = [int(inp) for inp in input().split(' ')]

is_war = False
for z in range(-100, 100+1):
    for xi in X:
        if xi > z:
            is_war = True
    for yi in Y:
        if yi < z:
            is_war = True

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
cnds = [int(i) for i in input().split()]

posX = [int(i) for i in input().split()]
posY = [int(i) for i in input().split()]
posX.sort()
posY.sort()

max_x = posX[-1]
min_y = posY[0]
if cnds[2] < cnds[3]:
    if max_x < min_y and cnds[2] < min_y:
        print('No War')
    else:
        print('War')
else:
    print('War')

Submission status: Wrong Answer

Solution code:
cnds = [int(i) for i in input().split()]

posX = [int(i) for i in input().split()]
posY = [int(i) for i in input().split()]
posX.sort()
posY.sort()

max_x = posX[-1]
min_y = posY[0]
if cnds[2] < cnds[3]:
    if max_x < min_y:
        print('No War')
    else:
        print('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()]

xList = [int(x) for x in stdin.readline().rstrip().split()]
yList = [int(x) for x in stdin.readline().rstrip().split()]


isOk = True

xMax = max(xList)
yMin = min(yList)

ret = [int(z) for z in range(xMax+1, yMin+1) if (x < z) and (z <= y)]

if len(ret) > 0:
    print("War")
else:
    print("No War")

Submission status: Wrong Answer

Solution code:
N,M,X,Y = map(int, input().split())
num_list = [list(map(int, input().split())) for _ in range(2)]
 
x_max = max(num_list[0])
y_min = min(num_list[1])
 
if x_max >= y_min:
    print('War')
elif x_max < X or y_min > Y:
    print('War')
else:
    print('No war')

Submission status: Wrong Answer

Solution code:
N,M,X,Y = map(int, input().split())
num_list = [list(map(int, input().split())) for _ in range(2)]

x_max = max(num_list[0])
y_max = max(num_list[1])

if x_max >= y_max:
    print('War')
elif x_max < X or y_max > 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 x<y and max(X)<min(Y) and x<min(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()))

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

Submission status: Wrong Answer

Solution code:
s=list(map(int,input().split()))
x=list(map(int,input().split()))
y=list(map(int,input().split()))
ma, mi = -10000, 10000
for i in range(s[0]-1):
    ma = max(ma, x[i])
for j in range(s[1]-1):
    mi = min(mi, y[j])
ma = max(ma, s[2])
mi = min(mi, s[3])
if (ma < mi):
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
s=list(map(int,input().split()))
x=list(map(int,input().split()))
y=list(map(int,input().split()))
ma, mi = -101, 101
for i in range(s[0]-1):
    ma = max(ma, x[i])
for j in range(s[1]-1):
    mi = min(mi, y[j])
ma = max(ma, s[2])
mi = min(mi, s[3])
if (ma < mi):
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
s=list(map(int,input().split()))
x=list(map(int,input().split()))
y=list(map(int,input().split()))
ma, mi = -100, 100
for i in range(s[0]-1):
    ma = max(ma, x[i])
for j in range(s[1]-1):
    mi = min(mi, y[j])
ma = max(ma, s[2])
mi = min(mi, s[3])
if (ma < mi):
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
s=list(map(int,input().split()))
x=list(map(int,input().split()))
y=list(map(int,input().split()))
ma, mi = -100, 100
for i in range(s[0]-1):
    ma = max(ma, x[i])
for j in range(s[1]-1):
    mi = min(mi, y[j])
if (ma < mi and (ma < s[3] and mi > s[2])):
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
s=list(map(int,input().split()))
x=list(map(int,input().split()))
y=list(map(int,input().split()))
ma, mi = -100, 100
for i in range(s[0]-1):
    ma = max(ma, x[i])
for j in range(s[1]-1):
    mi = min(mi, y[j])
if (ma < mi and (ma < s[3])):
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
s=list(map(int,input().split()))
x=list(map(int,input().split()))
y=list(map(int,input().split()))
ma, mi = -100, 100
for i in range(s[0]-1):
    ma = max(ma, x[i])
for j in range(s[1]-1):
    mi = min(mi, y[j])
if (ma < mi and (ma < s[3] and ((s[2] < mi <= s[3]) or (mi > s[3] and ma < s[3])))):
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
s=list(map(int,input().split()))
x=list(map(int,input().split()))
y=list(map(int,input().split()))
ma, mi = -100, 100
for i in range(s[0]-1):
    ma = max(ma, x[i])
for j in range(s[1]-1):
    mi = min(mi, y[j])
if (ma < mi and ((s[2] < mi <= s[3]) or (mi > s[3] and ma < s[3]))):
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
s=list(map(int,input().split()))
x=list(map(int,input().split()))
y=list(map(int,input().split()))
ma, mi = -100, 100
for i in range(s[0]-1):
    ma = max(ma, x[i])
for j in range(s[1]-1):
    mi = min(mi, y[j])
if (ma < mi):
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
s=list(map(int,input().split()))
x=list(map(int,input().split()))
y=list(map(int,input().split()))
ma, mi = -100, 100
for i in range(s[0]-1):
    ma = max(ma, x[i])
for j in range(s[1]-1):
    mi = min(mi, y[j])
if (ma < mi and (s[2] < mi <= s[3])):
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
s=list(map(int,input().split()))
x=list(map(int,input().split()))
y=list(map(int,input().split()))
ma, mi = 0, 100
for i in range(s[0]-1):
    ma = max(ma, x[i])
for j in range(s[1]-1):
    mi = min(mi, y[j])
if (ma < mi and (s[2] < mi <= s[3])):
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
_, _, X, _ = map(int, input().rstrip().split(' '))
x_list = map(int, input().rstrip().split(' '))
y_list = map(int, input().rstrip().split(' '))

max_x = max(x_list) + 1
min_y = min(y_list)

if max_x <= min_y:
  if 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 = list(map(int, input().split()))
y = list(map(int, input().split()))
last_x = sorted(x)[-1]
farst_y = sorted(y)[0]
if (last_x <= Y) and (X < farst_y) and (last_x < farst_y):
  print("No War")
else:
  print("War")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#AtCorder Beginner Contest 110 B 1 Dimensional World's Tale
N,M,X,Y = input().split()

X = int(X)
Y = int(Y)

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

maxX = max(x)
minY = min(y)

if maxX >= minY:
    print("War")
else:
    for Z in range(maxX+1,minY+1):
        if ( X < Z and Z <= Y ) and ( maxX < Z and minY >=Z ):
            print("No War")
        else:
            print("War")

Submission status: Wrong Answer

Solution code:
#AtCorder Beginner Contest 110 B 1 Dimensional World's Tale
N,M,X,Y = input().split()

X = int(X)
Y = int(Y)

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

maxX = max(x)
minY = min(y)

for Z in range(maxX+1,minY+1):
    if ( X < Z and Z <= Y ) and ( maxX < Z and minY >=Z ):
        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()))
a.append(x)
b = list(map(int,input().split()))
b.append(y)
for i in range(x+1,y+1):
  if max(a) < i <= max(b):
    print("No War")
    break
else:
  print("War")

Submission status: Wrong Answer

Solution code:
N, M, X, Y = (int(i) for i in input().split(' '))
max_x = max((int(i) for i in input().split(' ')))
min_y = min((int(i) for i in input().split(' ')))

if max_x < min_y:
    print('No War')
else:
    print('War')

Submission status: Wrong Answer

Solution code:
N,M,X,Y = map(int,input().split())
Lx = list(map(int,input().split()))
Ly = list(map(int,input().split()))
count = 0
for i in range(X,Y+1):
    if max(Lx) < i <= min(Ly):
        count += 1
if count > 0:
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
N,M,X,Y = map(int,input().split())
Lx = list(map(int,input().split()))
Ly = list(map(int,input().split()))
count = 0
for i in range(X,Y):
    if max(Lx) < i <= min(Ly):
        count += 1
if count > 0:
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
n, m, x, y = map(int,input().split())
xl = list(map(int, input().split()))
xl.append(x)
xl.sort()
yl = list(map(int, input().split()))
yl.append(y)
yl.sort()
print(xl)
print(yl)


if xl[n] < yl[0]:
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

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

if abs(xl[n]) < abs(yl[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_max = max(X)
y_min = min(Y)

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

Submission status: Wrong Answer

Solution code:
n,m,x,y = map(int,input().split())
X = max(list(map(int,input().split())))
Y = min(list(map(int,input().split())))
res = "No War"
for i in range(x+1,y+1):
    if X < i < Y:
        continue 
    else:
        res = "War"
print(res)

Submission status: Wrong Answer

Solution code:
n, m, X, Y = map(int, input().split())
xlist = list(map(int, input().split()))
ylist = list(map(int, input().split()))
xlist.sort()
ylist.sort()
xlist.reverse()

if xlist[0] < ylist[0]:
   for i in range(xlist[0]+1, ylist[0]+1):
      if X < i and i <= Y:
          print("No War")
          break
else:
   print("War")

Submission status: Wrong Answer

Solution code:
n, m, X, Y = map(int, input().split())
xlist = list(map(int, input().split()))
ylist = list(map(int, input().split()))
xlist.sort()
ylist.sort()

if xlist[-1] < ylist[0]:
   for i in range(xlist[-1]+1, ylist[0]+1):
      if X < i and i <= Y:
          print("No War")
          quit()
else:
   print("War")

Submission status: Wrong Answer

Solution code:
n, m, X, Y = map(int, input().split())
xlist = list(map(int, input().split()))
ylist = list(map(int, input().split()))
xlist.sort()
ylist.sort()

if xlist[-1] < ylist[0]:
   for i in range(xlist[-1]+1, ylist[0]):
      if X < i and i <= Y:
          print("No War")
          break
else:
   print("War")

Submission status: Wrong Answer

Solution code:
n, m, X, Y = map(int, input().split())
xlist = list(map(int, input().split()))
ylist = list(map(int, input().split()))
xlist.sort()
ylist.sort()

if xlist[-1] <= ylist[0]:
   for i in range(xlist[-1]+1, ylist[0]+1):
      if X < i and i <= Y:
          print("No War")
          break
else:
   print("War")

Submission status: Wrong Answer

Solution code:
n, m, X, Y = map(int, input().split())
xlist = list(map(int, input().split()))
ylist = list(map(int, input().split()))
xlist.sort()
ylist.sort()

if xlist[-1] < ylist[0]:
   for i in range(xlist[-1]+1, ylist[0]+1):
      if X < i and i <= Y:
          print("No War")
          break
else:
   print("War")

Submission status: Wrong Answer

Solution code:
n, m, X, Y = map(int, input().split())
xlist = list(map(int, input().split()))
ylist = list(map(int, input().split()))
xlist.sort()
ylist.sort()

if xlist[-1] < ylist[0]:
   for i in range(xlist[-1]+1, ylist[0]+1):
      if X < i and i < Y:
          print("No War")
          break
else:
   print("War")

Submission status: Wrong Answer

Solution code:
n, m, X, Y = map(int, input().split())
xlist = list(map(int, input().split()))
ylist = list(map(int, input().split()))
xlist.sort()
ylist.sort()

if xlist[n-1] < ylist[0]:
   if xlist[n-1] > X and ylist[0] <= Y:
      print("No War")
else:
   print("War")

Submission status: Wrong Answer

Solution code:
# coding: utf-8
 
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)
flag = 0
 
if x < y:
    for i in range(x+1, y+1):
        if max(xn) < i and min(ym)>=i:
            print("No War")
            flag = 1
    if flag == 0:
        print("War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
# coding: utf-8
 
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)
flag = 0
 
if x < y:
    for i in range(min(xn), max(ym)+1):
        if max(xn) < i and min(ym)>=i:
            print("No War")
            flag = 1
    if flag == 0:
        print("War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
# coding: utf-8
 
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)
flag = 0
 
if x < y-1:
    for i in range(min(xn), max(ym)+1):
        if max(xn) < i and min(ym)>=i:
            print("No War")
            flag = 1
    if flag == 0:
        print("War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
# coding: utf-8
 
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)
flag = 0
 
if x < y:
    for i in range(x+1, y+1):
        if max(xn) < int(i) and min(ym) >= int(i):
            print("No War")
            flag = 1
    if flag == 0:
        print("War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
# coding: utf-8
 
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)
flag = 0
 
if x < y-1:
    for i in range(x+1, y+1):
        if max(xn) < i and min(ym)>=i:
            print("No War")
            flag = 1
    if flag == 0:
        print("War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
# coding: utf-8
 
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)
flag = 0

if x < y:
    for i in range(x+1, y+1):
        if max(xn) < i and min(ym)>=i:
            print("No War")
            flag = 1
    if flag == 0:
        print("War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
# coding: utf-8
 
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)
flag = 0

if x < y:
    for i in range(x+1, y+1):
        if max(xn) < i and min(ym)>=i:
            print("No War")
            flag = 1
        elif flag == 0 and i == y:
            print("War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
# coding: utf-8
 
n, m, x, y = map(int, input().split())
xn = list(map(int, input().split()))
ym = list(map(int, input().split()))
flag = 0

if x < y:
    for i in range(x+1, y+1):
        if max(xn) < i and x < i and y>=i and min(ym)>=i:
            print("No War")
            flag = 1
        elif flag == 0 and i == y:
            print("War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
# coding: utf-8
 
n, m, x, y = map(int, input().split())
xn = list(map(int, input().split()))
ym = list(map(int, input().split()))
flag = 0

if x < y:
    for i in range(x+1, y+1):
        if max(xn) < i and min(ym)>=i:
            print("No War")
            flag = 1
        elif flag == 0 and i == y:
            print("War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
# coding: utf-8
 
n, m, x, y = map(int, input().split())
xn = list(map(int, input().split()))
ym = list(map(int, input().split()))
flag = 0

if x < y:
    for i in range(x+1, y+1):
        if max(xn) < i and min(ym)>=i:
            print("No War")
            flag = 1
        elif flag == 0 and i == y+1:
            print("War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
# coding: utf-8
 
n, m, x, y = map(int, input().split())
xn = list(map(int, input().split()))
ym = list(map(int, input().split()))
flag = 0

if x < y:
    for i in range(x, y+1):
        if max(xn) < i and min(ym)>=i:
            print("No War")
            flag = 1
        elif flag == 0 and i == y:
            print("War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
# coding: utf-8
 
n, m, x, y = map(int, input().split())
xn = list(map(int, input().split()))
ym = list(map(int, input().split()))
flag = 0

if x < y:
    for i in range(x, y+1):
        if max(xn) < i and min(ym)>=i:
            print("No War")
            flag = 1
        elif flag == 1 and i == y:
            print("War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
# coding: utf-8
 
n, m, x, y = map(int, input().split())
xn = list(map(int, input().split()))
ym = list(map(int, input().split()))

if x < y:
    for i in range(x, y+1):
        if max(xn) < i and min(ym)>=i:
            print("No War")
            break
        elif i == y:
            print("War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
# coding: utf-8
 
n, m, x, y = map(int, input().split())
xn = list(map(int, input().split()))
ym = list(map(int, input().split()))

if x < y:
    for i in range(x, y+1):
        if max(xn) < i and min(ym)>=i:
            print("No War")
            break
        elif i == y:
            print("War")
else:
    print("No War")

Submission status: Wrong Answer

Solution code:
# coding: utf-8
 
n, m, x, y = map(int, input().split())
xn = list(map(int, input().split()))
ym = list(map(int, input().split()))
 
if x < y:
    for i in range(x, y+1):
        if max(xn) < i and min(ym)>=i:
            print("War")
            break
        elif i == y:
            print("No War")
else:
    print("No War")

Submission status: Wrong Answer

Solution code:
# coding: utf-8
 
n, m, x, y = map(int, input().split())
xn = list(map(int, input().split()))
ym = list(map(int, input().split()))
 
if x < y:
    for i in range(x, y+1):
        if max(xn) < i and min(ym)>=i:
            print("No War")
            exit
        elif i == y:
            print("War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
# coding: utf-8
 
n, m, x, y = map(int, input().split())
xn = list(map(int, input().split()))
ym = list(map(int, input().split()))
 
if x < y:
    for i in range(x, y+1):
        if max(xn) < i and min(ym)>=i:
            print("War")
            exit
        elif i == y:
            print("No War")
else:
    print("No War")

Submission status: Wrong Answer

Solution code:
# coding: utf-8
 
n, m, x, y = map(int, input().split())
xn = list(map(int, input().split()))
ym = list(map(int, input().split()))
 
if x < y:
    for i in range(x, y+1):
        if max(xn) < i and min(ym)>=i:
            print("War")
        elif i == y:
            print("No War")
else:
    print("No War")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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