class HitBlow
  def check(a, b)
    hits = [a, b].transpose.select { |x, y| x == y }.flatten.uniq
    blows = a & b - hits
    [hits.size, blows.size]
  end
end

inputs = STDIN.read.split("\n")

loop do
  break if inputs.empty?
  a = inputs.shift.split.map(&:to_i)
  b = inputs.shift.split.map(&:to_i)
  result = HitBlow.new.check(a, b)
  printf "%s %s\n", result[0], result[1]
end