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())
list_x = list(map(float, input().split()))
list_y = list(map(float, input().split()))
if X<Y:
	if max(list_x)<min(list_y) and X<min(list_y):
	  print("No War")
	
	else:
		print("War")
      
    
else:
	if max(list_x)>min(list_y) and Y<min(list_x):
	  print("No War")
    
	else:
	  print("War")

Submission status: Wrong Answer

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

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

for Z in range(X, Y+1):
  if max(x_list) < Z < min(y_list):
    print('No War')
    exit()

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

for Z in range(X, Y+1):
  if max(x_list) < Z <= min(y_list):
    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) 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())
a = list(map(int,input().split()))
b = list(map(int,input().split()))

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

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

if Y-X >=1 and min_y - max_x >= 1 and max_x - Y >= 1 and min_y - X >= 1:
    print('No War')
else:
    print('War')

Submission status: Wrong Answer

Solution code:
_,_,x,y=map(int,input().split())
xl=list(map(int,input().split()))
yl=list(map(int,input().split()))
f=0
for i in range(max(xl),min(yl)):
  if x < i <=y:
    f=1
if f==1:
  print("No War")
else:
  print("War")

Submission status: Wrong Answer

Solution code:
_,_,x,y=map(int,input().split())
xl=list(map(int,input().split()))
yl=list(map(int,input().split()))
if min(yl)<max(xl):
  print("War")
else:
  f=0
  for i in range(max(xl),min(yl)):
    if x < i <=y:
      f=1
  if f==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()))

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

Submission status: Wrong Answer

Solution code:
a,b,c,d= input().split()
w,x,y,z=(int(a),int(b),int(c), int(d))
x_ps_str=input().split()
y_ps_str=input().split()
x_ps = []
y_ps=[]
for i in range(w):
    x_ps.append(int(x_ps_str[i]))
    
for i in range(x):
    y_ps.append(int(y_ps_str[i]))

count =0 
ans_list = []
for i in range(101):
    ans_list.append(i)
    ans_list.append(-1*i)
ans_list.sort()
for i in range(len(ans_list)):
    if y<i and i <= z:
        if max(x_ps) < i and min(y_ps):
            print('No War')
            break
        else:
            count += 1
    else:
        count += 1
if count == 202:
    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())))
if x >= y or x <= Y or X <= y: print("War")
else: print("No 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()))

xmax = max(xlist)
ymin = min(ylist)

checkCount = 0

if xmax >=  ymin:
    print('War')
else:
    for i in range(x, y+1):
        if xmax <= i and ymin > i:
            checkCount += 1
        else:
            checkCount += 0
    if checkCount > 0:
        print('No War')
    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()))

xmax = max(xlist)
ymin = min(ylist)

checkCount = 0

if xmax >=  ymin:
    print('War')
else:
    for i in range(x, y+1):
        if xmax < i and ymin > i:
            checkCount += 1
        else:
            checkCount += 0
    if checkCount > 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()))
Xm = max(X)
Ym = min(Y)
# print(X < Y, Xm < Ym)
print('No War' if X < Y and Xm < Ym else '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()))
Xm = max(X)
Ym = min(Y)
print(X < Y, Xm < Ym)
print('No War' if X < Y and Xm < Ym else '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()))
flg = True
for z in range(100):
  if X < z <= Y:
    for xn in x:
      if xn < z:
        for yn in y:
          if yn < z:
            flg = False 
        if flg:
          print('No War')
          exit()
        else:
          flg = True
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 z in range(100):
  if X < z <= Y:
    for xn in x:
      if xn < z:
        for yn in y:
          if z <= yn:
            print('No War')
            exit()
print('War')

Submission status: Wrong Answer

Solution code:
#ABC-110-B
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("War")
else:
    print("No War")

Submission status: Wrong Answer

Solution code:
#ABC-110-B
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("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 X == min(y) or Y == max(x):
  print('War')
else:
  print('No War')

Submission status: Wrong Answer

Solution code:
n,m,x,y=map(int,input().split())
l_x=sorted(list(map(int,input().split())))
l_y=sorted(list(map(int,input().split())))
print("No War" if  l_y[0] - l_x[-1] >= 2 else "War")

Submission status: Wrong Answer

Solution code:
n,m,x,y=map(int,input().split())
l_x=sorted(list(map(int,input().split())))
l_y=sorted(list(map(int,input().split())))
print("No War" if  l_y[0] - l_x[-1] >= 1 else "War")

Submission status: Wrong Answer

Solution code:
n,m,x,y=map(int,input().split())
l_x=sorted(list(map(int,input().split())))
l_y=sorted(list(map(int,input().split())))
print("War" if  l_y[0] - l_x[-1] >= 1 else "No War")

Submission status: Wrong Answer

Solution code:
n,m,x,y=map(int,input().split())
l_x=sorted(list(map(int,input().split())))
l_y=sorted(list(map(int,input().split())))
print("War" if l_x[-1] >= l_y[0] else "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.sort()
y.sort()
if x[-1] >= y[0] or X>=y[0]:
    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()))
ans = 0 #0 = War, 1= No War

A.sort()
B.sort()
#print(A[-1])
#print(B[0])

for i in range(x+1,y+1):
    if A[-1]<i and B[0]>=i:
        print(i)
        pass
    else:
        ans = 1
        print("ans")

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

Submission status: Wrong Answer

Solution code:
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))
d=""
if max(b)<=min(c):
    for i in range(min(c)-max(b)):
        if a[2]<max(b)+i+1<=a[3]:
            d="No War"
            break
        else:
            d="War"
