while line = gets
  a = line.chomp.split
  b = gets.chomp.split
  hit = 0
  blow = 0
  4.times{|i|
    4.times{|j|
      if a[i] == b[j]
        if i == j
          hit += 1
        else
          blow += 1
        end
      end
    }
  }
  puts "#{hit} #{blow}"
end