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 - x)...(t - x)).include?(D[q])
    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
  # puts "q = #{D[q]} now #{(STX[i][0] - x)..(STX[i][1] - x)}"
  i += 1 if ((STX[i][0])...(STX[i][1])).include?(D[q] + x)
  break if i == N
}
Q.times {|q|
  p ANS.include?(D[q].to_s) ? ANS[D[q].to_s] : -1
}