else:
    d="War"
print(d)

Submission status: Wrong Answer

Solution code:
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))
d=""
if max(b)<=min(c):
    for i in range(min(c)-max(b)):
        if a[2]<max(b)+i+1<=a[3]:
            d="No War"
            break
        else:
            d="War"
else:
    d="War"

Submission status: Wrong Answer

Solution code:
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))
if max(b)<=min(c):
    for i in range(min(c)-max(b)):
        if a[2]<max(b)+i+1<=a[3]:
            print("No War")
            break
        else:
            print("War")
            break
else:
    print("War")

Submission status: Wrong Answer

Solution code:
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))
if max(b)<=min(c):
    for i in range(min(c)-max(b)):
        if a[2]<max(b)+i+1<=a[3]:
            print("No War")
            break
        else:print("War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))
if max(b)<=min(c):
    for i in range(min(c)-max(b)):
        if a[2]<max(b)+i<=a[3]:
            print("No War")
            break
        else:print("War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))
if max(b)<=min(c):
    for i in range(min(c)-max(b)):
        if a[2]<max(b)+i+1<=a[3]:
            print("War")
            break
else:
    print("No War")

Submission status: Wrong Answer

Solution code:
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))
if max(b)<=min(c):
    for i in range(min(c)-max(b)):
        if a[2]<=max(b)+i+1<=a[3]:
            print("War")
else:
    print("No War")

Submission status: Wrong Answer

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

li_x.append(X)
li_y.append(Y)

li_x = set(li_x)
li_y = set(li_y)

if max(li_x)>min(li_y):
    print("War")
elif max(li_x)<min(li_y):
    print("No war")
elif max(li_x)==min(li_y):
    print("War")

Submission status: Wrong Answer

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

x1 = set(li_x)
y1 = set(li_y)

if max(x1)>min(y1):
    print("War")
elif max(x1)<=min(y1):
    print("No war")

Submission status: Wrong Answer

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

x1 = set(li_x)
y1 = set(li_y)

if max(x1)>=min(y1):
    print("War")
elif max(x1)<min(y1):
    print("No 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()))
#s = int(input())

z_min = X+1
z_max = Y

print(z_max)
print(z_min)

if Y-X > 0:
    if z_min <= max(x) and z_max >= min(y) and min(y)-max(x)>0:
       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()))
x_max = max(x)
y_min = min(y)

for z in range(-101, 102):
    if X < z <= Y and x_max <= z and y_min >= z:
        print("No War")
        break
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)

for z in range(-99, 101):
    if X < z <= Y and x_max <= z and y_min >= z:
        print("No War")
        break
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())))
print('No War' if x < y and X < y else 'War')

Submission status: Wrong Answer

Solution code:
a, x, y = [list(map(int, input().split()))for i in range(3)]
if max(a[2], sorted(x)[-1])<min(a[3],sorted(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()))

bool = False
for i in range(x[-1]+1, y[0]+1):
    if X < i <= Y:
        bool = True
        break
        
print('No War' if bool else 'War')

Submission status: Wrong Answer

Solution code:
# B
# 2020/03/27 8:52-
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)

xr = x[-1]
yl = y[0]

if xr <= yl and X < yl and xr <= Y:
    print('No War')
else:
    print('War')

Submission status: Wrong Answer

Solution code:
# B
# 2020/03/27 8:52-
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)

xr = x[-1]
yl = y[0]

if xr <= yl and X <= yl and xr <= Y:
    print('No War')
else:
    print('War')

Submission status: Wrong Answer

Solution code:
# B
# 2020/03/27 8:52-
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)

xr = x[-1]
yl = y[0]

if xr <= yl and X < yl and xr < 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_max = max(x)
y_min = min(y)
if y_min - x_max >= 0:
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
n, m, x, y = map(int, input().split())
s = list(map(int, input().split()))
t = list(map(int, input().split()))
a = max(s)
b = min(t)
c = 0
if a < b:
    for i in range(a, b + 1):
        if x < i <= y:
            c = 1
            break
