#include <bits/stdc++.h>
using namespace std;

#ifdef _LOCAL
  #include <debug.hpp>
  #define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
  #define debug(...) 42
#endif

typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vl2;
const bool multiple_queries = false;
#define rep(i, n) for(ll i = 0; i < (n) ; ++i)
#define For(i, a, b) for(ll i = (a); i < (b) ; ++i)
#define revrep(i, n) for(ll i = (n) - 1; i >= 0 ; --i)
#define revFor(i, b, a) for(ll i = (b) - 1; i >= (a) ; --i)
#define all(v) v.begin(), v.end()
#define rall(v) (v).rbegin(), (v).rend()
#define popcount(i) __builtin_popcountl((i))
#define substring(s, start, end) s.substr((start), (end) - (start) + 1)

void print(){}
void println(){cout << endl;}

template <class Head, class... Tail>
void print(Head&& head, Tail&&... tail) {
  cout << head;
  if (sizeof...(tail) != 0) cout << " ";
  print(forward<Tail>(tail)...);
}

template <class T>
void print(vector<T>& vs){
  for (auto v: vs){
    cout << v;
    if (&v != &vs.back()) cout << " ";
  }
  cout << endl;
}

template <class Head, class... Tail>
void println(Head&& head, Tail&&... tail) {
  cout << head;
  if (sizeof...(tail) != 0) cout << " ";
  println(forward<Tail>(tail)...);
}

template <class T>
void println(vector<T>& vs){for (auto v: vs) cout << v << endl;}

struct event{
  ll loc, val; bool del;
  bool operator<(const event& e) const{
    if (loc == e.loc) return !del;
    return loc < e.loc;
  }
  bool operator>(const event& e) const{
    if (loc == e.loc) return del;
    return loc > e.loc;
  }
  tuple<ll, ll, bool> get_value(){return make_tuple(loc, val, del);}
};
string to_string(event e){return "{" + to_string(e.loc) + ", " + to_string(e.val) + ", " + to_string(e.del) + "}";}

struct EventSort{
  multiset<ll> vals;
  priority_queue<event, vector<event>, greater<event>> events;

  void add_event(ll loc, ll val, bool del){events.push({loc, val, del});}
  void update(function<void(ll)> action){
    event e = events.top();
    events.pop();
    ll x, v; bool del;
    tie(x, v, del) = e.get_value();
    action(x);
    if (del) vals.erase(vals.find(v));
    else vals.insert(v);
  }
  void start(function<void(ll)> action){
    while (!events.empty()) update(action);
  };
};

void solve(){
  ll n, Q, cur = 0;
  cin >> n >> Q;
  EventSort es;
  rep(i, n){
    ll x, s, t;
    cin >> s >> t >> x;
    es.add_event(s - x ,x, false);
    es.add_event(t - x ,x, true);
  }

  vl ans(Q, -1), ds(Q);
  rep(i, Q) cin >> ds[i];
  auto action = [&](ll x){
    ll d = es.vals.empty() ? -1 : *es.vals.begin();
    while (cur < Q && ds[cur] < x) ans[cur++] = d;
  };
  es.start(action);
  println(ans);
}

void test(ll num = 0, bool verbose = false){
  rep(i, max(1LL, num)){
    ll t = clock();
    if (verbose) cout << "\n#####" << " " << i + 1 << " " << "#####" << " " << "\n## Answer ##\n";
    solve();
    if (verbose) {cout << "\nElapsed Time:" << " " << 1000.0 * (clock() - t) / CLOCKS_PER_SEC << " " << "[ms]" << endl;}
  }
}

int main(void){
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  #ifdef _LOCAL
    test(6, true);
  #else
    ll t = 0;
    if (multiple_queries) cin >> t;
    test(t, false);
  #endif
  return 0;
}

Measured memory_bytes: 25148