Problem:


Score : 200 points

Problem Statement

Our world is one-dimensional, and ruled by two empires called Empire A and Empire B.

The capital of Empire A is located at coordinate X, and that of Empire B is located at coordinate Y.

One day, Empire A becomes inclined to put the cities at coordinates x_1, x_2, ..., x_N under its control, and Empire B becomes inclined to put the cities at coordinates y_1, y_2, ..., y_M under its control.

If there exists an integer Z that satisfies all of the following three conditions, they will come to an agreement, but otherwise war will break out.

X < Z \leq Y

x_1, x_2, ..., x_N < Z

y_1, y_2, ..., y_M \geq Z

Determine if war will break out.

Constraints

All values in input are integers.

1 \leq N, M \leq 100

-100 \leq X < Y \leq 100

-100 \leq x_i, y_i \leq 100

x_1, x_2, ..., x_N \neq X

x_i are all different.

y_1, y_2, ..., y_M \neq Y

y_i are all different.

Input

Input is given from Standard Input in the following format:

N M X Y
x_1 x_2 ... x_N
y_1 y_2 ... y_M

Output

If war will break out, print War; otherwise, print No War.

Sample Input 1

3 2 10 20
8 15 13
16 22

Sample Output 1

No War

The choice Z = 16 satisfies all of the three conditions as follows, thus they will come to an agreement.

X = 10 < 16 \leq 20 = Y

8, 15, 13 < 16

16, 22 \geq 16

Sample Input 2

4 2 -48 -1
-20 -35 -91 -23
-22 66

Sample Output 2

War

Sample Input 3

5 3 6 8
-10 3 1 5 -100
100 6 14

Sample Output 3

War



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


Sample output:
No War

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Feb 11 05:38:56 2019

