#include <bits/stdc++.h>
#pragma GCC optimize("O3", "unroll-loops")
using namespace std;
template <class T, class U>
inline void checkmin(T &x, U y) {
  if (y < x) x = y;
}
template <class T, class U>
inline void checkmax(T &x, U y) {
  if (y > x) x = y;
}
template <class T, class U>
inline bool ifmax(T &x, U y) {
  if (y > x) return x = y, true;
  return false;
}
template <class T, class U>
inline bool ifmin(T &x, U y) {
  if (y < x) return x = y, true;
  return false;
}
template <class T>
inline void sort(T &a) {
  sort(a.begin(), a.end());
}
template <class T>
inline void rsort(T &a) {
  sort(a.rbegin(), a.rend());
}
template <class T>
inline void reverse(T &a) {
  reverse(a.begin(), a.end());
}
template <class T, class U>
inline istream &operator>>(istream &str, pair<T, U> &p) {
  return str >> p.first >> p.second;
}
template <class T>
inline istream &operator>>(istream &str, vector<T> &a) {
  for (auto &i : a) str >> i;
  return str;
}
struct node {
  int mn = 1000000007;
  int l = 0;
  node() {}
  node(int k) { mn = k; }
  void operator=(const node &n) { mn = n.mn; }
};
node merge(node a, node b) { return node(min(a.mn, b.mn)); }
struct Tree {
  static const int n = 1 << 30;
  node t[30000000];
  int ptr = 2;
  void add(int &v) {
    if (v == 0) v = ptr, ptr += 2;
  }
  void upd(int l, int r, int x, int v = 1, int vl = -n, int vr = n) {
    if (vl >= r || vr <= l) return;
    if (vl >= l && vr <= r) return checkmin(t[v].mn, x);
    int vm = vl + vr >> 1;
    add(t[v].l);
    upd(l, r, x, t[v].l, vl, vm);
    upd(l, r, x, t[v].l + 1, vm, vr);
    t[v] = merge(t[t[v].l], t[t[v].l + 1]);
  }
  int get(int x, int v = 1, int vl = -n, int vr = n) {
    if (vl > x || vr <= x) return 1000000007;
    if (t[v].l == 0) return t[v].mn;
    int vm = vl + vr >> 1;
    return min(get(x, t[v].l, vl, vm), get(x, t[v].l + 1, vm, vr));
  }
} tree;
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  cout << fixed << setprecision(12);
  ;
  srand(94385);
  int n, q;
  cin >> n >> q;
  for (int i = 0; i < n; ++i) {
    int second, t, x;
    cin >> second >> t >> x;
    tree.upd(second - x, t - x, x);
  }
  while (q--) {
    int d;
    cin >> d;
    int ans = tree.get(d);
    if (ans == 1000000007)
      cout << -1;
    else
      cout << ans;
    cout << '\n';
  }
  return 0;
}
