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()))
if X>=Y:
    print("War")
    exit()
for Z in range(X,Y):
    if max(x)<=Z<min(y):
        continue
    else:
        print("War")
        exit()
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("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()))	

if max(xl) < min(yl):
    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):
  if min(y) >= X and min(y) < Y:
    ans = "No War"
  elif max(x) > X and max(x) <= Y:
    ans = "No War"
  else:
    ans = "War"
else:
  ans = "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()))

if max(x) <= min(y):
  if min(y) > X and min(y) < Y:
    ans = "No War"
  elif max(x) > X and max(x) <= Y:
    ans = "No War"
  else:
    ans = "War"
else:
  ans = "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()))

if max(x) < min(y):
  if min(y) > X and min(y) < Y:
    ans = "No War"
  elif max(x) > X and max(x) <= Y:
    ans = "No War"
  else:
    ans = "War"
else:
  ans = "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()))

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

if max(x) <= Y:
    a = max(x)
else:
    a = Y

if max(x) > X and max(x) <= Y:
  if min(y) >= a:
    ans = "No War"
  else:
    ans = "War"
else:
  ans = "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()))
if max(x)<min(y):
  print('No War')
else:
  print('War')

Submission status: Wrong Answer

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

N, M, X, Y = MAP()
x = LIST()
y = LIST()

max_x = max(x)
min_y = min(y)

for Z in range(X, Y+1):
	if max_x < Z <= min_y:
		print("No War")
		break
else:
	print("War")

Submission status: Wrong Answer

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

N, M, X, Y = MAP()
x = LIST()
y = LIST()

max_x = max(x)
min_y = min(y)

for Z in range(X, Y+1):
	if max_x <= Z < min_y:
		print("No War")
		break
else:
	print("War")

Submission status: Wrong Answer

Solution code:
N,M,X,Y = map(int,input().split())
xi = sorted(list(map(int,input().split())))
yi = sorted(list(map(int,input().split())))
ans = yi[0]
if(ans>xi[-1] and ans>X):
    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()))

flag = 0

l = list(range(max(x), min(y)+1))

for i in l:
  if X < i and i <= Y:
    flag = 1

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

flag = 0

l = list(range(max(x), min(y)+1))

for i in l:
  if X < i and i <= Y:
    flag = 1
    
if max(x) >= min(y):
  print('War')
elif flag == 0:
  print('War')
else:
  print('No War')

Submission status: Wrong Answer

Solution code:
from sys import stdin
import fractions

n,m,x,y = [int(x) for x in stdin.readline().rstrip().split()]

lx = list(map(int,stdin.readline().rstrip().split()))
ly = list(map(int,stdin.readline().rstrip().split()))

lx.sort()
ly.sort()

if lx[-1]>=ly[0]-1:
    print("War")
    exit()
print("No War")

Submission status: Wrong Answer

Solution code:
from sys import stdin
import fractions

n,m,x,y = [int(x) for x in stdin.readline().rstrip().split()]

lx = list(map(int,stdin.readline().rstrip().split()))
ly = list(map(int,stdin.readline().rstrip().split()))

lx.sort()
ly.sort()

if lx[-1]>=ly[0]:
    print("War")
    exit()
print("No 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()))
xmax = max(x)
ymin = min(y)
if(xmax < ymin and X < ymin and xmax <= 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 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()))
y1=min(Y)
x1=max(X)
if x<y1:
    if x1<y1:
        print('No War')
    else:
        print('War')
else:
    print('War')

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()))
if max(xn) < min(ym) and x != min(ym):
    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(x) for x in input().split()]
if max(x)<min(y):
  print('No War')
else:
  print('War')

Submission status: Wrong Answer

Solution code:
import sys
def input():
    return sys.stdin.readline()[:-1]
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 = max(map(int, input().split()))
y = min(map(int, input().split()))
print("No War"if x <= y and x < Y and X <= y else "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("No War"if x <= y and x < Y and X < y else "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()))
xl.sort()
yl.sort()
if xl[-1] >= yl[0]:
  print('War')
for i in range(xl[-1]+1, yl[0]+1):
  if i>x and i<=y:
    print('No War')
    quit()
print('War')

Submission status: Wrong Answer

Solution code:
import sys

N,M,X,Y=(int(x) for x in input().split())


x=[int(t.strip()) for t in input().split()]
#print(x)

y=[int(t.strip()) for t in input().split()]
#print(y)

