require 'set'

def aux(a, b)
  hit=a.zip(b).select{|x|x[0]==x[1]}.count
  blow= (Set.new(a) & Set.new(b)).count - hit
  [hit,blow]
end

def main
  fh=STDIN
  #fh=File.new("x.txt", "r")
  while fh.gets
    a=$_.chomp.split.map(&:to_i)
    b=fh.gets.chomp.split.map(&:to_i)
    puts aux(a,b).map(&:to_s).join(" ")
  end
end

if $0 == __FILE__ then
  main
end
