qyliang/CodeNanoFix huggingface dataset:
Buggy code:
N,M,X,Y = map(int,input().split())
x = list(map(int,input().split()))
y = list(map(int,input().split()))

if(max(x)+1 < min(y)):
    print('No War')
else:
    print('War')

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

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

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

Fixed 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("No War")
else:
    print("War")
Buggy code:
N,M,X,Y = map(int, input().split())
xar = list(map(int, input().split()))
yar = list(map(int, input().split()))

if max(xar) <= min(yar):
    print('War')
    exit()


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





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

if max(xar) >= min(yar):
    print('War')
    exit()


for i in range(max(xar)+1,min(yar)+1):
    if i > X and i <= Y:
        print('No War')
        exit()
else:
    print('War')
Buggy code:
import sys

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

Fixed code:
import sys

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

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

Fixed code:
a = list(map(int, input().split()))
x = list(map(int, input().split()))
y = list(map(int, input().split()))
if max(a[2], max(x)) < min(a[3], min(y)):
  print('No War')
else:
  print('War')
Buggy code:
# https://atcoder.jp/contests/abc110/tasks/abc110_b

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

x.sort()
y.sort()

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

print("War")


Fixed 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")
Buggy code:
n, m, x, y = map(int, input().split())
a, b = [list(map(int, input().split())) for i in range(2)]

for i in range(x + 1, y + 1):
  if all(j < i for j in a) and all(k >= i for k in b):
    print("No War")
else:
  print("War")

Fixed code:
n, m, x, y = map(int, input().split())
a, b = [list(map(int, input().split())) for i in range(2)]

for i in range(x + 1, y + 1):
  if all(j < i for j in a) and all(k >= i for k in b):
    print("No War")
    break
else:
  print("War")
Buggy code:
n, m, X, Y = map(int, input().split())
x = list( map(int, input().split()))
y = list( map(int, input().split()))

x = max(x)
y = min(y)

flag = True
for z in range(X, Y+1):
    if x < z <= y:
        flag = False
        
if flag:
    print('War')
else:
    print('No War')

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

x = max(x)
y = min(y)

flag = True
for z in range(-100, 100+1):
    if x < z <= y and X < z <= Y:
        flag = False
        
if flag:
    print('War')
else:
    print('No War')
Buggy 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[n-1] < y[0]:
    print('No War')
else:
    print('War')

Fixed code:
n,m,x,y=map(int,input().split())
xx=list(map(int,input().split()))
yy=list(map(int,input().split()))
xx.append(x)
yy.append(y)
xx.sort()
yy.sort()
if xx[-1]<yy[0]:print("No War")
else:print("War")
Buggy code:
# def makelist(n, m):
#     return [[0 for i in range(m)] for j in range(n)]

yes = "War"
no = "No War"

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

if max(x) + 1 <= min(y):
    print(no)
else:
    print(yes)


Fixed code:
# def makelist(n, m):
#     return [[0 for i in range(m)] for j in range(n)]

yes = "War"
no = "No War"

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

if max(x) + 1 <= min(y):
    print(no)
else:
    print(yes)
Buggy 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[n-1] < y[0] and X < y[0] and y < x[n-1]:
    print('No War')
else:
    print('War')

Fixed 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()
print('No War' if x[-1] < y[0] else 'War')
Buggy 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)
result = False
if y_min <= x_max:
    result = True
if x_max >= Y or y_min < X:
    result = True
if result:
    print("War")
else:
    print("No War")


Fixed 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)
result = False
if y_min <= x_max:
    result = True
if x_max >= Y or y_min <= X:
    result = True
if result:
    print("War")
else:
    print("No War")
Buggy code:
N,M,X,Y=map(int,input().split())
ListX = list(map(int, input().split()))
ListY = list(map(int, input().split()))
ListX.sort()
ListX.sort()
threX = max(X,List[N-1])
threY = min(Y,List[0])
Z = threX+1
if threY >= Z:
  print("No War")
else:
  print("War")
  

Fixed code:
N,M,X,Y=map(int,input().split())
ListX = list(map(int, input().split()))
ListY = list(map(int, input().split()))
ListX.sort()
ListY.sort()
threX = max(X,ListX[N-1])
threY = min(Y,ListY[0])
Z = threX+1
if threY >= Z:
  print("No War")
else:
  print("War")
