#include<vector>
#include<unordered_map>
#include<algorithm>
using Size = int;
template<typename T> class Compression {
 public:
  Compression(const std::vector<T>& list) : value_(list) {
    std::sort(begin(value_), end(value_));
    value_.erase(std::unique(begin(value_), end(value_)), end(value_));
    for(Size i = 0; i < value_.size(); ++i) index_[value_[i]] = i;
  }
  Size size() const {return value_.size();}
  Size index(const T& v) const {return index_.at(v);}
  T operator[](const Size i) const {return value_.at(i);}
 private:
  std::unordered_map<T, Size> index_;
  std::vector<T> value_;
};

#include<memory>
using Size = int;
template<typename T> class SegmentTree {
 public:
  SegmentTree(Size SIZE, T INF) : SIZE(SIZE), INF(INF), ROOT(std::make_unique<Node>(0, INF)) {
    ROOT->update = 0;
  }
  void update(Size a, Size b, T v) {update(a, b, v, ROOT, 0, SIZE);}
  void add(Size a, Size b, T v) {add(a, b, v, ROOT, 0, SIZE);}
  T sum(Size a, Size b) {return query(a, b).sum;}
  T min(Size a, Size b) {return query(a, b).min;}
  T max(Size a, Size b) {return query(a, b).max;}
 private:
  struct Node {
    T sum, min, max;
    T update;
    T add;
    std::unique_ptr<Node> l_child, r_child;
    Node(T v, T INF) : sum(v), min(v), max(v), update(INF), add(INF) {}
  };
  inline void push(const auto& n, Size l, Size r) {
    if(not n->l_child) n->l_child = std::make_unique<Node>(0, INF);
    if(not n->r_child) n->r_child = std::make_unique<Node>(0, INF);
    if(n->update != INF) {
      n->add = INF;
      n->l_child->update = n->r_child->update = n->update;
      n->sum = (r - l) * n->update;
      n->min = n->update;
      n->max = n->update;
      n->update = INF;
    }
    if(n->add != INF) {
      if(n->l_child->add != INF) n->l_child->add += n->add;
      else                       n->l_child->add = n->add;
      if(n->r_child->add != INF) n->r_child->add += n->add;
      else                       n->r_child->add = n->add;
      if(n->l_child->update != INF) n->l_child->update += n->add;
      if(n->r_child->update != INF) n->r_child->update += n->add;
      n->sum += (r - l) * n->add;
      n->min += n->add;
      n->max += n->add;
      n->add = INF;
    }
  }
  inline void fix(const auto& n) {
    n->sum = n->l_child->sum + n->r_child->sum;
    n->min = std::min(n->l_child->min, n->r_child->min);
    n->max = std::max(n->l_child->max, n->r_child->max);
  }
  void update(Size a, Size b, T v, const auto& n, Size l, Size r) {
    push(n, l, r);
    if(b <= l || r <= a) return;
    if(a <= l && r <= b) {
      n->update = v;
      push(n, l, r);
      return;
    }
    auto m = (l + r) / 2;
    update(a, b, v, n->l_child, l, m);
    update(a, b, v, n->r_child, m, r);
    fix(n);
  }
  void add(Size a, Size b, T v, const auto& n, Size l, Size r) {
    push(n, l, r);
    if(b <= l || r <= a) return;
    if(a <= l && r <= b) {
      n->add = v;
      push(n, l, r);
      return;
    }
    auto m = (l + r) / 2;
    add(a, b, v, n->l_child, l, m);
    add(a, b, v, n->r_child, m, r);
    fix(n);
  }
  Node query(Size a, Size b) {
    Node res(0, INF);
    res.min = INF;
    res.max = -INF;
    query(res, a, b, ROOT, 0, SIZE);
    return res;
  }
  void query(auto& res, Size a, Size b, const auto& n, Size l, Size r) {
    push(n, l, r);
    if(b <= l || r <= a) return;
    if(a <= l && r <= b) {
      res.sum += n->sum;
      res.min = std::min(res.min, n->min);
      res.max = std::max(res.max, n->max);
      return;
    }
    auto m = (l + r) / 2;
    query(res, a, b, n->l_child, l, m);
    query(res, a, b, n->r_child, m, r);
  }
  Size lower_bound(Size a, Size b, T v, const auto& n, Size l, Size r) {
    push(n, l, r);
    if(b <= l || r <= a) return SIZE;
    if(n->max < v) return SIZE;
    if(l + 1 == r) return l;
    auto m = (l + r) / 2;
    auto i = lower_bound(a, b, v, n->l_child, l, m);
    if(i != SIZE) return i;
    return lower_bound(a, b, v, n->r_child, m, r);
  }
  const Size SIZE;
  const T INF;
  const std::unique_ptr<Node> ROOT;
};

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

int main() {
  int N, Q;
  cin >> N >> Q;

  struct Work {int S, T, X;};
  vector<Work> W(N);
  for(auto& w: W) {
    cin >> w.S >> w.T >> w.X;
    w.S -= w.X;
    w.T -= w.X + 1;
  }

  vector<int> D(Q);
  for(auto& d: D) cin >> d;

  vector<int> point;
  for(auto d: D) point.emplace_back(d);
  for(auto w: W) point.emplace_back(w.S);
  for(auto w: W) point.emplace_back(w.T);
  Compression<int> comp(point);

  sort(begin(W), end(W), [](auto l, auto r) {return l.X > r.X;});

  const int INF = 1e9 + 1;
  SegmentTree<int> segtree(comp.size(), INF);
  segtree.update(0, comp.size(), -1);
  for(auto w: W) segtree.update(comp.index(w.S), comp.index(w.T)+1, w.X);

  for(auto d: D) cout << segtree.sum(comp.index(d), comp.index(d)+1) << endl;
}


Measured memory_bytes: 149768