use std::cmp;
use std::collections::BTreeSet;
use std::collections::BinaryHeap;
use std::collections::HashSet;
use std::collections::VecDeque;
use std::i64::MAX;
use std::io::Read;

macro_rules! input {(source = $s:expr, $($r:tt)*) => {let mut iter = $s.split_whitespace();let mut next = || { iter.next().unwrap() };input_inner!{next, $($r)*}};($($r:tt)*) => {let stdin = std::io::stdin();let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));let mut next = move || -> String{bytes.by_ref().map(|r|r.unwrap() as char).skip_while(|c|c.is_whitespace()).take_while(|c|!c.is_whitespace()).collect()};input_inner!{next, $($r)*}};}
macro_rules! input_inner {($next:expr) => {};($next:expr, ) => {};($next:expr, $var:ident : $t:tt $($r:tt)*) => {let $var = read_value!($next, $t);input_inner!{$next $($r)*}};}
macro_rules! read_value {($next:expr, ( $($t:tt),* )) => {( $(read_value!($next, $t)),* )};($next:expr, [ $t:tt ; $len:expr ]) => {(0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()};($next:expr, chars) => {read_value!($next, String).chars().collect::<Vec<char>>()};($next:expr, usize1) => {read_value!($next, usize) - 1};($next:expr, [ $t:tt ]) => {{let len = read_value!($next, usize);(0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()}};($next:expr, $t:ty) => {$next().parse::<$t>().expect("Parse error")};}

fn solve() {
    input! {
        n: usize,
        q: usize,
        koji: [(i64,i64,i64);n],
        people: [i64;q]
    }

    let mut events: Vec<(i64, bool, usize)> = Vec::new();
    let mut stopped: BTreeSet<usize> = BTreeSet::new();

    for i in 0..n {
        events.push((koji[i].0 - koji[i].2, true, koji[i].2 as usize));
        events.push((koji[i].1 - koji[i].2, false, koji[i].2 as usize));
    }
    events.sort();
    events.reverse();

    let mut last_event_time = 0;
    for i in 0..q {
        last_event_time = match events.last() {
            None => MAX,
            Some(x) => x.0,
        };

        // 最後の処理イベントの時刻がdより大きくなるまでイベントを進める
        while last_event_time <= people[i] {
            let next_event = events.pop().unwrap();
            let event_type = next_event.1;
            let koji_pos = next_event.2;
            match event_type {
                true => {
                    stopped.insert(koji_pos);
                }
                false => {
                    stopped.remove(&koji_pos);
                }
            };

            match events.last() {
                None => {
                    break;
                }
                Some(x) => last_event_time = x.0,
            };
        }

        match stopped.iter().next() {
            None => {
                println!("-1");
            }
            Some(x) => {
                println!("{}", x);
            }
        }
    }

    let mut ans = 0;
}

fn main() {
    let thd = std::thread::Builder::new().stack_size(104_857_600);
    thd.spawn(|| solve()).unwrap().join().unwrap();

    /*
    // 入力を一括で読み込む場合
    let mut buf = String::new();
    std::io::stdin().read_to_string(&mut buf).unwrap();
    let mut input = buf.split_whitespace();

    // inputに対しnext()で読み込んでいく
    let q: usize = input.next().unwrap().parse().unwrap();
    */
}

const LARGE_PRIME: u64 = 1_000_000_007;

// @〜でsnippet


Measured memory_bytes: 29944