x.sort()
y.sort()
#print(x)
#print(y)
#print(x[len(x)-1],y[0])
if y[0] - x[len(x)-1]  >1:
	print("No War")
elif y[0] - x[len(x)-1] == 1:
	if y[0] == X or x[len(x)-1] ==Y:
		print("War")
	else:
		print("No War")
else:
	print("War")

Submission status: Wrong Answer

Solution code:
import sys

N,M,X,Y=(int(x) for x in input().split())


x=[int(t.strip()) for t in input().split()]
#print(x)

y=[int(t.strip()) for t in input().split()]
#print(y)

x.sort()
y.sort()
#print(x)
#print(y)
print(x[len(x)-1],y[0])
if y[0] - x[len(x)-1]  >1:
	print("No War")
elif y[0] - x[len(x)-1] == 1:
	if y[0] == X or x[len(x)-1] ==Y:
		print("War")
	else:
		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()))
flag = 0

Z_max = min(y)
Z_min = max(x)
print(Z_min,Z_max)
Z = X + 1
while Z < Y:
    if Z_min < Z and Z <= Z_max:
        break
    Z += 1

print(Z)
for i in range(N):
    if x[i] >= Z:
        flag = 1
        break

if flag == 0:
    for i in range(M):
        if y[i] < Z:
            flag = 1
            break

if flag == 0:
    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()))
x.append(X)
y.append(Y)
x.sort()
y.sort()

if x[N-1] < y[0]:
    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()))
x.sort()
y.sort()
print(y)

print(x)

flag = True
if x[N-1] < y[0] and X < y[0] and Y > x[N-1]:
    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()))

flag = True
for i in range(X+1,Y+1):
    if len([j for j in x if j >= i]) > 0:
        continue
    if len([j for j in y if j < i]) > 0:
        continue

    print("No War")
    flag = False

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

print('War' if max(XL) > min(YL) \
    or X > min(YL) and Y < max(XL) 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()))

print('War' if max(X) > min(Y) 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()
l=[]
for i in range(X,Y):
  if x[-1]<i and y[0]>=i:
    l.append(i)

if sum(l)!=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.sort()
y.sort()
l=[]
for i in range(X+1,Y):
  if x[-1]<i and y[0]>=i:
    l.append(i)

if sum(l)!=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.sort()
y.sort()
l=[]
for i in range(X+1,Y-1):
  if x[-1]<i and y[0]>=i:
    l.append(i)

if sum(l)!=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()))
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()))
if(max(x) < min(y)-1):
    print("No War")
else:
    print("War")

Submission status: Wrong Answer

Solution code:
# B
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)
ans = "War"
Xmax = max(x)
Ymin = min(y)
# print("X",X)
# print("Y",Y)
# print("Xmax",Xmax)
# print("Ymin",Ymin)
# 1
if Xmax < Ymin:
    ans = "No War"
print("Ans",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()))

max_x = max(x)
max_y = max(y)
min_y = min(y)
#print(max_x)
#print(max_y)
#print(Y-X)

XY_list = []
xy_list = []
for i in range(X+1, Y+1):
    XY_list.append(i)

if max_x   >= min_y:
    print("War")
    exit()

for i in range(max_x +1, min_y+1):
    xy_list.append(i)

#print(XY_list)
#print(xy_list)
set_XY = set(XY_list)
set_xy = set(xy_list)

print("No War" if set_XY and set_xy 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()))

max_x = max(x)
max_y = max(y)
#print(max_x)
#print(max_y)
#print(Y-X)

XY_list = []
xy_list = []
for i in range(X+1, Y+1):
    XY_list.append(i)

if max_x + 1  >= max_y:
    print("War")
    exit()

for i in range(max_x +1, max_y+1):
    xy_list.append(i)

#print(XY_list)
#print(xy_list)
set_XY = set(XY_list)
set_xy = set(xy_list)

print("No War" if set_XY in set_xy 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()))

max_x = max(x)
max_y = max(y)
#print(max_x)
#print(max_y)
#print(Y-X)

XY_list = []
xy_list = []
for i in range(X+1, Y+1):
    XY_list.append(i)

if max_x + 1  >= max_y:
    print("War")
    exit()

for i in range(max_x, max_y+1):
    xy_list.append(i)

#print(XY_list)
#print(xy_list)
set_XY = set(XY_list)
set_xy = set(xy_list)

print("No War" if set_XY in set_xy else "War")

Submission status: Wrong Answer

