n = $stdin.gets.chomp.to_i
a = gets.chomp.split(' ').map(&:to_i)
q = $stdin.gets.chomp.to_i
b = Array.new(q);c = Array.new(q)
q.times do |i|
  b[i], c[i] = (gets.chomp.split(' ').map(&:to_i))
end

hash = Hash.new(0)
a.each do |k|
 hash[k] += 1
end
p hash
ans = 0
q.times do |j|
  if hash.has_key?(b[j])
   #   hash(c[j]) += hash.fetch(b[j])
  end
  p hash
end

