loop do
	line = gets
	if !line then
		break
	end
	a = line.split.map{|v| v.to_i}
	b = gets.split.map{|v| v.to_i}

	hit = 0
	brow = 0

	4.times do |i|
		if a[i] == b[i]
			hit += 1
		elsif a.index(b[i])
			brow += 1
		end
	end

	puts "#{hit} #{brow}"
end