#include <cstdio>
#include <cstdint>
#include <vector>
#include <algorithm>
#include <map>
#include <utility>
#include <string>
#include <deque>
#include <numeric>

template <class Tp, class BinaryOperation1, class BinaryOperation2>
class segment_tree {
public:
  using binary_operation1 = BinaryOperation1;
  using binary_operation2 = BinaryOperation2;
  using value_type = Tp;

private:
  size_t m, h;
  std::vector<value_type> c, d;
  binary_operation1 op1;  // aggregate
  binary_operation2 op2;  // update

  size_t height(size_t n) const {
    return 64 - __builtin_clzll(n);
  }

  void init_aggregate() {
    for (size_t i = m/2; i-- > 1;)
      c[i] = op1(c[i<<1], c[i<<1|1]);
  }

  void calc(size_t p, size_t k) {
    // called in build()
    c[p] = op1(c[p<<1], c[p<<1|1]);
    if (p < m/2) c[p] = op2(c[p], d[p], k);
  }

  void apply(size_t i, Tp x, size_t k) {
    // called in push() and update()
    c[i] = op2(c[i], x, k);
    if (i < m/2) d[i] = op2(d[i], x);
  }

  void build(size_t i) {
    size_t k = 2;
    for (i += m/2; i > 1; k <<= 1) {
      i >>= 1;
      calc(i, k);
    }
  }

  void push(size_t i) {
    i += m/2;
    for (size_t s = h, k = 1 << (h-1); s > 0; --s, k >>= 1) {
      size_t j = i >> s;
      if (d[j] != op2.identity) {
        apply(j<<1|0, d[j], k);
        apply(j<<1|1, d[j], k);
        d[j] = op2.identity;
      }
    }
  }

public:
  segment_tree(size_t n,
               BinaryOperation1 op1 = BinaryOperation1(),
               BinaryOperation2 op2 = BinaryOperation2()):
    m(2*n), h(height(n)), c(m, op1.identity), d(n, op2.identity),
    op1(op1), op2(op2)
  {}

  segment_tree(size_t n, const value_type& e,
               BinaryOperation1 op1 = BinaryOperation1(),
               BinaryOperation2 op2 = BinaryOperation2()):
    m(2*n), h(height(n)), c(m, e), d(n, op2.identity), op1(op1), op2(op2)
  {
    for (size_t i = n; i < m; ++i) c[i] = e;
    init_aggregate();
  }

  template <class ForwardIt>
  segment_tree(ForwardIt first, ForwardIt last,
               BinaryOperation1 op1 = BinaryOperation1(),
               BinaryOperation2 op2 = BinaryOperation2()):
    m(2*std::distance(first, last)), h(height(m/2)), c(m),
    d(m/2, op2.identity), op1(op1), op2(op2)
  {
    static_assert(std::is_same<Tp, typename ForwardIt::value_type>::value, "");
    for (size_t i = m/2; first != last; ++i) c[i] = *first++;
    init_aggregate();
  }

  void update(size_t l, size_t r, Tp x) {
    push(l);
    push(r-1);
    size_t l0 = l;
    size_t r0 = r;
    l += m/2;
    r += m/2;
    size_t k = 1;
    while (l < r) {
      if (l & 1) apply(l++, x, k);
      if (r & 1) apply(--r, x, k);
      l >>= 1;
      r >>= 1;
      k <<= 1;
    }
    build(l0);
    build(r0-1);
  }

  value_type aggregate(size_t l, size_t r) {
    push(l);
    push(r-1);
    value_type resl = op1.identity;
    value_type resr = op1.identity;
    l += m/2;
    r += m/2;
    while (l < r) {
      if (l & 1) resl = op1(resl, c[l++]);
      if (r & 1) resr = op1(c[--r], resr);
      l >>= 1;
      r >>= 1;
    }
    return op1(resl, resr);
  }
};

template <typename Tp>
struct min {
  Tp identity = std::numeric_limits<Tp>::max();
  Tp operator ()(const Tp& x, const Tp& y) { return std::min(x, y); }
  Tp operator ()(const Tp& x, const Tp& y, size_t) { return std::min(x, y); }
};

int main() {
  size_t N, Q;
  scanf("%zu %zu", &N, &Q);

  std::vector<int> S(N), T(N), X(N);
  std::map<int, size_t> enc;
  for (size_t i = 0; i < N; ++i) {
    scanf("%d %d %d", &S[i], &T[i], &X[i]);
    enc[S[i]-X[i]] = enc[T[i]-X[i]];
  }
  std::vector<int> D(Q);
  for (size_t i = 0; i < Q; ++i) {
    scanf("%d", &D[i]);
    enc[D[i]];
  }

  {
    size_t i = 0;
    for (auto& ei: enc) ei.second = i++;
  }

  segment_tree<int, min<int>, min<int>> st(enc.size());
  for (size_t i = 0; i < N; ++i) {
    st.update(enc[S[i]-X[i]], enc[T[i]-X[i]], X[i]);
  }
  for (size_t i = 0; i < Q; ++i) {
    int tmp = st.aggregate(enc[D[i]], enc[D[i]]+1);
    if (tmp == std::numeric_limits<int>::max()) {
      puts("-1");
    } else {
      printf("%d\n", tmp);
    }
  }
}


Measured memory_bytes: 48896