N, Q = readline.split(' ').map(&:to_i)
STX = []
N.times do
  STX << readline.split(' ').map(&:to_i)
end

D = []
Q.times do
  D << readline.to_i
end

#$stderr.printf("STX=%s\n", STX.inspect)
#$stderr.printf("D=%s\n", D.inspect)

BLOCKER = []
STX.each do |stx|
  s, t, x = stx
  BLOCKER << [x-t, x-s, x]
end


BLOCKER.sort! do |l, r|
  l[2] <=> r[2]
=begin 
  startcmp = l[0] <=> r[0]
  stopcmp = l[1] <=> r[1]
  xcmp = l[2] <=> r[2]

  if startcmp != 0
    return startcmp
  elsif endcmp != 0
    return endcmp
  else
    return xcmp
  end
=end
end

$stderr.puts BLOCKER.inspect

D.each do |d|
  #$stderr.puts d
  x = -1
  BLOCKER.each do |b|
    if b[0]< -d && -d <= b[1]
      $stderr.printf("%d is blocked by %s\n", d, b.inspect)
      x = b[2]
      break
    end
  end
  puts x
end
