output_description: Print Q lines. The i-th line should contain the distance the i-th person will
  walk or -1 if that person walks forever.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N Q
      S_1 T_1 X_1
      :
      S_N T_N X_N
      D_1
      :
      D_Q
attempt: class BIT:
      def __init__(self, N):
          self.tree = [0] * (N + 1)  # 1-indexed
          self.N = N
  
      def add(self, i, x):
          """tree[i]と関連個所にxを加える"""
          tree = self.tree
          N = self.N
          while i <= N:
              tree[i] += x
              i += i & (-i)
  
      def sum(self, i):
          tree = self.tree
          s = 0
          while i:
              s += tree[i]
              i -= i & (-i)
          return s
  
      def binary_search(self, x):
          """区間和 >=x となる最小のindex"""
          tree = self.tree
          N = self.N
          i = 0
          step = 1 << (N.bit_length() - 1)
          while step:
              if i + step <= N and tree[i + step] < x:
                  i += step
                  x -= tree[i]
              step >>= 1
          return i + 1
  
  
  def main():
      from collections import deque, namedtuple
      from operator import attrgetter
      import sys
  
      input = sys.stdin.readline
      Event = namedtuple("Event", "time position")
  
      N, Q = map(int, input().split())
  
      go = []
      stop = []
      xs = set()
      for _ in range(N):
          s, t, x = map(int, input().split())
          stop.append(Event(time=s - x, position=x))
          go.append(Event(time=t - x, position=x))
          xs.add(x)
  
      xs = sorted(xs)
  
      stop.sort(key=attrgetter("time"))
      go.sort(key=attrgetter("time"))
  
      stop = deque(stop)
      go = deque(go)
  
      compress = {x: i for i, x in enumerate(xs, 1)}
      decompress = {i: x for i, x in enumerate(xs, 1)}
  
      ans = []
      b = BIT(N)
      for _ in range(Q):
          d = int(input())
          while go and go[0].time <= d:
              e = go.popleft()
              p = compress[e.position]
              b.add(p, -1)
          while stop and stop[0].time <= d:
              e = stop.popleft()
              p = compress[e.position]
              b.add(p, 1)
  
          compressed_ind = b.binary_search(1)
          ind = decompress.get(compressed_ind, -1)
          ans.append(ind)
  
      print(*ans, sep="\n")
  
  
  if __name__ == "__main__":
      main()
  
problem_description: Statement
  
  There is an infinitely long street that runs west to east, which we consider
  as a number line.
  
  There are N roadworks scheduled on this street. The i-th roadwork blocks the
  point at coordinate X_i from time S_i - 0.5 to time T_i - 0.5.
  
  Q people are standing at coordinate 0. The i-th person will start the
  coordinate 0 at time D_i, continue to walk with speed 1 in the positive
  direction and stop walking when reaching a blocked point.
  
  Find the distance each of the Q people will walk.
samples: [{"input": "4 6\n    1 3 2\n    7 13 10\n    18 20 13\n    3 4 2\n    0\n    1\n    2\n    3\n    5\n    8", "output": "2\n    2\n    10\n    -1\n    13\n    -1\n    \n\nThe first person starts coordinate 0 at time 0 and stops walking at coordinate\n2 when reaching a point blocked by the first roadwork at time 2.\n\nThe second person starts coordinate 0 at time 1 and reaches coordinate 2 at\ntime 3. The first roadwork has ended, but the fourth roadwork has begun, so\nthis person also stops walking at coordinate 2.\n\nThe fourth and sixth persons encounter no roadworks while walking, so they\nwalk forever. The output for these cases is -1."}]