Buggy code:
N, M, X, Y = map(int, input().split())
x = [int(i) for i in input().split()]
y = [int(j) for j in input().split()]
if max(x) < min(y) and max(x) < Y and min(y) > X:
  print('No war')
else:
  print('War')

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

for i in range(len(xList)):
  xList[i] = int(xList[i])
for j in range(len(yList)):
  yList[j] = int(yList[j])

xList.sort()
yList.sort()

if yList[0] - 1 >= xList[len(xList) - 1]:
  index = yList[0] - 1
  while index > xList[len(xList) - 1]:
    if X < index and index <= Y:
      print("No War")
      break
    else:
      index -= 1
    
  print("War")
else:
  print("War")

Fixed code:
N,M,X,Y = map(int, input().split(" "))
xList = input().split(" ")
yList = input().split(" ")

for i in range(len(xList)):
  xList[i] = int(xList[i])
for j in range(len(yList)):
  yList[j] = int(yList[j])

xList.sort()
yList.sort()

if yList[0] > xList[len(xList) - 1] and yList[0] > X and Y > xList[len(xList) - 1]:
  print("No War")
else:
  print("War")
Buggy 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")

Fixed code:
N,M,X,Y=input().split()
X=int(X)
Y=int(Y)
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")
Buggy code:
nmxy=list(map(int,input().split()))
x=list(map(int,input().split()))
y=list(map(int,input().split()))
xm=0
ym=0
if max(x)>nmxy[2]:
    xm=max(x)
else:
    xm=nmxy[2]
if min(y)<nmxy[3]:
    ym=min(y)
else:
    ym=nmxy[3]
if ym<xm:
    print('War')
else:
    print('No War')



Fixed code:
nmxy=list(map(int,input().split()))
x=list(map(int,input().split()))
y=list(map(int,input().split()))
xm=0
ym=0
if max(x)>nmxy[2]:
    xm=max(x)
else:
    xm=nmxy[2]
if min(y)<nmxy[3]:
    ym=min(y)
else:
    ym=nmxy[3]
if ym<=xm:
    print('War')
else:
    print('No War')
Buggy code:
N, M, X, Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))

def war():
 if max([X]+x) < min([Y]+y):
    print('No War')
else:
  print('War')

war()

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

def war():
 if max([X]+x) < min([Y]+y):
    print('No War')
 else:
   print('War')

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

Fixed code:
n,m,X,Y = map(int, input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
#print(X<Y)
#print(min(y)-max(x)>0)
#print((Y>max(x) or X<min(y)))
if X<Y and (min(y)-max(x)>0) and (Y>max(x) and X<min(y)):
    print("No War")
else:
    print("War")
Buggy 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(' ')]
mx = max(xs+[X])
my = min(ys+[Y])
if my >= mx:
    print("No War")
else:
    print("War")


Fixed 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(' ')]
mx = max(xs+[X])
my = min(ys+[Y])
if my > mx:
    print("No War")
else:
    print("War")
Buggy 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 i in range(-100,101):
    if X <= i <= Y and x_max < i and y_min >= i:
        print("No War")
        print(i)
        exit()
print("War")

Fixed 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 i in range(-100,101):
    if X < i <= Y and x_max < i and y_min >= i:
        print("No War")
        exit()
print("War")
Buggy code:
n, m, x, y = map(int, input().split())
xx = [int(i) for i in input().split()]
yy = [int(i) for i in input().split()]
if max(xx) < min(yy):
    print('No War')
else:
    print('War')

Fixed code:
n, m, x, y = map(int, input().split())
xx = [int(i) for i in input().split()]
yy = [int(i) for i in input().split()]

ans = 'No War' if max(max(xx), x) < min(min(yy), y) else 'War'
print(ans)
Buggy code:
n, m, x, y = map(int, input().split())
xx = list(map(int, input().split()))
yy = list(map(int, input().split()))
xx.append(x)
yy.append(y)
if max(xx) > min(yy):
    print('War')
else:
    print('No War')

Fixed code:
n, m, x, y = map(int, input().split())
xx = list(map(int, input().split()))
yy = list(map(int, input().split()))
xx.append(x)
yy.append(y)
if max(xx) >= min(yy):
    print('War')
else:
    print('No War')
Buggy code:
n, m, x, y = map(int,input().split())
lx = list(map(int,input().split()))
ly = list(map(int,input().split()))
lx.append(x)
ly.append(y)
lx_max = max(lx)
ly_min = min(ly)

