class HitBlow
  def check(a, b)
    hit_target = [a, b].transpose
    hit_target.delete_if { |x, y| x == y }
    hit_count = 4 - hit_target.count
    blow_target = hit_target.transpose
    blow_count = 4 - hit_count - (blow_target[0] - blow_target[1]).count
    [hit_count, blow_count]
  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