@author: shinjisu
"""


# ABC 200点問題
import math


def getInt(): return int(input())


def getIntList(): return [int(x) for x in input().split()]


def zeros(n): return [0]*n


def dmp(x):
    global debug
    if debug:
        print(x)


debug = True


def getIntLines(n): return [int(input()) for i in range(n)]


def getIntMat(n):
    mat = []
    for i in range(n):
        mat.append(getIntList())
    return mat


def zeros2(n, m): return [zeros(m)]*n


def prob096():  # Maximum Sum
    X = getIntList()
    K = getInt()
    dmp((X, K))
    total = sum(X) - max(X) + max(X)*2**K
    return total


def prob097():  # Exponential
    X = getInt()
    dmp(X)
    if X == 1:
        return 1
    for n in range(X, 0, -1):
        dmp(n)
        for b in range(2, int(math.sqrt(X))+1):
            a = n
            exp = True
            while a > 1:
                if a % b != 0:
                    exp = False
                    break
                a //= b
            if exp:
                break
        if exp:
            break
    return n


def prob098():  # Cut and Count
    N = getInt()
    S = input()
    dmp((N, S))
    maxChCount = 0
    for i in range(1, N):
        before = S[:i]
        after = S[i:]
        dmp((before, after))
        chCount = 0
        for j in range(26):
            ch = chr(ord('a')+j)
            if ch in before and ch in after:
                chCount += 1
        maxChCount = max(maxChCount, chCount)
    return maxChCount


def prob099():  # Stone Momument
    a, b = getIntList()
    height = 0
    for i in range(b-a+1):
        height += i
    height -= b
    return height


def prob103():  # String Rotation
    S = input()
    T = input()
    for i in range(len(S)):
        S = S[1:] + S[0]
        dmp(S)
        if S == T:
            return 'Yes'
    else:
        return 'No'


def prob110():  # 1 Dimensional World's Tale
    N, M, X, Y = getIntList()
    cX = getIntList()
    cY = getIntList()
    dmp((N, M, X, Y))
    dmp(cX)
    dmp(cY)
    NW = 'No War'
    WA = 'War'
    if Y <= X:
        return WA
    cX.sort()
    cY.sort()
    dmp(cX)
    dmp(cY)
    if cX[-1] < cY[0] and \
            X < cY[0] and \
            cX[-1] < Y:
        return NW
    else:
        return WA


def prob100():  # 
    return 0


debug = False  # True False
print(prob110())

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,m,x,y = map(int,input().split())
xl = list(map(int,input().split()))
yl = list(map(int,input().split()))
lm = list(range(x+1,y+1))
xl.sort(reverse=True)
yl.sort()
ans = "War"

for item in lm:
    if item > xl[0] and item <= yl[0]:
        ans = "No War"
        break
        
print(ans,end='')

Submission status: Accepted

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

xl = list(map(int, input().split()))
yl = list(map(int, input().split()))

if max(xl + [x]) < min(yl + [y]):
    print("No War")
else:
    print("War")

Submission status: Accepted

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

areaX.append(x)
areaY.append(y)

if max(areaX) < min(areaY):
    print("No War")
else:
    print("War")

Submission status: Accepted

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

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

x.sort()
y.sort()

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

print("War")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main() -> None:
    N, M, X, Y = map(int, input().split())
    lx = list(map(int, input().split()))
    ly = list(map(int, input().split()))

    for Z in range(X+1, Y):
        if max(lx) < Z <= min(ly):
            print("No War")
            exit()
        else:
            continue

    print("War")


if __name__ == '__main__':
    main()

Submission status: Accepted

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

li_x = list(map(int, input().split()))
li_y = list(map(int, input().split()))

max_x = max(li_x)
min_y = min(li_y)

# print([z for z in range(x + 1, y + 1)])
# print([zz for zz in range(max_x + 1, min_y + 1)])

if len(set([z for z in range(x + 1, y + 1)]).intersection(set([zz for zz in range(max_x + 1, min_y + 1)]))) > 0:
    print("No War")
else:
    print("War")

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

xs.append(x)
ys.append(y)

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

# exit()

# for i in range(max(xs) + 1, min(ys)):
#     if max(xs) < i and min(ys) >= i:
#         print('No War')
#         exit()

# print('War')

Submission status: Accepted

Solution code:
values1 = raw_input()
values2 = raw_input()
values3 = raw_input()

n,m,X,Y = values1.split(" ")
X = int(X)
Y = int(Y)
x =sorted([int(i) for i in values2.split(" ")]+[X])
y = sorted([int(i) for i in values3.split(" ")]+[Y])

if x[-1]<y[0]:
	print("No War")
else:
	print("War")

Submission status: Accepted

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

Submission status: Accepted

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

X = sorted(X)
Y = sorted(Y)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,m,x,y=map(int,input().split())
n_lst=list(map(int,input().split()))
m_lst=list(map(int,input().split()))
flag=0
n_max=max(n_lst)
m_min=min(m_lst)

for i in range(x+1,y+1):
    if n_max<i<=m_min:
        flag=1
print('No War') if flag==1 else print('War')

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print(result)

Submission status: Accepted

Solution code:
n, m, x, y = map(int, input().split())
xc = list(map(int, input().split()))
yc = list(map(int, input().split()))
xc.append(x)
yc.append(y)
xc.sort(reverse=True)
yc.sort()
if xc[0] < yc[0]:
    print("No War")
else:
    print("War")

Submission status: Accepted

Solution code:
import numpy as np

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

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

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

Submission status: Accepted

Solution code:
# B
N, M, X, Y = map(int, input().split())
x = [int(i) for i in input().split()]
y = [int(i) for i in input().split()]
war = True

for Z in range(X + 1, Y+1):
    if max(x) < Z <= min(y):
        war = False
        break

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

Submission status: Accepted

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

war = True

for Z in range(X + 1, Y + 1):
    if max(x) < Z <= min(y):
        war = False
        break

print("War" if war else "No War")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n,m,XX,YY=[int(i) for i in input().split()]
x=[int(i) for i in input().split()]
y=[int(i) for i in input().split()]
x.sort()
y.sort()
result=False
if x[-1]<=y[0]:
    for i in range(XX+1,YY+1):
        if i>x[-1] and i<=y[0]:
            result=True
if result==True:
    print("No War")
else:
    print("War")

Submission status: Accepted

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

z_kouho = [i for i in range(X+1, Y+1) if max(x) < i <= min(y)]
if z_kouho:
    ans = "No War"
else:
    ans = "War"
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys

def main():
  input = sys.stdin.readline
  N, M, X, Y = map(int, input().split())
  Xi = [X] + list(map(int, input().split()))
  Yi = [Y] + list(map(int, input().split()))
  
  Xi, Yi = sorted(Xi), sorted(Yi)
  if Xi[-1] < Yi[0]:
    print('No War')
  else:
    print('War')


if __name__ == '__main__':
  main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

    def solve(self):
        self.x_s.append(self.x)
        self.x_s.sort()
        self.y_s.append(self.y)
        self.y_s.sort()
        max_x = max(self.x_s)
        min_y = min(self.y_s)

        for z in range(self.x+1, self.y+1):  # z = x+1 .. y
            if (max_x < z) and (min_y >= z):
                print("No War")
                return
        
        print("War")


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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(x+1,y+1):
    cnt = 0
    for j in range(n):
        if xn[j] < i:
            cnt += 1

    for j in range(m):
        if ym[j] >= i:
            cnt += 1
    
    if cnt == n+m:
        print('No War')
        break    
else:
    print('War')

Submission status: Accepted

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

c = []
for i in range(x+1,y+1):
    cnt = 0
    for j in range(n):
        if xn[j] < i:
            cnt += 1

    for j in range(m):
        if ym[j] >= i:
            cnt += 1
    c.append(cnt)
    
if n+m in c:
    print('No War')
else:
    print('War')

Submission status: Accepted

Solution code:
# 2019/02/06
# AtCoder Beginner Contest110 - B

# Input
n, m, x, y = map(int,input().split())
x_list = list(map(int,input().split()))
y_list = list(map(int,input().split()))

x_max = x
y_min = y

# Search max
for i in range(n):
    if x_list[i] > x_max:
        x_max = x_list[i]

# Search min
for i in range(m):
    if y_list[i] < y_min:
        y_min = y_list[i]

if x_max < y_min:
    ans = "No War"
else:
    ans = "War"

# Output
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

xList = [int(x) for x in input().split()]
yList = [int(y) for y in input().split()]
xList.sort()
yList.sort()

if max(xList[-1], X) < min(yList[0], Y):
    print('No War')
else:
    print('War')

Submission status: Accepted

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

from sys import stdin
import numpy as np



N,M, X,Y = map(int, raw_input().split())
x_max = max( map(int, raw_input().split()) )
y_min = min( map(int, raw_input().split()) )

if X <= x_max < y_min <= Y :
    print 'No War'
else:
    print 'War'

Submission status: Accepted

Solution code:
N, M, X, Y = map(int,input().split())
x = list(map(int,input().split()))
y = list(map(int,input().split()))
max_x = max(x)
min_y = min(y)
flag = False
for i in range(X+1,Y+1):
  if (max_x < i <= min_y):
    flag = True
    break
  else:
    flag = False
if flag == True:
  print("No War")
else:
  print("War")

Submission status: Accepted

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

if max(xl) < min(yl):
    print("No War")
else:
    print("War")

Submission status: Accepted

Solution code:
import numpy as np
n, m, x, y = list(map(int, input().split()))
xl = [int(i) for i in input().split()]
yl = [int(i) for i in input().split()]

if x > y:
    print("War")
else:
    zl = np.arange(x+1, y+1)
    for z in zl:
        if (max(xl) < z) & (z <= min(yl)):
            print("No War")
            break
    else:
        print("War")

Submission status: Accepted

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

max_x = max(x)
min_y = min(y)
for i in range(X+1, Y+1):
  if(max_x < i <= min_y):
    print("No War")
    break
else:
  print("War")

Submission status: Accepted

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

flag = False
for i in range(-99, 101):
    if x < i and i <= y:
        for j in x_lst:
            if j < i:
                continue
            else:
                break
        else:
            for k in y_lst:
                if i <= k:
                    continue
                else:
                    break
            else:
                flag = True
                
print('No War') if flag else print('War')

Submission status: Accepted

Solution code:
import sys

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 + 1, y + 1):
    if max(x_list) < z:
        if min(y_list) >= z:
            print("No War")
            sys.exit(0)

print("War")

Submission status: Accepted

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

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

flag = 0
for i in range(x+1,y+1):
    if max(x_li) < i:
        if min(y_li) >= i:
            flag = 1

print(['War','No War'][flag])

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
hoge = [int(i) for i in input().split()]
X = [int(i) for i in input().split()]
Y = [int(i) for i in input().split()]
X.append(hoge[2])
Y.append(hoge[3])
X.sort()
Y.sort()
 

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Z = range(X + 1, Y + 1)

flag = 'War'

for z in Z:
  if x[-1] < z and y[0] >= z:
    flag = 'No War'
    break

print(flag)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

def main():
    [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)
    max_x = max(x)
    min_y = min(y)

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# coding: utf-8

II = lambda: int(input())
MI = lambda: map(int, input().split())


def main():
    N, M, X, Y = MI()
    x = max(MI())
    y = min(MI())
    if not x < Y: return False
    if not X < y: return False
    if not x < y: return False
    return True


if __name__ == "__main__":
    print(["War", "No War"][main()])

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N,M,X,Y=(int(i) for i in input().split())
xlist=[int(i) for i in input().split()]
ylist=[int(i)for i in input().split()]
xmax=max(xlist)
ymin=min(ylist)
if xmax<ymin:
  if xmax<Y and X<ymin:
    print('No War')
  else:
    print('War')
else:
  print('War')

Submission status: Accepted

Solution code:
n,m,X,Y=[int(x) for x in input().split()]
x=[int(x) for x in input().split()]
y=[int(x) for x in input().split()]
zmax=min(Y,min(y))
zmin=max(X+1,max(x)+1)
if zmax<zmin:
    print("War")
else:
    print("No War")

Submission status: Accepted

Solution code:
N,M,X,Y=map(int,input().split())
x=[int(i) for i in input().split()]
y=[int(i) for i in input().split()]
x.append(X)
y.append(Y)
if min(y)-max(x)>0:
    print("No War")
else:
    print("War")

Submission status: Accepted

Solution code:
""" AtCoder """

import sys
input = sys.stdin.readline

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

Submission status: Accepted

Solution code:
def main():
    N, M, X, Y = map(int, input().split())
    x = list(map(int, input().split()))
    y = list(map(int, input().split()))
    for t in range(X + 1, Y + 1):
        if t > max(x) and min(y) >= t:
            print('No War')
            exit()
    print('War')


main()

Submission status: Accepted

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

lix=list(map(int,input().split()))
liy=list(map(int,input().split()))

if (min(liy))>(max(lix)) and max(lix)<y and min(liy)>x :
  print("No War")
else:
  print("War")

Submission status: Accepted

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

if max(X) < min(Y):
    print('No War')
else:
    print('War')

Submission status: Accepted

Solution code:
import numpy as np
import sys

N,M,X,Y=[int(i) for i in input().split()]

x=[int(i) for i in input().split()]
y=[int(i) for i in input().split()]
x.append(X)
y.append(Y)
x.sort()
y.sort()

if(x[N]>=y[0]):
    print("War")
    sys.exit()
print("No War")

Submission status: Accepted

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

if max(xlist) >= min(ylist):
    print('War')
elif min(ylist) <= x or y < min(ylist):
    print('War')
else:
    print('No War')

Submission status: Accepted

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

xmax = max(xn)
ymin = min(yn)

# print('xmax < ymin : {} < {}'.format( xmax, ymin ) )
# print('xmax < y : {} < {}'.format( xmax, y ) )
# print('x < ymin : {} < {}'.format( xmax, y ) )

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

Submission status: Accepted

Solution code:
a,b,c,d=map(int,input().split())
a=list(map(int,input().split()))+[c]
b=list(map(int,input().split()))+[d]
print("No War"if max(a)<min(b)else"War")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N,M,X,Y = (int(i) for i in input().split())
x = [int(i) for i in input().split()]
y = [int(i) for i in input().split()]
ans='War'
for Z in range(-100,101):
    if(X<Z<=Y 
        and all([x[i]<Z for i in range(N)]) 
        and all([y[i]>=Z for i in range(M)])
    ):
        ans ='No War'
        break
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main(x,y,xlst,ylst):
    xlst.append(x)
    ylst.append(y)
    xmax =max(xlst)
    ymin = min(ylst)
    if xmax<ymin:
        print("No War")
    else:
        print("War")
n,m,x,y = map(int,input().split())
xlst = list(map(int,input().split()))
ylst = list(map(int,input().split()))
main(x,y,xlst,ylst)

Submission status: Accepted

Solution code:
xy=[int(i) for i in input().split()]
x=[int(i) for i in input().split()]+[xy[2]]
y=[int(i) for i in input().split()]+[xy[3]]
x.sort()
y.sort()
if x[-1]<y[0]:
    print('No War')
else:
    print('War')

Submission status: Accepted

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

print(["War","No War"][X<min(y) and max(x)<Y and max(x)<min(y)])

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

def main():
    n, m, x, y = map(int, input().split())
    xs = list(map(int, input().split()))
    ys = list(map(int, input().split()))
    xs.append(x)
    ys.append(y)
    if max(xs) < min(ys):
        print("No War")
    else:
        print("War")

main()

Submission status: Accepted

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

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

Submission status: Accepted

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

    max_x = max(list(dx))
    min_y = min(list(dy))

    z = x + 1
    while z <= y:
        if z > max_x and z <= min_y:
            # print("No War", z)
            print("No War")
            exit()
        z += 1
    print("War")


def main2():
    n, m, x, y = map(int, input().split())
    dx = map(int, input().split())
    dy = map(int, input().split())

    dx = list(dx)
    dy = list(dy)

    dx.append(x)
    dy.append(y)

    if max(dx) < min(dy):
        print("No War")
    else:
        print("War")


if __name__ == '__main__':
    main2()

Submission status: Accepted

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

    max_x = max(list(dx))
    min_y = min(list(dy))
    # if x >= y:
    #     print("WAR")
    #     exit()

    z = x + 1
    while z <= y:
        if z > max_x and z <= min_y:
            # print("No War", z)
            print("No War")
            exit()
        z += 1
    print("War")


if __name__ == '__main__':
    main()

Submission status: Accepted

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

    max_x = max(list(dx))
    min_y = min(list(dy))
    if x >= y:
        print("WAR")
        exit()

    z = x + 1
    while z <= y:
        if z > max_x and z <= min_y:
            # print("No War", z)
            print("No War")
            exit()
        z += 1
    print("War")


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

if max(x)<min(y):
    ans = 'No War'
else:
    ans = 'War'

print(ans)