n, t, q = gets.split.map(&:to_i)
a = [] # go east -> 1, west -> -1
n.times do |i|
  l = gets.split.map(&:to_i)
  a << [l[0],  1, false, true, i] if l[1] == 1
  a << [l[0], -1, false, true, i] if l[1] == 2
end
q.times do
  x = gets.to_i - 1
  a[x][2] = true
end

pos = []
(t/2).times do |ti|
  cur = 0
  new_a = []
  while cur < a.size
    c = a[cur]
    unless c[3]
      new_a << c
      cur += 1
      next
    end

    if !new_a.empty? && new_a[-1][0] == c[0] + 2 * c[1]
      new_a[-1][3] = false
    elsif !new_a.empty? && new_a[-1][0] > c[0] + 2 * c[1]
      new_a[-1][0] = new_a[-1][0] - new_a[-1][1]
      new_a[-1][3] = false
    elsif !new_a.empty? && new_a[-1][0] > c[0]
      new_a[-1][0] = c[0]
      new_a[-1][3] = false
    else
      new_a << [c[0] + 2 * c[1], c[1], c[2], c[3], c[4]]
    end
    if c[2]
      new_a[-1][2] = true
      pos[c[4]] = new_a[-1][0]
    end
    cur += 1
  end
  a = new_a
end

if t % 2 == 1
  cur = 0
  new_a = []
  while cur < a.size
    c = a[cur]
    unless c[3]
      cur += 1
      next
    end
    if !new_a.empty? && new_a[-1][0] == c[0] + c[1]
      new_a[-1][3] = false
    else
      new_a << [c[0] + c[1], c[1], c[2], c[3], c[4]]
    end
    if c[2]
      new_a[-1][2] = true
      pos[c[4]] = new_a[-1][0]
    end
    cur += 1
  end
  a = new_a
end

a.each do |c|
  if c[2]
    pos[c[4]] = c[0]
  end
end

pos.each_with_index do |v, i|
  puts [v, pos[i+1] || 999999999999].min if v
end