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

#define int long long
//struct Fast {Fast(){std::cin.tie(0);ios::sync_with_stdio(false);}} fast;

/* short */
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define Fi first
#define Se second
#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
#define X real()
#define Y imag()

/* REPmacro */
#define REPS(i, a, n) for (LL i = (a); i < (LL)(n); ++i)
#define REP(i, n) REPS(i, 0, n)
#define DEPS(i, a, n) for (LL i = (a); i >= (LL)(n); --i)
#define DEP(i, n) DEPS(i, n, 0)
#define EACH(i, n) for (auto&& i = (n).begin(); i != (n).end(); ++i)
#define REACH(i, n) for (auto&& i = (n).rbegin(); i != (n).rend(); ++i)
#define FILL(array,value) fill((array), (array) + sizeof(array)/sizeof((array)[0]), (value))
// EACH, REACHは要素にアスタリスクをつけて，*itrで参照すること
// itrが構造体を指しているなら，->で参照すること

/* debug */
#define debug(x) cerr << x << " " << "(L:" << __LINE__ << ")" << '\n';

/* alias */
using LL = long long;
using ULL = unsigned long long;
using DBL = double;
using CPX = complex<DBL>;
using VI = vector<int>;
using VVI = vector<VI>;
using VVVI = vector<VVI>;
using VS = vector<string>;
using PII = pair<int, int>;
using PIS = pair<int, string>;
template <typename T> using PQ = priority_queue<T>;
template <typename T> using minPQ = priority_queue<T, vector<T>, greater<T>>;

/* const */
const int INF = 1001001001;
const LL LINF = 1001001001001001001LL;
const int MOD = 1e9 + 7;
const DBL EPS = 1e-12;
const DBL PI=3.1415926535897932384626;
const int dx[] = {0, 1, 0, -1, 1, -1, 1, -1}, dy[] = {1, 0, -1, 0, 1, -1, -1, 1};

/* func */
inline bool inside(int y, int x, int H, int W) {return y >= 0 && x >= 0 && y < H && x < W;}
inline int in() {int x; cin >> x; return x;}
inline LL IN() {LL x; cin >> x; return x;}
inline VS split(const string& t, char c) {VS v; stringstream s(t); string b; while(getline(s, b, c)) v.eb(b); return v;}
template <typename T> inline bool chmin(T& a, const T& b) {if (a > b) a = b; return a > b;}
template <typename T> inline bool chmax(T& a, const T& b) {if (a < b) a = b; return a < b;}
template <typename T, typename S> inline void print(const pair<T, S>& p) {cout << p.first << " " << p.second << endl;}
template <typename T> inline void print(const T& x) {cout << x << '\n';}
template <typename T, typename S> inline void print(const vector<pair<T, S>>& v) {for (auto&& p : v) print(p);}
template <typename T> inline void print(const vector<T>& v, string s = " ") {REP(i, v.size()) cout << v[i] << (i != (LL)v.size() - 1 ? s : "\n");}

int N, Q;
using STX = tuple<DBL, int, int>;
vector<STX> EV;
VI ans;

signed main() {
  cin >> N >> Q;
  REP(i,N) {
    DBL s,t, x;
    cin >> s >> t >> x;
    EV.pb(make_tuple(s-x-0.5,+1,x));
    EV.pb(make_tuple(t-x-0.5,-1,x));
  }
  REP(i,Q) {
    int d;
    cin >> d;
    EV.pb(make_tuple(d,0,i));
  }
  sort(ALL(EV));

  bool is_stop = false;
  set<int> stop;
  DBL minstop = INF;
  ans.resize(Q);
  fill(ALL(ans), -1);

  EACH(ev, EV) {
    DBL t = get<0>(*ev);
    int e = get<1>(*ev);
    int x = get<2>(*ev);
    if (e > 0) {
      stop.insert(x);
    } else if (e < 0) {
      stop.erase(x);
    } else if (stop.size() > 0) {
      ans[x] = *stop.begin();
    }
  }
  REP(i,Q) print(ans[i]);

  return 0;
}

Measured memory_bytes: 28004