N, Q = gets.split.map(&:to_i)
STX = Array.new(N) { 
  gets.split.map(&:to_i)
}.sort_by! {|s, t, x| s }
D = Array.new(Q) { gets.to_i }
i = 0
ANS = {}
Q.times {|q|
  s, t, x = STX[i]
  if (s..t).include?(D[q] + x)
    if !ANS.include?(D[q].to_s)
      ANS[D[q].to_s] = x
    else
      ANS[D[q].to_s] = [ANS[D[q].to_s], x].min
    end
  end
  i += 1 if ((STX[i][0])..(STX[i][1])).include?(D[q] + x)
  break if i == N
}
Q.times {|q|
  p ANS[D[q].to_s] || -1
}