#include <stdio.h>
#include <cstdio>
#include <iostream>
#include <iomanip>
#include <queue>
#include <set>
#include <vector>
#include <string>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <complex>


long long int INF = 1e18;

// update range [a, b) by min(value, current value)
// the variables should be k = 0, l = 0, r = N_segtree
int update_range(std::vector<long long int> &min_segtree, std::vector<long long int> &lazy, long long int N_segtree, long long int a, long long int b, long long int value, long long int k, long long int l, long long int r);

// get min in range [a, b) 
// the variables should be k = 0, l = 0, r = N_segtree
long long int get_min(std::vector<long long int> &min_segtree, std::vector<long long int> &lazy, long long int N_segtree, long long int a, long long int b, long long int k, long long int l, long long int r);

// subroutines
int propagate_lazy(std::vector<long long int> &segtree, std::vector<long long int> &lazy, long long int index, long long int l, long long int r);


// 2000 =2^11 100 < 2^7
// 2e5 < 2^18
int main(){
  
  // read problem
  long long int N, Q, tmp1, tmp2, tmp3;
  std::vector<long long int> S, T, X, D;
  std::vector<std::pair<long long int, std::pair<long long int, long long int> > > hogehoge;

  scanf("%lld%lld", &N, &Q);
  for(long long int i = 0; i < N; i++){
    scanf("%lld%lld%lld", &tmp1, &tmp2, &tmp3);
    hogehoge.push_back(std::make_pair(tmp3, std::make_pair(tmp1, tmp2)));
    //S.push_back(tmp1);
    //T.push_back(tmp2);
    //X.push_back(tmp3);
  }
  std::sort(hogehoge.begin(), hogehoge.end());
  for(long long int i = 0; i < N; i++){
    S.push_back(hogehoge[i].second.first);
    T.push_back(hogehoge[i].second.second);
    X.push_back(hogehoge[i].first);

  }
  for(long long int i = 0; i < Q; i++){
    scanf("%lld", &tmp1);
    D.push_back(tmp1);
  }

  // solve problem
  
  // remake S, T
  for(long long int i = 0; i < N; i++){
    S[i] = S[i] - X[i];
    T[i] = T[i] - X[i];
  }

  std::cerr << "i  S-X  T-X  X" << std::endl;
  for(long long int i = 0; i < N; i++){
    std::cerr << i << " " << S[i] << " " << T[i] << " " << X[i] << std::endl;
  }std::cerr << std::endl;

  // prepare lazy segment tree 2^18 > 2e5
  long long int N_segtree = (1LL<<18); // set appropriately
  std::vector<long long int> min_segtree(2*N_segtree-1);
  std::vector<long long int> lazy(2*N_segtree-1);
  for(long long int i = 0; i < 2*N_segtree-1; i++){
    min_segtree[i] = INF;
    lazy[i] = INF;
  }

  // solve problem
  long long int a, b; // variables for range update
  long long int lb, rb, midb; // variables for bisection

  // for all contructions
  for(long long int i = 0; i < N; i++){
    
    if(T[i] <= D[0])continue; // if no people is stopped

    else if(T[i] > D[Q-1]) b = Q;
    else{
      lb = 0;
      rb = Q-1;
      while(rb-lb > 1){
        midb = (lb+rb)/2;
        if(T[i] > D[midb]){
          lb = midb;
        }
        else{
          rb = midb;
        }
      }
      b = rb;
    }

    if(S[i] > D[Q-1]) continue; // if no people is stopped
    else if(S[i] <= D[0]) a = 0;
    else{
      lb = 0;
      rb = Q-1;

      while(rb-lb > 1){
        midb = (lb+rb)/2;
        if(S[i] <= D[midb]){
          rb = midb;
        }
        else{
          lb = midb;
        }
      }
      a = rb;
    }

    std::cerr << i << " " << a << " " << b << std::endl;

    update_range(min_segtree, lazy, N_segtree, a, b, i, 0, 0, N_segtree);
  }

  std::cerr << "Answer: " << std::endl;
  long long int c;
  for(long long int i = 0; i < Q; i++){
    c = get_min(min_segtree, lazy, N_segtree, i, i+1, 0, 0, N_segtree);
    if(c== INF){
      std::cout << "-1" << std::endl;
    }
    else{
      std::cout << X[c] << std::endl;
    }
  }

  return 0;

}



int propagate_lazy(std::vector<long long int> &segtree, std::vector<long long int> &lazy, long long int index, long long int l, long long int r){

  // evaluate
  segtree[index] = std::min(segtree[index], lazy[index]);    
  // if not lowest node
  if(r-l > 1){
    lazy[2*index+1] = std::min(lazy[2*index+1], lazy[index]);
    lazy[2*index+2] = std::min(lazy[2*index+2], lazy[index]);
  }
  lazy[index] = INF;

  return 0;
}

int update_range(std::vector<long long int> &min_segtree, std::vector<long long int> &lazy, long long int N_segtree, long long int a, long long int b, long long int value, long long int k, long long int l, long long int r){  
  // propagate 
  propagate_lazy(min_segtree, lazy, k, l, r);

  // if out of range
  if(b <= l || r <= a){
    return 0;
  }

  // if [a, b) covers [l, r)
  if(a <= l && b >= r){
    lazy[k] = std::min(lazy[k], value);
    propagate_lazy(min_segtree, lazy, k, l, r);

    return 0;
  }

  // calculate child nodes
  else{
    min_segtree[k] = std::min(min_segtree[k], value);

    update_range(min_segtree, lazy, N_segtree, a, b, value, 2*k+1, l, (l+r)/2);
    update_range(min_segtree, lazy, N_segtree, a, b, value, 2*k+2, (l+r)/2, r);

    return 0;
  }
}

long long int get_min(std::vector<long long int> &min_segtree, std::vector<long long int> &lazy, long long int N_segtree, long long int a, long long int b, long long int k, long long int l, long long int r){

  // if [a, b) and [l, r) have no intersection
  if(r <= a || l >= b){
    return INF;
  }

  // propagate
  propagate_lazy(min_segtree, lazy, k, l, r);

  // if [a, b) covers [l, r)
  if(a <= l && b >= r){
    return min_segtree[k];
  }
  // if [a, b) and [l, r) have intersection
  else{
    return std::min(get_min(min_segtree, lazy, N_segtree, a, b, 2*k+1, l, (l+r)/2), get_min(min_segtree, lazy, N_segtree, a, b, 2*k+2, (l+r)/2, r));
  }
}

Measured memory_bytes: 24300