print("No War" if c == 1 else "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(X, Y+1):
  if max(x) <= z <= min(y):
    print("No War")
    exit()
print("War")

Submission status: Wrong Answer

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

xs = [int(i) for i in input().split()]
ys = [int(i) for i in input().split()]

checker = 0

for i in range(x+1,y+1):
    #print(max(xs),i,min(ys))
    if max(xs) < i and min(ys) >= i:
        checker = 1
if checker:
    print("No war")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
n,m,X,Y=map(int,input().split())
x=sorted(map(int,input().split()))
y=sorted(map(int,input().split()))
if Y-X>=1:
    for i in range(X+1,Y):
        if x[n-1]<i and y[0]>=i:
            print("War")
            exit()
else:
    print("No War")

Submission status: Wrong Answer

Solution code:
n,m,x,y = map(int,input().split())
d = "War"
l_x = sorted(list(map(int,input().split())))[::-1]
l_y = sorted(list(map(int,input().split())))
for i in range(x+1,y+1):
  if l_x[0]<=i and l_y[0]>=i and l_x[0]!=l_y[0]:
    d = "No War"
    break
print(d)

Submission status: Wrong Answer

Solution code:
n,m,x,y = map(int,input().split())
d = "War"
l_x = sorted(list(map(int,input().split())))[::-1]
l_y = sorted(list(map(int,input().split())))
for i in range(x+1,y+1):
  if l_x[0]<=i and l_y[0]>=i:
    d = "No War"
    break
print(d)

Submission status: Wrong Answer

Solution code:
n,m,x,y = map(int,input().split())
d = "War"
l_x = sorted(list(map(int,input().split())))[::-1]
l_y = sorted(list(map(int,input().split())))
for i in range(x,y+1):
  if l_x[0]<=i and l_y[0]>=i:
    d = "No War"
    break
print(d)

Submission status: Wrong Answer

Solution code:
n,m,x,y = map(int,input().split())
d = "war"
l_x = sorted(list(map(int,input().split())))[::-1]
l_y = sorted(list(map(int,input().split())))
for i in range(x,y+1):
  if l_x[0]<=i and l_y[0]>=i:
    d = "No War"
    break
print(d)

Submission status: Wrong Answer

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

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

if (y_min-x_max > 0) and (Y-X > 0) and ((y_min>X) or (x_max<Y)):
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

Solution code:

input()
a=sorted([int(x) for x in input().split()])
b=sorted([int(x) for x in input().split()])
if(a[-1]<b[0]):
    print("No ",end="")
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()))
flg=True
for z in range(X+1,Y+1):
    if min(x)<z and max(y)>=z:
        flg=False
        break
if flg==True:
    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()))
x.append(X)
y.append(Y)
x.sort()
y.sort()
if x[-1] < y[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()))
yl = list(map(int,input().split()))
for i in range(X+1,Y):
  if max(xl) < i and min(yl) >= i:
    print("NoWar")
    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()))
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())
xlst = list(map(int, input().split()))
ylst = list(map(int, input().split()))

xmax = max(xlst)
ymin = min(ylst)
cand = []
for i in range(xmax+1, ymin+1):
    cand.append(i)
print(cand)
    
warflag = True
for c in cand:
    if X < c <= Y:
        warflag = False
if warflag:
    print('War')
else:
    print('No 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())))
if X<x<=y<=Y: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()))
yl=list(map(int,input().split()))
cnt=0
for i in range(x,y+1):
    if max(xl)<i and i<=min(yl):
        cnt+=1
if cnt == 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()))

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

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

Submission status: Wrong Answer

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

flag = False
#for z in range(-100, 101):
for z in range(X + 1, Y + 1):
    count_x = 0
    count_y = 0
    for i in x:
        if i < z:
            count_x += 1
    for i in y:
        if i >= z:
            count_y += 1
    #print(count_x, count_y)
    if count_x == n and count_y == m:
        flag = True
        print(z)
if flag:
    print("No War")
else:
    print("War")