Solution code:
def main():
    N,M,X,Y = map(int, input().split())
    x_wants=[int(s) for s in input().split()]
    y_wants=[int(s) for s in input().split()]

    x_wants.append(X)
    y_wants.append(Y)
    x_wants = sorted(x_wants)
    y_wants = sorted(y_wants)

    x_max = x_wants[len(x_wants)-1]
    y_min = y_wants[0]

    if((y_min-x_max)<1):
        print('War')
        return
    
    print('No war')

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
def main():
    N,M,X,Y = map(int, input().split())
    x_wants=[int(s) for s in input().split()]
    y_wants=[int(s) for s in input().split()]

    x_wants.append(X)
    y_wants.append(Y)
    x_wants = sorted(x_wants)
    y_wants = sorted(y_wants)

    x_max = x_wants[len(x_wants)-1]
    y_min = y_wants[0]

    if((y_min-x_max)<2):
        print('War')
        return
    
    print('No war')

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
def main():
    N,M,X,Y = map(int, input().split())
    x_wants=[int(s) for s in input().split()]
    y_wants=[int(s) for s in input().split()]

    x_wants.append(X)
    y_wants.append(Y)
    x_wants = sorted(x_wants)
    y_wants = sorted(y_wants)

    x_max = x_wants[len(x_wants)-1]
    y_min = y_wants[0]

    if((y_min-x_max)>2):
        print('War')
        return
    
    print('No war')

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
def main():
    N,M,X,Y = map(int, input().split())
    x_wants=[int(s) for s in input().split()]
    y_wants=[int(s) for s in input().split()]

    x_wants.append(X)
    y_wants.append(Y)
    x_wants = sorted(x_wants)
    y_wants = sorted(y_wants)

    x_max = x_wants[len(x_wants)-1]
    y_min = y_wants[0]

    if(y_min-x_max>2):
        print('War')
        return
    
    print('No war')

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
def main():
    N,M,X,Y = map(int, input().split())
    x_wants=[int(s) for s in input().split()]
    y_wants=[int(s) for s in input().split()]

    x_wants.append(X)
    y_wants.append(Y)
    x_wants = sorted(x_wants)
    y_wants = sorted(y_wants)

    x_max = x_wants[len(x_wants)-1]
    y_min = y_wants[0]

    if(x_max>=y_min):
        print('War')
        return
    
    print('No war')

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
n,m,x,y=map(int,input().split())
xi=[int(_) for _ in input().split()]
yi=[int(_) for _ in input().split()]
print('War' if max(xi) >= min(yi) 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()))
flg = 'War'
for i in range(X, Y+1):
	if max(x) < i and i <= min(y):
		flg = 'No ' + flg
		break
print(flg)

Submission status: Wrong Answer

Solution code:
n, m, x, y = map(int, input().split())
xs = list(map(int, input().split()))
ys = list(map(int, input().split()))
zs = (max(xs), min(ys))
ans = "War"
if zs[0] < zs[1]:
  if x < zs[0] and zs[0] <= y:
    ans = 'No War'
  if x < zs[1] and zs[1] <= y:
    ans = 'No War'
print(ans)

Submission status: Wrong Answer

Solution code:
n, m, x, y = map(int, input().split())
xs = list(map(int, input().split()))
ys = list(map(int, input().split()))
zs = (max(xs), max(ys))
ans = "War"
if zs[0] < zs[1]:
  if x < zs[0] and zs[0] <= y:
    ans = 'No War'
  if x < zs[1] and zs[1] <= y:
    ans = 'No War'
print(ans)

Submission status: Wrong Answer

Solution code:
import sys

input = sys.stdin.readline


def main():
    n, m, X, Y = map(int, input().split())
    x = list(map(int, input().split()))
    y = list(map(int, input().split()))
    war = "War"
    for z in range(X, Y + 1):
        if all([i < z for i in x]) and all([i >= z for i in y]):
            war = "No War"
            break

    print(war)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import sys

input = sys.stdin.readline


def main():
    n, m, X, Y = map(int, input().split())
    x = list(map(int, input().split()))
    y = list(map(int, input().split()))
    war = "No War"
    for z in range(X, Y + 1):
        if X <= z <= Y and all([i < z for i in x]) and all([i >= z for i in y]):
            war = "War"
            break
    print(war)


if __name__ == "__main__":
    main()

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(reverse = True)
y.sort()
print(x[0],y[0])
if x[0]<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()))

max_x = max(x)
min_y = min(y)

