# coding : utf-8
#
class HitAndBlow
  def game
    loop do
      line_a = gets
      break if line_a == nil
      line_b = gets
      break if line_b == nil

      array_a = line_a.chomp.split.map {|s| s.to_i}
      array_b = line_b.chomp.split.map {|s| s.to_i}

      cnt_hit = 0
      cnt_blow = 0
      4.times do |i|
        if array_a[i] == array_b[i] then
          cnt_hit += 1
        elsif array_a.include?(array_b[i]) then
          cnt_blow += 1
        end
      end
      puts "#{cnt_hit} #{cnt_blow}"
    end
  end

end

HitAndBlow.new.game