"""
count_x = 0
count_y = 0
ans = 0
for Z in range(-100, 101):
    #Z = 16
    if X <= Z <= Y:
        for i in range(n):
            if x[i] < Z:
                count_x += 1
        for j in range(m):
            if y[j] >= Z:
                count_y += 1
        if count_x == n and count_y == m:
            ans = 1

if ans == 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()))
z='No War' if max(x)<min(y) else 'War'
print(z)

Submission status: Wrong Answer

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

for z in range(1, 101):
    war = False
    if x < z and z <= y:
        for i in range(n):
            for j in range(m):
                if xn[i] >= z or ym[j] < z:
                    war = True
        if war == False:
            print("No War")
            exit()
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()]

c=0
for i in range(X+1,Y+1):
  c =0
  if (i >X and i <=Y) :
    c += 1
  if max(x) < i :
    c += 1
  if min(y) >= i :
    c += 1
  
  if c == 3:
    print(i)
    print("No War")
    exit()
  else:
    continue
    
    
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()]

c=0
for i in range(X+1,Y+1):
  c =0
  if (i >=X and i <=Y) :
    c += 1
  if max(x) < i :
    c += 1
  if min(y) >= i :
    c += 1
  
  if c == 3:
    print(i)
    print("No War")
    exit()
  else:
    continue
    
    
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()]

c=0
for i in range(X+1,Y+1):
  c =0
  if (i >=X and i <=Y) :
    c += 1
  if max(x) <= i :
    c += 1
  if min(y) >= i :
    c += 1
  
  if c == 3:
    print(i)
    print("No War")
    exit()
  else:
    continue
    
    
print("War")

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
N, M, X, Y = map(int, input().split())
x = [int(x) for x in input().split()]
y = [int(x) for x 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())
x_L = list(map(int,input().split()))
y_L = list(map(int,input().split()))

L = []
for i in range(x+1,y+1):
    falg = True
    for j in x_L:
        if j >= i:
            flag = False
            break
    for j in y_L:
        if j < i:
            flag = False
            break
    L.append(flag)

if len(set(L)) == 1 and L[0] == True:
    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())))
ok = False
for z in range(x+1,y+1):
        if x < z and y >= z:
            ok = True
            break
if ok :print("No War")
else:print("War")

Submission status: Wrong Answer

Solution code:
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    flg=0
    n,m,x,y=INTM()
    xs=LIST()
    xs.append(x)
    ys=LIST()
    ys.append(y)
    #print(xs,ys)
    if max(xs)>=min(ys):
        flg=1
    if flg==0:
        print('No war')
    else:
        print('War')
    
    
if __name__ == '__main__':
    do()

Submission status: Wrong Answer

Solution code:
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    flg=0
    n,m,x,y=INTM()
    xs=LIST()
    xs.append(x)
    ys=LIST()
    ys.append(y)
    xs=sorted(xs)
    ys=sorted(ys)
    #print(xs,ys)
    if xs[-1]>=ys[0]:
        flg=1
    if flg==0:
        print('No war')
    else:
        print('War')
    
    
if __name__ == '__main__':
    do()

Submission status: Wrong Answer

Solution code:
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    flg=0
    n,m,x,y=INTM()
    xs=LIST()
    xs.append(x)
    ys=LIST()
    ys.append(y)
    xs=sorted(xs)
    ys=sorted(ys)
    if xs[-1]>=ys[0]:
        flg=1
    if flg==0:
        print('No war')
    else:
        print('War')
    
    
if __name__ == '__main__':
    do()

Submission status: Wrong Answer

Solution code:
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    flg=0
    n,m,x,y=INTM()
    xs=LIST()
    ys=LIST()
    xs=sorted(xs)
    ys=sorted(ys)
    if xs[-1]>=ys[0]:
        flg=1
    if flg==0:
        print('No war')
    else:
        print('War')
    
    
if __name__ == '__main__':
    do()

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()))
ans="War"
z=max(x_list)+1
if z>x and z<=min(y_list):
    ans="No War"
print(ans)

Submission status: Wrong Answer

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

ans = "War"
for z in range(1, max(X, Y)+1):
    if len([i for i in x if i < z]) == len(x) and len([j for j in y if j >= z]) == len(y) and X < z <= Y:
        ans = "No War"
print(ans)

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)
x_.sort()
y_.sort()
if min(y_)>max(x_):
            print('NoWar')
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_.append(x)
y_.append(y)
x_.sort()
y_.sort()
if y_[0]>x_[-1]:
            print('NoWar')
else:
            print('War')

Submission status: Wrong Answer

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

mx = X
my = Y

for i in x:
    if X <= i <= Y:
        if mx < i:
            mx = i
            
for j in y:
    if X <= j <= Y:
        if my > j:
            my = j
            
if mx > my:
    print('War')
else:
    print('No War')

Submission status: Wrong Answer

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

mx = X
my = Y

for i in x:
    if X <= i <= Y:
        if mx < i:
            mx = i
            
for j in y:
    if X <= j <= Y:
        if my > j:
            my = j
            
if mx == my:
    print('War')
else:
    print('No War')

Submission status: Wrong Answer

Solution code:
N,M,X,Y=map(int,input().split())
L=max(list(map(int,input().split())))
T=min(list(map(int,input().split())))
if L+1<=T:
	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 = 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]:
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N, M, X, Y = map(int,input().split())
x = [int(x) for x in input().split()]
y = [int(y) for y in input().split()]
x_max = max(x)
y_min = min(y)
if x_max + 1 < y_min:
    print('No War')
else:
    print('War')

Submission status: Wrong Answer

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