N, Q = gets.chomp.split(" ").map(&:to_i)
T = []
N.times{|i|
  s, t, x = gets.chomp.split(" ").map(&:to_i)
  T << [s - x, x, 's']
  T << [t - x, x, 't']
}
D = []
Q.times{
  D << gets.to_i
}

T.sort!{|a, b| a[0] <=> b[0]}

f = []
while(D.size > 0) do
  if T.size == 0 then
    puts -1
    D.shift
  elsif T[0][0] > D[0] then
    puts f.size == 0 ? -1 : f.min
    D.shift
  elsif T[0][2] == 's' then
    f << T[0][1]
    T.shift
  else
    f.delete(T[0][1])
    T.shift
  end
end