print(max_x)
print(min_y)
if max_x < Y and max_x < min_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 = list(map(int, input().split()))
y = list(map(int, input().split()))

max_x = max(x)
min_y = min(y)

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

Submission status: Wrong Answer

Solution code:
import sys
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 <= min(y):
        continue
    else:
        print("war")
        sys.exit()
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())))
if X[-1] < Y[0]:
  print("No War")
else:
  print("War")

Submission status: Wrong Answer

Solution code:
N, M, X, Y =list(map(int,input().split()))
x = [i for i in map(int, input().split())]        
y =[i for i in map(int, input().split())]
x_max =max(x)
y_min =min(y)

cnt = 0

for i in x:
     for j in y:
            for z in range(-99,100):
                if (i < z <= j) and (x_max < z) and (z <= y_min):
                    cnt +=1
                    continue #この辺が怪しい
                else:
                    continue
if cnt > 1:
    print('No War')
else:
    print('War')

Submission status: Wrong Answer

Solution code:
N, M, X, Y =list(map(int,input().split()))
x = [i for i in map(int, input().split())]        
y =[i for i in map(int, input().split())]
x_max =max(x)
y_min =min(y)

cnt = 0

for i in x:
     for j in y:
            for z in range(-100,101):
                if (i < z <= j) and (x_max < z) and (z<=y_min):
                    cnt +=1
                    continue
                else:
                    continue
if cnt > 1:
    print('No War')
else:
    print('War')

Submission status: Wrong Answer

Solution code:
N, M, X, Y =list(map(int,input().split()))
x = [i for i in map(int, input().split())]        
y =[i for i in map(int, input().split())]
x_max =max(x)
y_min =min(y)

cnt = 0

for i in x:
     for j in y:
            for z in range(-100,101):
                if (i < z <= j) and (x_max < z) and (y_min >= z):
                    cnt +=1
                    continue
                else:
                    continue
if cnt > 1:
    print('No War')
else:
    print('War')

Submission status: Wrong Answer

Solution code:
N, M, X, Y =list(map(int,input().split()))
x = [i for i in map(int, input().split())]        
y =[i for i in map(int, input().split())]
x_max =max(x)
y_min =min(y)

cnt = 0

for i in x:
     for j in y:
            for z in range(-100,100):
                if (i < z <= j) and (x_max < z) and (y_min >= z):
                    cnt +=1
                    continue
                else:
                    continue
if cnt > 1:
    print('No War')
else:
    print('War')

Submission status: Wrong Answer

Solution code:
N, M, X, Y =list(map(int,input().split()))
x = [i for i in map(int, input().split())]        
y =[i for i in map(int, input().split())]
x_max =max(x)
y_min =min(y)

cnt = 0

for i in x:
     for j in y:
            for z in range(-100,100):
                if (i <= z <= j) and (x_max < z) and (y_min >= z):
                    cnt +=1
                    #continue
                    exit()
                else:
                    continue
if cnt > 1:
    print('No War')
else:
    print('War')

Submission status: Wrong Answer

Solution code:
N, M, X, Y =list(map(int,input().split()))
x = [i for i in map(int, input().split())]        
y =[i for i in map(int, input().split())]
x_max =max(x)
y_min =min(y)

cnt = 0

for i in x:
     for j in y:
            for z in range(-100,100):
                if (i <= z <= j) and (x_max < z) and (y_min >= z):
                    cnt +=1
                    continue
                else:
                    continue
if cnt > 1:
    print('No War')
else:
    print('War')

Submission status: Wrong Answer

Solution code:
N, M, X, Y =list(map(int,input().split()))
x = [i for i in map(int, input().split())]        
y =[i for i in map(int, input().split())]
x_max =max(x)
y_min =min(y)

cnt = 0

for i in x:
     for j in y:
            for z in range(-100,100):
                if (i <= z <= j) and (x_max < z) and (y_min >= z):
                    cnt +=1
                    break
                else:
                    continue
if cnt > 1:
    print('No War')
else:
    print('War')

Submission status: Wrong Answer

Solution code:
N, M, X, Y =list(map(int,input().split()))
a = [i for i in map(int, input().split())]                   
b = [i for i in map(int, input().split())]

a.sort(reverse = False)
b.sort()

cnt = 0

for x in a:
     for y in b:
            for z in range(-101,101):
                if (x <= z <= y) and (max(a) < z) and (min(b) >= z):
                    cnt +=1
                    break
                else:
                    continue
if cnt > 1:
    print('No War')
else:
    print('War')

Submission status: Wrong Answer

