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 << [s-x, t-x, x]
end


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

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

$stderr.puts BLOCKER.inspect

GUARD = 1<<32

D.each do |d|
  first_cand_idx = BLOCKER.bsearch_index do |b|
    b[0]<=d
  end
  $stderr.printf("first_cand_idx=%s\n", first_cand_idx.inspect)

  x = GUARD
  first_cand_idx and (first_cand_idx...(BLOCKER.length)).each do |i|
    b = BLOCKER[i]
    if not (b[0]<=d) then
      break
    end
    if d < b[1]
      if x > b[2]
	x = b[2]
      end
    end
  end

  if x==GUARD
    puts -1
  else
    puts x
  end
=begin linear search
  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 linear search
end
