#include <bits/stdc++.h>
enum EventType { Start_rw = 0, Person = 1, End_rw = 2 };
struct Event {
  EventType type;
  int64_t t;
  int64_t x;
  int64_t inter;
  Event(EventType _type, int64_t _t, int64_t _x) {
    type = _type;
    t = _t;
    x = _x;
    inter = t - x;
  }
  friend bool operator<(const Event &lhs, const Event &rhs) {
    if (lhs.inter == rhs.inter) {
      return lhs.inter > rhs.inter;
    }
    return lhs.inter < rhs.inter;
  }
};
int main() {
  int64_t n, q;
  std::cin >> n >> q;
  std::vector<Event> events;
  std::set<int64_t> activeBarriers;
  int64_t s, t, x;
  for (auto i = 0; i < n; ++i) {
    std::cin >> s >> t >> x;
    events.emplace_back(Start_rw, 2 * s - 1, 2 * x);
    events.emplace_back(End_rw, 2 * t - 1, 2 * x);
  }
  int64_t d;
  for (auto i = 0; i < q; ++i) {
    std::cin >> d;
    events.push_back(Event(Person, 2 * d, 0));
  };
  std::sort(events.begin(), events.end());
  for (Event event : events) {
    if (event.type == Start_rw) {
      activeBarriers.insert(event.x);
    } else if (event.type == Person) {
      auto distance = activeBarriers.begin();
      if (distance == activeBarriers.end()) {
        std::cout << -1 << '\n';
      } else {
        std::cout << (*distance) / 2 << '\n';
      }
    } else if (event.type == End_rw) {
      activeBarriers.erase(event.x);
    }
  }
  return 0;
}
