N, Q = gets.split.map(&:to_i)
STX = Array.new(N) { gets.split.map(&:to_i) }
D = Array.new(Q) { gets.to_i }
ANS = {}
Q.times {|q|
  STX.each{|s, t, x|
    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
  }
}
Q.times {|q|
  p ANS.include?(D[q].to_s) ? ANS[D[q].to_s] : -1
}