original = gets.chomp
Q, A, B = gets.split.map(&:to_i)
Q.times do
  c, p = gets.chomp.split
  case p
    when "."
      original.gsub!(c, "")
    else
      original.gsub!(c, p)
  end
end

answer = original[A-1, B-A+1]
ok = true
ok = false if answer == 0
ok = false if original.size < B

puts ok ? answer : "."