# ?§£??¬?????????
n, t, q = gets.split.map(&:to_i)
a = [] # go east -> 1, west -> -1
n.times do |i|
  l = gets.split.map(&:to_i)
  # [ ??§?¨?Ai, ??±???????????£??¨??????1/-1, Xi??????????????????, (???????????????????????£?????´???)????????§??¢????????? ]
  a << [l[0],  1, false, nil] if l[1] == 1
  a << [l[0], -1, false, nil] if l[1] == 2
end

q.times do
  x = gets.to_i - 1
  a[x][2] = true
end

latest_east = []
a.each_with_index do |c, i|
  if c[1] == 1
    latest_east << i
  else
    next if latest_east.empty?
    # p [latest_east, a[latest_east.last]]
    if a[latest_east.last][3]
      c[3] = a[latest_east.last][3]
    else
      middle = (c[0] + a[latest_east.last][0]) / 2
      latest_east.each { |b| a[b][3] = middle }
      c[3] = a[latest_east.last][3]
      latest_east = [latest_east.last]
    end
  end
end
# p a

a.each_with_index do |c, i|
  c[0] += c[1] * t
  c[0] = [c[0], c[3] || -99999999999999].max if c[1] == -1
  c[0] = [c[0], c[3] || 99999999999999].min if c[1] == 1
end

# p t, a

a.reverse.each_cons(2) do |c, d|
  d[0] = [c[0], d[0]].min
end

a.each do |c|
  puts c[0] if c[2]
end

# 3 5 3
# -4 1
# -2 1
# 6 2
# 1
# 2
# 3