#include <iostream>
#include <cmath>
#include <vector>
#include <string>
#include <map>
#include <algorithm>
#include <numeric>
#include <fstream>
#include <iomanip>

typedef long long ll;
const ll INF = (ll)1e18+1;

// Output
template<class T, class S> std::ostream& operator << (std::ostream& os, std::pair<T, S> p)
{
  return os << p.first << " " << p.second;
}

template<class T> std::ostream& operator << (std::ostream& os, std::vector< T > v)
{
  for (ll i = 0; i < (ll)v.size(); i++){ os << " [" << i << "]" << v[i]; if (i % 10 == 9) os << std::endl; }
  return os;
}

template<class T, class S> std::ostream& operator << (std::ostream& os, std::vector< std::pair<T, S> > vp)
{
  ll i = 0;
  for (auto p : vp){os << " [" << i++ << "]" << p.first << " " << p.second; if (i % 10 == 0) os << std::endl;}
  return os;
}

void print(){ std::cout << std::endl; }
template<typename H> void print(H head) { std::cout << head << std::endl; }
template<typename H, typename... T> void print(H head, T... tail){ std::cout << head << " ", print(tail...); }


class SegmentTree {
public:
  std::vector<ll> vec;
  ll n;

  // 初期化
  SegmentTree(ll n_)
  {
    n = 1;
    while (n < n_) n *= 2;
    vec = std::vector<ll>(2 * n - 1, INF);
  };

  // 通行止めになる場所を取得
  // 止まらない場合は INF を返す
  ll getval(int target)
  {
    target += n - 1;
    ll ret = vec[target];
    while (target > 0) {
      target = (target - 1) / 2;
      ret = std::min(ret, vec[target]);
    }
    return ret;
  }

  // 区間 [a, b) を更新する
  // k は節点の番号で, 区間 [l, r) に対応する
  void update(ll a, ll b, ll v, ll k, ll l, ll r)
  {
    // print("a", a, "b", b, "v", v, "k", k, "l", l, "r", r);
    if (a <= l && r <= b) {
      vec[k] = std::min(vec[k], v);
      //print("update", k, vec[k]);
    } else if (l < b && a < r) {
      ll chl = k * 2 + 1;
      ll chr = k * 2 + 2;
      ll mid = (l + r) / 2;
      update(a, b, v, chl, l, mid);
      update(a, b, v, chr, mid, r);
    }
  }

  void printTree()
  {
    //print(__PRETTY_FUNCTION__);
    print(vec);
  }
};

int main()
{
  ll N, Q;
  std::cin >> N >> Q;

  std::vector<ll> vs(N, 0LL);
  std::vector<ll> vt(N, 0LL);
  std::vector<ll> vx(N, 0LL);
  std::vector<ll> vd(Q, 0LL);

  const ll MAX_NUM = 1 << 20;
  SegmentTree seg(MAX_NUM);

  std::vector<ll> vc;
  vc.push_back(-INF);
  vc.push_back(INF);
  for (ll i = 0; i < N; i++) {
    std::cin >> vs[i] >> vt[i] >> vx[i];
    vc.push_back(vs[i] - vx[i]);
    vc.push_back(vt[i] - vx[i]);
  }
  for (ll i = 0; i < Q; i++) {
    std::cin >> vd[i];
    vc.push_back(vd[i]);
  }

  // 座標圧縮
  // また, ソートしておくことで lower_bound を使うことが出来る
  std::sort(vc.begin(), vc.end());
  vc.erase(std::unique(vc.begin(), vc.end()), vc.end());
  //print("vc", vc);

  for (ll i = 0; i < N; i++) {
    ll a = std::lower_bound(vc.begin(), vc.end(), vs[i] - vx[i]) - vc.begin();
    ll b = std::lower_bound(vc.begin(), vc.end(), vt[i] - vx[i]) - vc.begin();
    seg.update(a, b, vx[i], 0, 0, MAX_NUM);
    //print("a,b", a, b, vx[i]);
    //seg.printTree();
  }

  for (ll i = 0; i < Q; i++) {
    ll x = std::lower_bound(vc.begin(), vc.end(), vd[i]) - vc.begin();
    //print("x", x);
    ll ans = seg.getval(x);
    if (ans == INF) {
      print(-1);
    } else {
      print(ans);
    }
  }

  return 0;
}


Measured memory_bytes: 32620