if lx_max > ly_min:
  print('War')
else:
  print('No War')

Fixed code:
n, m, x, y = map(int,input().split())
lx = list(map(int,input().split()))
ly = list(map(int,input().split()))
lx.append(x)
ly.append(y)
lx_max = max(lx)
ly_min = min(ly)

if lx_max >= ly_min:
  print('War')
else:
  print('No War')
Buggy code:
n, m, x, y = map(int, input().split())
areaX = list(map(int, input().split()))
areaY = list(map(int, input().split()))

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

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

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

Fixed 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")
Buggy 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)

Fixed 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+1, Y+1):
	if max(x) < i and i <= min(y):
		flg = 'No ' + flg
		break
print(flg)
Buggy code:
n, m, x, y = [ int(v) for v in input().split() ]
xmax = sorted([ int(v) for v in input().split() ] + [x])
ymin = sorted([ int(v) for v in input().split() ] + [y])
ans = "War
if xmax < ymin:
  ans = "No War"
print(ans)

Fixed code:
n, m, x, y = [ int(v) for v in input().split() ]
xmax = max(sorted([ int(v) for v in input().split() ] + [x]))
ymin = min(sorted([ int(v) for v in input().split() ] + [y]))
ans = "War"
if xmax < ymin:
  ans = "No War"
print(ans)
Buggy code:
import sys
n, m, x, y = map(int, input().split())
lineA = list(map(int, input().split()))
lineB = list(map(int, input().split()))
maxA = max(lineA)
minB = min(lineB)
print("%d %d"%(maxA, minB))
if maxA >= minB:
    print("War")
else:
    for i in range(x + 1, y):
        print(i)
        if maxA < i and i <= minB:
            print("No War")
            sys.exit(0)
print("War")


Fixed code:
import sys
n, m, x, y = map(int, input().split())
lineA = list(map(int, input().split()))
lineB = list(map(int, input().split()))
maxA = max(lineA)
minB = min(lineB)
if maxA >= minB:
    print("War")
else:
    for i in range(x + 1, y):
        if maxA < i and i <= minB:
            print("No War")
            sys.exit(0)
    print("War")
Buggy code:
from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,datetime
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inp(): return int(input())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())

N,M,X,Y = inpl()
X = max(inpl(),X)
Y = mrin(inpl(),Y)
if X < Y:
    print("No War")
else:
    print("War")


Fixed code:
from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,datetime
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inp(): return int(input())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())

N,M,X,Y = inpl()
X = max(max(inpl()),X)
Y = min(min(inpl()),Y)
if X < Y:
    print("No War")
else:
    print("War")
Buggy code:
import sys
n,m,x,y = map(int, input().split())
lis1 = [int(i) for i in input().split()]
lis2 = [int(i) for i in input().split()]
z = x
while z <= y:
  if max(lis1) < z and min(lis2) >= z:
    print('No War')
    sys.exit()
  else:
    z += 1
print('War')

Fixed code:
import sys
n,m,x,y = map(int, input().split())
lis1 = [int(i) for i in input().split()]
lis2 = [int(i) for i in input().split()]
z = x+1
while z <= y:
  if max(lis1) < z and min(lis2) >= z:
    print('No War')
    sys.exit()
  else:
    z += 1
print('War')
Buggy 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),min(y)+1):
        if max(x) < i <= min(y):
             print("No War")
             exit(1)
print("War")
             


Fixed 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):
        print("No War")
        sys.exit()
print("War")
Buggy 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),min(y)+1):
        if max(x) < i <= min(y):
             print("No War")
             break
print("War")
             


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

Fixed 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")
Buggy 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[n-1]<y[0]:
  print("No War")
else:
  print("War")

Fixed 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[n-1]<Y and X<y[0] and x[n-1]<y[0]:
  print("No War")
else:
  print("War")
Buggy code:
data = [int(s) for s in input().split()]

N = data[0]
M = data[1]
X = data[2]
Y = data[3]

a = [int(i) for i in input().split()]
b = [int(j) for j in input().split()]

am = max(a)

bm = min(b)

x = bm -am

i = 0
        


if am >= bm:
    print("War")

else:
    while x < bm:
        x += i
        if x in range(X,Y):
            print("No War")
            break
        i += 1
        



Fixed code:
data = [int(s) for s in input().split()]

N = data[0]
M = data[1]
X = data[2]
Y = data[3]

