# ?§£??¬?????????
# ???????????¨??????????????????????????????????????????(??????????????????)

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 = nil
a.each_with_index do |c, i|
  if c[1] == 1
    latest_east = i
  else
    next unless latest_east
    if a[latest_east] && !a[latest_east][3]
      a[latest_east][3] = (c[0] + a[latest_east][0]) / 2
    end
    c[3] = a[latest_east][3]
  end
end

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

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