N, Q = gets.chomp.split(" ").map(&:to_i)
FX = []
N.times{|i|
  s, t, x = gets.chomp.split(" ").map(&:to_i)
  FX<< [s, t, x]
}
D = []
DH = Hash.new
Q.times{
  d = gets.to_i
  D << d
  DH[d] = -1
}

def bin_search(a, i, f)
   l = 0; h = a.size - 1
  return [-1, 0] if a[l] > i
  return [a.size-1, a.size] if a[h] < i
  while(h - l > 1) do
    m = (h - l) / 2 + l
    (a[m] > i) ? h = m : l = m
  end
  return [l-1, l] if a[l] == i && f == '-'
  return [h, h+1] if a[h] == i && f == '+'
  return [l, h]
end

FX.each{|s, t, x|
  ss = s - x; tt = t - x
  ss = 0 if ss < 0
  next if tt < 0

  ds = bin_search(D, ss, '-')[1]; dt = bin_search(D, tt, '-')[0]
  (ds..dt).each{|i| idx = D[i]; DH[idx] = x if (DH[idx] == -1) || (DH[idx] > x)}
}

DH.each{|k, v| puts v }
