#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
#define rep(i,s,e) for(int (i) = (s);(i) <= (e);(i)++)
#define all(x) x.begin(),x.end()
struct revran {
  const i64 b, e;
  struct iter {
    i64 i;
    constexpr iter(const i64 i) noexcept: i(i) {}
    void operator++() noexcept { --i; }
    constexpr i64 operator*() const noexcept { return i; }
    constexpr bool operator!=(const iter x) const noexcept { return i != x.i; }
  };
  constexpr revran(const i64 e) noexcept: b(0), e(e) {}
  constexpr revran(const i64 b, const i64 e) noexcept: b(b), e(e) {}
  constexpr iter begin() const noexcept { return iter(e - 1); }
  constexpr iter end() const noexcept { return iter(b - 1); }
};

struct ran {
  const i64 b, e;
  struct iter {
    i64 i;
    constexpr iter(const i64 i) noexcept: i(i) {}
    void operator++() noexcept { ++i; }
    constexpr i64 operator*() const noexcept { return i; }
    constexpr bool operator!=(const iter x) const noexcept { return i != x.i; }
  };
  constexpr ran(const i64 e) noexcept: b(0), e(e) {}
  constexpr ran(const i64 b, const i64 e) noexcept: b(b), e(e) {}
  constexpr iter begin() const noexcept { return iter(b); }
  constexpr iter end() const noexcept { return iter(e); }
  constexpr revran rev() const noexcept { return revran(b, e); }
};

constexpr ran rn0(const i64 e) noexcept { return ran(e); }
constexpr ran rn0(const i64 b, const i64 e) noexcept { return ran(b, e); }
constexpr ran rn1(const i64 e) noexcept { return ran(1, e + 1); }
constexpr ran rn1(const i64 b, const i64 e) noexcept { return ran(b, e + 1); }

template< typename Monoid >
struct SegmentTree
{
 
  int sz;
  vector< Monoid > seg;
 
  const Monoid M1;

  Monoid f(Monoid a, Monoid b) {
    return min(a, b);
  }
 
  SegmentTree(int n, const Monoid &M1): M1(M1)
  {
    sz = 1;
    while(sz < n) sz <<= 1;
    seg.assign(2 * sz, M1);
  }
 
  void set(int k, const Monoid &x)
  {
    seg[k + sz] = x;
  }
 
  void build()
  {
    for(int k = sz - 1; k > 0; k--) {
      seg[k] = f(seg[2 * k + 0], seg[2 * k + 1]);
    }
  }
 
  void update(int k, const Monoid &x)
  {
    k += sz;
    seg[k] = x;
    while(k >>= 1) {
      seg[k] = f(seg[2 * k + 0], seg[2 * k + 1]);
    }
  }
 
  Monoid query(int a, int b)
  {
    Monoid L = M1, R = M1;
    for(a += sz, b += sz; a < b; a >>= 1, b >>= 1) {
      if(a & 1) L = f(L, seg[a++]);
      if(b & 1) R = f(seg[--b], R);
    }
    return f(L, R);
  }
 
  Monoid operator[](const int &k) const
  {
    return seg[k + sz];
  }
};


int main() {
  int n,q;
  cin >> n >> q;
  vector<i64> s(n),t(n),x(n);
  for(int i: ran(n)) cin >> s[i] >> t[i] >> x[i];
  vector<i64> d(q);
  SegmentTree<i64> seg(n, 1e18);
  for(int i: ran(q)) cin >> d[i];
  vector<pair<pair<i64, i64>, i64>> vec;
  for(int i: ran(n)) {
    vec.push_back({{s[i] - x[i], 1}, i});
    vec.push_back({{t[i] - x[i], 2}, i});
  }
  for(int i: ran(q)) {
    vec.push_back({{d[i], 3}, 0});
  }
  sort(all(vec));
  for(auto p: vec){
    if(p.first.second == 1) {
      i64 idx = p.second;
      seg.update(idx, x[idx]);
    }
    if(p.first.second == 2) {
      i64 idx = p.second;
      seg.update(idx, 1e18);
    }
    if(p.first.second == 3) {
      i64 xx = seg.query(0, n);
      if(xx == 1e18) 
        cout << -1 << endl;
      else
        cout << xx << endl;
    }
  }
}


Measured memory_bytes: 36328