#include <bits/stdc++.h>
#pragma GCC optimize(2)
using namespace std;
set<int> s;
int c[400010];
struct node {
  int s, t, x;
};
node a[400010];
bool cmp(node a, node b) { return a.x < b.x; }
int ans[400010];
inline int read() {
  int x = 0;
  char c = getchar();
  for (; isdigit(c); c = getchar()) x = x * 10 + c - '0';
  return x;
}
int main() {
  int n = read(), q = read();
  for (int i = (1); i <= (n); i++) {
    a[i].s = read();
    a[i].t = read();
    a[i].x = read();
  }
  sort(a + 1, a + 1 + n, cmp);
  for (int i = (1); i <= (q); i++) {
    int x = read();
    s.insert(x);
    c[i] = x;
  }
  for (int i = (1); i <= (n); i++) {
    auto l = lower_bound(s.begin(), s.end(), a[i].s - a[i].x);
    auto r = lower_bound(s.begin(), s.end(), a[i].t - a[i].x);
    int j = lower_bound(c + 1, c + 1 + q, *l) - c;
    for (auto o = l; o != r; o++, j++) ans[j] = a[i].x;
    s.erase(l, r);
    if (s.empty()) break;
  }
  for (int i = (1); i <= (q); i++)
    if (ans[i] == 0)
      printf("%d%c", -1, '\n');
    else
      printf("%d%c", ans[i], '\n');
}