Solution code:
N, M, X, Y =list(map(int,input().split()))
a = [i for i in map(int, input().split())]                   
b = [i for i in map(int, input().split())]

cnt = 0
for x in a:
     for y in b:
            for z in range(-101,101):
                if (x <= z <= y) and (max(a) < z) and (min(b) >= z):
                    cnt +=1
                    break
                else:
                    continue
if cnt > 1:
    print('No War')
else:
    print('War')

Submission status: Wrong Answer

Solution code:
N, M, X, Y =list(map(int,input().split()))
a = [i for i in map(int, input().split())]                   
b = [i for i in map(int, input().split())]

cnt = 0
for x in a:
     for y in b:
            for z in range(-101,101):
                if (x < z < y) and (max(a) < z) and (min(b) >= z):
                    cnt +=1
                    break
                else:
                    continue
if cnt > 1:
    print('No War')
else:
    print('War')

Submission status: Wrong Answer

Solution code:
N, M, X, Y =list(map(int,input().split()))
a = [i for i in map(int, input().split())]                   
b = [i for i in map(int, input().split())]

cnt = 0
for x in a:
     for y in b:
            for z in range(-100,100):
                if (x < z < y) and (max(a) < z) and (min(b) >= z):
                    cnt +=1
                    break
                else:
                    continue
if cnt > 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=map(int,input().split())
x_list=list(map(int,input().split()))
y_list=list(map(int,input().split()))
x_max=max(x_list)
y_min=min(y_list)
print('No War' if x_max<y_min else '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()))
count=0
for i in range(n):
    for s in range(m):
        if x_list[i]<y_list[s]:
            count+=0
        else:
            count+=1
print('war' if count>0 else '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()))
count=0
for i in range(n):
    for s in range(m):
        if x_list[i]<y_list[s]:
            count+=0
        else:
            count+=1
print('War' if count>0 else '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()))
count=0
for i in range(n):
    for s in range(m):
        if x_list[i]+1<y_list[s]:
            count+=0
        else:
            count+=1
print('War' if count>0 else '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()))
count=0
for i in range(n):
    for s in range(m):
        if x_list[i]<y_list[s]+1:
            count+=0
        else:
            count+=1
print('War' if count>0 else '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()))
count=0
for i in range(n):
    for s in range(m):
        if x_list[i]<y_list[s]+1:
            count+=0
        else:
            count+=1
print('War' if count>1 else 'No War')

Submission status: Wrong Answer

Solution code:
ni = lambda: int(input())
nl = lambda: list(map(int, input().split()))
nm = lambda: map(int, input().split())

n, m, x, y = nm()
xmax = max(nl())
ymin = min(nl())

if xmax < ymin:
    print('No War')
else:
    print('War')

Submission status: Wrong Answer

Solution code:
ni = lambda: int(input())
nl = lambda: list(map(int, input().split()))
nm = lambda: map(int, input().split())

n, m, x, y = nm()
xmax = max(nl())
ymin = min(nl())

if xmax < ymin and xmax <= y and ymin > x:
    print('No War')
else:
    print('War')

Submission status: Wrong Answer

Solution code:
N,M,X,Y=map(int,input().split())
xs=list(map(int,input().split()))
ys=list(map(int,input().split()))
def check(xs,ys,z):
    for x in xs:
        if z<=x:
            return
    for y in ys:
        if z>y:
            return 0
    return 1
if min(ys)<=max(xs):
    print("War")
else:
    f=1
    for z in range(max(xs)+1, min(ys)+1):
        if X<z and Y>=z:
            f=0
            print("No War")
    if f:
        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('No War' if X<Y and max(x)<min(y) else '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())
z1=max(x)
z2=min(y)

print('No War' if X<z1<=z2<Y else 'War')

Submission status: Wrong Answer

Solution code:
N,M,X,Y = map(int,input().split())
A = list(map(int,input().split()))
A = sorted(A)
B = list(map(int,input().split()))
B = sorted(B)
if X<Y and A[-1]<B[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()))
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())
ls_x = list(map(int, input().split()))
ls_y = list(map(int, input().split()))

if max(ls_x) <= y and min(ls_y) > x and max(ls_x) < min(ls_y):
    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()))
c = max(a)
d = min(b)
can = []
if c+1 == d:
    can.append(d)
else:
    for i in range(c+1, d+1):
        can.append(i)

if(c < d and ((x+1 in can) or (y in can))):
  print("No War")
else:
  print("War")