#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <chrono>
#define _USE_MATH_DEFINES
#include <cmath>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iostream>
#include <iterator>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
using namespace std;

#define FOR(i,m,n) for(int i=(m);i<(n);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()

const int INF = 0x3f3f3f3f;
const long long LINF = 0x3f3f3f3f3f3f3f3fLL;
const double EPS = 1e-8;
const int MOD = 1000000007; // 998244353;
const int dy[] = {1, 0, -1, 0}, dx[] = {0, -1, 0, 1};
/*-------------------------------------------------*/
template <typename Monoid>
struct RSQandRUQ {
  RSQandRUQ(int sz, const Monoid &UNITY = 0) : UNITY(UNITY) {
    init(sz);
    dat.assign((n << 1) - 1, UNITY);
  }

  RSQandRUQ(const vector<Monoid> &a, const Monoid &UNITY = 0) : UNITY(UNITY) {
    int a_sz = a.size();
    init(a_sz);
    dat.resize((n << 1) - 1);
    REP(i, a_sz) dat[n - 1 + i] = a[i];
    for (int i = n - 2; i >= 0; --i) dat[i] = dat[(i << 1) + 1] + dat[(i << 1) + 2];
  }

  void update(int a, int b, Monoid value) { update(a, b, value, 0, 0, n); }

  Monoid sum(int a, int b) { return sum(a, b, 0, 0, n); }

  int find(int a, int b, Monoid value) { return find(a, b, value, 0, 0, n); }

private:
  int n = 1;
  const Monoid UNITY;
  vector<Monoid> dat, lazy;
  vector<bool> need_to_be_eval;

  void init(int sz) {
    while (n < sz) n <<= 1;
    lazy.assign((n << 1) - 1, UNITY);
    need_to_be_eval.assign((n << 1) - 1, false);
  }

  inline void evaluate(int node, int left, int right) {
    if (need_to_be_eval[node]) {
      dat[node] = (right - left) * lazy[node];
      if (node < n - 1) {
        lazy[(node << 1) + 1] = lazy[(node << 1) + 2] = lazy[node];
        need_to_be_eval[(node << 1) + 1] = need_to_be_eval[(node << 1) + 2] = true;
      }
      lazy[node] = UNITY;
      need_to_be_eval[node] = false;
    }
  }

  void update(int a, int b, Monoid value, int node, int left, int right) {
    evaluate(node, left, right);
    if (right <= a || b <= left) return;
    if (a <= left && right <= b) {
      lazy[node] = value;
      need_to_be_eval[node] = true;
      evaluate(node, left, right);
    } else {
      update(a, b, value, (node << 1) + 1, left, (left + right) >> 1);
      update(a, b, value, (node << 1) + 2, (left + right) >> 1, right);
      dat[node] = dat[(node << 1) + 1] + dat[(node << 1) + 2];
    }
  }

  Monoid sum(int a, int b, int node, int left, int right) {
    evaluate(node, left, right);
    if (right <= a || b <= left) return UNITY;
    if (a <= left && right <= b) return dat[node];
    return sum(a, b, (node << 1) + 1, left, (left + right) >> 1) + sum(a, b, (node << 1) + 2, (left + right) >> 1, right);
  }

  int find(int a, int b, Monoid value, int node, int left, int right) {
    evaluate(node, left, right);
    if (dat[node] < value || right <= a || b <= left) return -1;
    if (right - left == 1) return node - (n - 1);
    int res_l = find(a, b, value, (node << 1) + 1, left, (left + right) >> 1);
    if (res_l != -1) return res_l;
    return find(a, b, value, (node << 1) + 2, (left + right) >> 1, right);
  }
};

int main() {
  cin.tie(0); ios::sync_with_stdio(false);
  // freopen("input.txt", "r", stdin);

  int n, q; cin >> n >> q;
  vector<int> press;
  vector<pair<int, pair<int, int> > > xst(n);
  REP(i, n) {
    int s, t, x; cin >> s >> t >> x;
    press.emplace_back(s);
    press.emplace_back(t);
    xst[i] = {x, {s, t}};
  }
  sort(ALL(xst));
  vector<int> d(q);
  REP(i, q) {
    cin >> d[i];
    press.emplace_back(d[i]);
  }
  sort(ALL(press));
  press.erase(unique(ALL(press)), press.end());
  RSQandRUQ<int> rsq(press.size());
  for (int i = n - 1; i >= 0; --i) {
    int s = xst[i].second.first, t = xst[i].second.second, x = xst[i].first;
    int l = s - x, r = t - x;
    l = lower_bound(ALL(press), l) - press.begin();
    r = lower_bound(ALL(press), r) - press.begin();
    rsq.update(l, r, x);
  }
  REP(i, q) {
    d[i] = lower_bound(ALL(press), d[i]) - press.begin();
    int ans = rsq.sum(d[i], d[i] + 1);
    cout << (ans == 0 ? -1 : ans) << '\n';
  }
  return 0;
}


Measured memory_bytes: 25452