"use strict";
function I(t,i){this._s=t.split("\n"),this._c=0,this._l=0,this._f=i||Number}I.prototype.a=function(t){var i=this._s[this._l];if(i){var s=i.trim().split(" "),h=s[this._c];return this._c++,s.length===this._c&&(this._c=0,this._l++),t?t(h):this._f(h)}},I.prototype.l=function(t){var i=this._s[this._l];if(i)return this._c=0,this._l++,i.split(" ").map(t||this._f)},module.exports=I;

function main(input) {
  var o = new I(input);

  var n = o.a();
  var q = o.a();

  var temp1 = [];
  var temp2 = [];

  for ( var i = 0; i < n; i++ ) {
    var s = o.a();
    var t = o.a();
    var x = o.a();
    temp1.push(s - x);
    temp1.push(t - x);
    temp2.push({s: s -x, t: t-x, x})
  }

  temp1.sort((a, b) => a - b);
  var arr = [];
  arr.push({s: -Infinity, t: -Infinity, x: -1});
  for (var i = 0; i < temp1.length - 1; i++) {
    if (temp1[i] !== temp1[i+1]) {
      arr.push({s: temp1[i], t: temp1[i + 1], x: -1});
    }
  }
  arr.push({s: Infinity, t: Infinity, x: -1});

  temp2.sort((a, b) => a.x - b.x);

  var d = [];
  for ( var i = 0; i < q; i++ ) {
    d.push(o.a());
  }

  // for (var i = 0; i < temp2.length; i++) {
  //   var low = 0, high = arr.length - 1;
  //   while (low < high - 1) {
  //     var mid = Math.floor((low + high) / 2);
  //     if (temp2[i].s < arr[mid].s) {
  //       high = mid;
  //     } else {
  //       low = mid;
  //     }
  //   }
  //   var cur = low;
  //   // console.log({cur, arr, temp:temp[i]})
  //   while (arr[cur].t <= temp2[i].t) {
  //     if (arr[cur].x === -1) arr[cur].x = temp2[i].x;
  //     cur += 1;
  //   }
  // }
  // console.log({arr});

  for (var i = 0; i < q; i++) {
    var low = 0, high = arr.length - 1;
    // while (low < high - 1) {
    //   var mid = Math.floor((low + high) / 2);
    //   if (d[i] < arr[mid].s) {
    //     high = mid;
    //   } else {
    //     low = mid;
    //   }
    // }

    // console.log({di: d[i], low})
    if (arr[low].t >= d[i]) {
      console.log(arr[low].x);
    } else {
      console.log(-1);
    }
  }
  // console.log({n, q, s, t, x, d})
}


main(require("fs").readFileSync("/dev/stdin", "utf8"));
