#![allow(unused_imports)]
#![allow(non_snake_case)]
use std::cmp::*;
use std::collections::*;
use std::io::Write;

#[allow(unused_macros)]
macro_rules! debug {
    ($($e:expr),*) => {
        #[cfg(debug_assertions)]
        $({
            let (e, mut err) = (stringify!($e), std::io::stderr());
            writeln!(err, "{} = {:?}", e, $e).unwrap()
        })*
    };
}

fn main() {
    let v = read_vec::<usize>();
    let (n, q) = (v[0], v[1]);

    let mut constructions = vec![];
    for _ in 0..n {
        let v = read_vec::<i64>();
        constructions.push((v[0] - v[2], v[1] - v[2], v[2]));
    }
    let mut queries = vec![];
    for _ in 0..q {
        queries.push(read::<i64>());
    }
    let mut coordinates = BTreeSet::new();
    for &(s, t, _) in constructions.iter() {
        coordinates.insert(s);
        coordinates.insert(t);
    }
    for &d in queries.iter() {
        coordinates.insert(d);
    }

    let mut compress_dict = HashMap::new();

    for (i, &x) in coordinates.iter().enumerate() {
        compress_dict.insert(x, i);
    }

    let mut segtree = LazySegmentTree::new(coordinates.len());
    for &(s, t, x) in constructions.iter() {
        segtree.update(
            compress_dict[&s],
            compress_dict[&t],
            x,
            0,
            0,
            coordinates.len(),
        );
    }
    for &d in queries.iter() {
        let didx = compress_dict[&d];
        let min_x = segtree.getmin(didx, didx + 1, 0, 0, coordinates.len());
        if min_x == std::i64::MAX {
            println!("{:?}", -1);
        } else {
            println!("{:?}", min_x);
        }
    }
}

fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}

#[derive(Debug)]
struct LazySegmentTree {
    n: usize,
    node: Vec<i64>,
    lazy: Vec<i64>,
}

impl LazySegmentTree {
    fn new(sz: usize) -> LazySegmentTree {
        let mut n = 1;
        while n < sz {
            n *= 2;
        }
        LazySegmentTree {
            n: n,
            node: vec![std::i64::MAX; n * 2],
            lazy: vec![std::i64::MAX; n * 2],
        }
    }

    fn eval(&mut self, k: usize, l: usize, r: usize) {
        if self.lazy[k] != std::i64::MAX {
            self.node[k] = min(self.node[k], self.lazy[k]);
            if r - l > 1 {
                self.lazy[2 * k + 1] = min(self.lazy[2 * k + 1], self.lazy[k]);
                self.lazy[2 * k + 2] = min(self.lazy[2 * k + 2], self.lazy[k]);
            }
            self.lazy[k] = std::i64::MAX;
        }
    }

    fn update(&mut self, a: usize, b: usize, x: i64, k: usize, l: usize, r: usize) {
        // update [l, r) k = 0, l = 0, r = n is default
        self.eval(k, l, r);

        // if out of range, do nothing.
        if b <= l || r <= a {
            return;
        }

        if a <= l && r <= b {
            self.lazy[k] = min(self.lazy[k], x);
            self.eval(k, l, r);
        } else {
            self.update(a, b, x, 2 * k + 1, l, (l + r) / 2);
            self.update(a, b, x, 2 * k + 2, (l + r) / 2, r);
            self.node[k] = min(self.node[2 * k + 1], self.node[2 * k + 2]);
        }
    }

    fn getmin(&mut self, a: usize, b: usize, k: usize, l: usize, r: usize) -> i64 {
        if b <= l || r <= a {
            return std::i64::MAX;
        }

        self.eval(k, l, r);
        if a <= l && r <= b {
            return self.node[k];
        }

        min(
            self.getmin(a, b, 2 * k + 1, l, (l + r) / 2),
            self.getmin(a, b, 2 * k + 2, (l + r) / 2, r),
        )
    }
}


Measured memory_bytes: 81456