a = [int(i) for i in input().split()]
b = [int(j) for j in input().split()]

am = max(a)

bm = min(b)

x = am

i = 0
f = 0

if am >= bm:
    print("War")
    f = 1

else:
    while x < bm:
        
        if x in range(X,Y):
            
            print("No War")
            f = 1
            break
        x += 1


if f == 0:
    print("War")
Buggy code:
n,m,x,y=map(int,input().split())
xn=list(map(int,input().split()))
yn=list(map(int,input().split()))
xn.sort()
yn.sort()
z=yn[0]
if x<z<z and xn[-1]<z and yn[0]>=z:
    print("War")
else:
    print("No War")

Fixed code:
n,m,x,y=map(int,input().split())
xn=list(map(int,input().split()))
yn=list(map(int,input().split()))
xn.sort()
yn.sort()
z=yn[0]
if x<z<y and xn[-1]<z and yn[0]>=z:
    print("No War")
else:
    print("War")
Buggy code:

def main():
    N,M,X,Y = map(int,input().split())

    x_s = list(map(int,input().split()))
    y_s = list(map(int,input().split()))

    x_max = max(x_s)
    y_min = min(y_s)

    ok = False
    for z in range(X+1,Y+1):
        if z < x_max and z >= y_min:
            ok = True
            break
    answer =  "War" if ok else "No War"
    print(answer)





if __name__ == '__main__':
    main()


Fixed code:

def main():
    N,M,X,Y = map(int,input().split())
    x_s = list(map(int,input().split()))
    y_s = list(map(int,input().split()))

    ok = False
    for z in range(X+1,Y+1):
        if z > max(x_s) and z <= min(y_s):
            ok = True
            break

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


if __name__ == '__main__':
    main()
Buggy 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')

Fixed 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('No War')
else:
  print('War')
Buggy code:
n,m,x,y= map(int,input().split())
lix=list(map(int,input().split()))
liy=list(map(int,input().split()))
lix.append(x)
liy.append(y)
lix.sort()
liy.sort()
if lix[n-1] < liy[0]:
  print("No War")
else:
  print("War")

Fixed code:
n,m,x,y= map(int,input().split())
lix=list(map(int,input().split()))
liy=list(map(int,input().split()))
lix.append(x)
liy.append(y)
lix.sort()
liy.sort()
if lix[n] < liy[0]:
  print("No War")
else:
  print("War")
Buggy code:
n,m,x,y = map(int,input().split())
x = [int(j) for j in input().split()]
y = [int(j) for j in input().split()]
if min(y) > max(x):
    print('No War')
else:
    print('War')

Fixed code:
n,m,X,Y = map(int,input().split())
x = [int(j) for j in input().split()]
y = [int(j) for j in input().split()]
x.append(X)
y.append(Y)
if min(y) > max(x):
    print('No War')
else:
    print('War')
Buggy 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")

Fixed 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")
Buggy code:
N, M, X, Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))

zx = list(range(max(x)+1,101))
zy = list(range(-100, min(y)+1))
kanou = set(zx) & set(zy)
if len(kanou) == 0:
    print('War')
else:
    for i in kanou:
        if X < i <= Y:
            print('No War')
            break
    else:
        print(War)


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

zx = list(range(max(x)+1,101))
zy = list(range(-100, min(y)+1))
kanou = set(zx) & set(zy)
if len(kanou) == 0:
    print('War')
else:
    for i in kanou:
        if X < i <= Y:
            print('No War')
            break
    else:
        print('War')
Buggy code:
# max min
n, m, x, y = map(int, input().split())
xs = max(list(map(int, input().split())))
ys = min(list(map(int, input().split())))
print("No War" if xs < ys else "War")


Fixed code:
# max min
n, m, x, y = map(int, input().split())
xs = max(list(map(int, input().split())))
ys = min(list(map(int, input().split())))

print("No War" if xs < ys and x <= xs and ys <= y else "War")
Buggy 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')

Fixed 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] and X<y[0]<=Y:
    print('No War')
else:
    print('War')
Buggy code:
import sys
input = sys.stdin.readline

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

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

for i in range(X + 1, Y + 1):
    if x_max < i and i <= y_min:
        print(i)
        print('No War')
        exit()
print('War')

Fixed code:
import sys
input = sys.stdin.readline

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

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


for i in range(X + 1, Y + 1):
    if x_max < i and i <= y_min:
        print('No War')
        exit()
print('War')