#include <bits/stdc++.h>

using namespace std;

#define INF 100000000
#define YJ 1145141919
#define INF_INT_MAX 2147483647
#define INF_LL 9223372036854775
#define INF_LL_MAX 9223372036854775807
#define EPS 1e-10
#define MOD 1000000007
#define MOD9 998244353
#define Pi acos(-1)
#define LL long long
#define ULL unsigned long long
#define LD long double

#define int long long

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(a)  begin((a)), end((a))
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())

const int MAX_N = 200005;
const int MAX_Q = 200005;
int N, Q;
int D[MAX_Q];

struct Trap{
  Trap() {}
  int s, t, x;
  void input() {
    cin >> s >> t >> x;
  }

  bool operator < (const Trap& t) const {
    return x < t.x;
  }

  bool operator > (const Trap& t) const {
    return x > t.x;
  }
};

Trap traps[MAX_N];

class RangeNode {
public:
  RangeNode() {
    init();
  }

  void init() {
    delay = delayFlag = 0;
    val = ((long long)1<<31) - 1;
  }

  //クエリ処理
  static int evaluateQuery(int p1, int p2) 
  {
    return min(p1, p2);
  }

  //range処理
  void evaluateRange(int range) 
  {
    val = delay;
  }

  //delay処理
  void evaluateDelay(int d)
  {
    delay = d;
  }

  //単位元(クエリ処理)
  static int unit()
  {
    return ((long long)1<<31) - 1;
  }

  int val;
  int delay;
  bool delayFlag;

private:

};

template<class T, int Size>
class RangeSegmentTree {
public:
  RangeSegmentTree() 
  {
    init();
  }

  void init()
  {
    n = 1;
    while(n < Size) n *= 2;
    node.clear(); node.resize(2*n);
  }

  void evaluateRangeNode(int k, int l, int r)
  {
    if(node[k].delayFlag) {
      node[k].evaluateRange(r-l);
      if(r-l>1) {
        node[2*k+1].evaluateDelay(node[k].delay);
        node[2*k+2].evaluateDelay(node[k].delay);
        node[2*k+1].delayFlag = node[2*k+2].delayFlag = true;
      }
      node[k].delayFlag = false;
      node[k].delay = 0;
    }
  }

  void updateRange(int l, int r, int v)
  {
    _updateRange(l,r,v,0,0,n);
  }

  int query(int l, int r)
  {
    return _query(l,r,0,0,n);
  }

private:
  vector<T> node;
  int n;

  void _updateRange(int l, int r, int v, int k, int a, int b)
  {
    evaluateRangeNode(k,a,b);

    if(b <= l || r <= a) return;
    else if(l <= a && b <= r) {
      node[k].evaluateDelay(v);
      node[k].delayFlag = true;
      evaluateRangeNode(k,a,b);
      return;
    } else {
      int mid = (a+b)/2;
      _updateRange(l,r,v,2*k+1,a,mid);
      _updateRange(l,r,v,2*k+2,mid,b);
      node[k].val = RangeNode::evaluateQuery(node[2*k+1].val, node[2*k+2].val);
      return;
    }
  }

  int _query(int l, int r, int k, int a, int b)
  {
    evaluateRangeNode(k,a,b);
    
    if(b <= l || r <= a) return RangeNode::unit();
    else if(l <= a && b <= r) {
      return node[k].val;
    } else {
      int mid = (a+b)/2;
      int vl = _query(l,r,2*k+1,a,mid);
      int vr = _query(l,r,2*k+2,mid,b);
      return RangeNode::evaluateQuery(vl,vr);
    }
  }
};

RangeSegmentTree<RangeNode, MAX_N> seg;

signed main()
{
  cin >> N >> Q;
  REP(n,N) {
    traps[n].input();
  }

  REP(q,Q) {
    cin >> D[q];
    D[q] *= -1;
  }

  sort(D, D+Q);

  sort(traps, traps+N, greater<Trap>());
  seg.updateRange(0, Q, -1);

  REP(n,N) {
    int l = traps[n].x - traps[n].t+1;
    int r = traps[n].x - traps[n].s;
    int lIndex = lower_bound(D, D+Q, l) - D;
    int rIndex = upper_bound(D, D+Q, r) - D;
    if(rIndex - lIndex < 1) {
      continue;
    }
    seg.updateRange(lIndex, rIndex, traps[n].x);
  }

  REP(q,Q) {
    cout << seg.query(Q-q-1, Q-q) << endl;
  }

  return 0;
}

Measured memory_bytes: 20480