while line=gets
  hit = 0
  blow = 0
  cs = []
  as = line.chomp.split(' ').map(&:to_i)
  bs = readline.chomp.split(' ').map(&:to_i)
  if as[0] == bs[0]
    hit += 1 
  else
    cs << as[0]
  end
  if as[1] == bs[1]
    hit += 1 
  else
    cs << as[1]
  end
  if as[2] == bs[2]
    hit += 1 
  else
    cs << as[2]
  end
  if as[3] == bs[3]
    hit += 1 
  else
    cs << as[3]
  end
  cs.each do |c|
    blow += 1 if bs.include?(c)
  end
  puts "#{hit} #{blow}"
end