function test(X,Y,cityN,cityM)
    local minN,maxN = X,X
    for i,v in ipairs(cityN) do
        minN = math.min(v,minN)
        maxN = math.max(v,maxN)
    end
    local minM,maxM = Y,Y
    for i,v in ipairs(cityM) do
        minM = math.min(v,minM)
        maxM = math.max(v,maxM)
    end
    print(minN,maxN,minM,maxM)
    if minM>maxN or minN >maxM then
        print("No War")
    else
        print("War")
    end
end

test(X,Y,cityN,cityM)