from bisect import bisect_left
n, Q = [int(x) for x in input().split()]
stx = [[int(x) for x in input().split()] for i in range(n)]
q = [int(input()) for i in range(Q)]
stx.sort(key=lambda x: x[2])
ans = [-1 for i in range(Q)]
skip = [-1 for i in range(Q)]

for (s, t, x) in stx:
  begin = bisect_left(q, s-x)
  end = bisect_left(q, t-x)
  while begin<end:
    if skip[begin]==-1:
      ans[begin] = x
      skip[begin] = end
      begin += 1
    else:
      begin = skip[begin]
for e in ans:
  print(e) from bisect import bisect_left int(x) for x in input().split() for x in input().split() x input().split() ().split () input split for x in input().split() int(x) int x n, Q = [int(x) for x in input().split()] n [int(x) for x in input().split()] Q [int(x) for x in input().split()] for i in range(n) for i in range(n) i range(n) range n for i in range(n) [int(x) for x in input().split()] stx = [[int(x) for x in input().split()] for i in range(n)] stx [[int(x) for x in input().split()] for i in range(n)] int(input()) for i in range(Q) for i in range(Q) i range(Q) range Q for i in range(Q) int(input()) int input() input q = [int(input()) for i in range(Q)] q [int(input()) for i in range(Q)] stx.sort(key=lambda x: x[2]) stx.sort stx sort key=lambda x: x[2] key lambda x: x[2] x[2] x 2 x -1 for i in range(Q) for i in range(Q) i range(Q) range Q for i in range(Q) -1 ans = [-1 for i in range(Q)] ans [-1 for i in range(Q)] -1 for i in range(Q) for i in range(Q) i range(Q) range Q for i in range(Q) -1 skip = [-1 for i in range(Q)] skip [-1 for i in range(Q)] for (s, t, x) in stx:
  begin = bisect_left(q, s-x)
  end = bisect_left(q, t-x)
  while begin<end:
    if skip[begin]==-1:
      ans[begin] = x
      skip[begin] = end
      begin += 1
    else:
      begin = skip[begin] (s, t, x) s t x stx begin = bisect_left(q, s-x) begin bisect_left(q, s-x) bisect_left q s-x s x end = bisect_left(q, t-x) end bisect_left(q, t-x) bisect_left q t-x t x while begin<end:
    if skip[begin]==-1:
      ans[begin] = x
      skip[begin] = end
      begin += 1
    else:
      begin = skip[begin] begin<end begin end if skip[begin]==-1:
      ans[begin] = x
      skip[begin] = end
      begin += 1
    else:
      begin = skip[begin] skip[begin]==-1 skip[begin] skip begin -1 ans[begin] = x ans[begin] ans begin x skip[begin] = end skip[begin] skip begin end begin += 1 begin 1 begin = skip[begin] begin skip[begin] skip begin for e in ans:
  print(e) e ans print(e) print e ans = [-1 for i in range(Q)] [-1 for i in range(Q)] ans stx = [[int(x) for x in input().split()] for i in range(n)] [[int(x) for x in input().split()] for i in range(n)] stx q = [int(input()) for i in range(Q)] [int(input()) for i in range(Q)] q skip = [-1 for i in range(Q)] [-1 for i in range(Q)] skip begin = bisect_left(q, s-x) bisect_left(q, s-x) begin begin += 1 1 begin n, Q = [int(x) for x in input().split()] [int(x) for x in input().split()] n Q = [int(x) for x in input().split()] [int(x) for x in input().split()] Q begin = skip[begin] skip[begin] begin end = bisect_left(q, t-x) bisect_left(q, t-x) end
from bisect import bisect_left
n, Q = [int(x) for x in input().split()]
stx = [[int(x) for x in input().split()] for i in range(n)]
q = [int(input()) for i in range(Q)]
stx.sort(key=lambda x: x[2])
ans = [-1 for i in range(Q)]
skip = [-1 for i in range(Q)]

for (s, t, x) in stx:
  begin = bisect_left(q, s-x)
  end = bisect_left(q, t-x)
  while begin<end:
    if skip[begin]==-1:
      ans[begin] = x
      skip[begin] = end
      begin += 1
    else:
      begin = skip[begin]
for e in ans:
  print(e)