abs = []

begin
  while line = $stdin.gets.chomp
    break if line == ""
    a = line.split(" ")
    b = $stdin.gets.chomp.split(" ")
    abs.push({:a => a, :b => b})

    ab[:a].each_with_index{|an, i|
      hit  += 1 if ab[:b][i] == an
      blow += 1 if ab[:b].count(an) > 0
    }
    puts "#{hit} #{blow}"
  end
rescue
end