while a = gets 
    b = gets
    a = a.split(" ")
    b = b.split(" ")
    hit = 0
    blow = 0
    for i in 0..3 do
        if a[i] == b[i]
            hit += 1
        else
            for j in 0..3 do
                if a[i] == b[j]
                blow += 1
                break
                end
            end
        end
    end
    puts hit.to_s + " " + blow.to_s
end

