// https://atcoder.jp/contests/abc128/tasks/abc128_e

// https://qiita.com/penguinshunya/items/cd96803b74635aebefd6
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()
}
fn read_vec2<T: std::str::FromStr>(n: u32) -> Vec<Vec<T>> {
    (0..n).map(|_| read_vec()).collect()
}

fn main() {
    let first_line = read_vec::<i32>();
    let n = first_line[0];
    let q = first_line[1];
    struct RoadWork {
        start: i32,
        end: i32,
        position: i32,
    }
    let mut road_works: Vec<RoadWork> = vec![];
    for _ in 0..n {
        let line = read_vec::<i32>();
        let si = line[0];
        let ti = line[1];
        let xi = line[2];
        road_works.push(RoadWork {
            start: si - xi,
            end: ti - 1 - xi,
            position: xi,
        });
    }
    let mut dis: Vec<i32> = vec![];
    for _ in 0..q {
        let di = read::<i32>();
        dis.push(di);
    }
    dis.sort();
    let mut tree: Vec<Vec<i32>> = vec![];
    let mut q2 = 1i32;
    loop {
        tree.push(vec![std::i32::MAX; q2 as usize]);
        if q2 >= q {
            break;
        }
        q2 = q2 * 2;
    }
    debug_assert_eq!(2i32.pow(tree.len() as u32 - 1), q2);
    for _ in q..q2 {
        dis.push(std::i32::MAX);
    }
    debug_assert_eq!(dis.len(), q2 as usize);
    let tree_depth = tree.len();
    let idx_in_level = |level: usize, idx: i32| -> usize {
        (idx / 2i32.pow((tree_depth - 1 - level) as u32)) as usize
    };
    for road_work in &road_works {
        let idx_start =
            find_first_sorted(&dis, &|q: &i32| *q >= road_work.start, 0, dis.len()) as i32;
        let idx_end = find_first_sorted(&dis, &|q: &i32| *q > road_work.end, 0, dis.len()) as i32;
        let mut idx = idx_start;
        while idx < idx_end {
            let mut level_width: Option<(usize, i32)> = None;
            for i in 0..tree.len() {
                let width = q2 / 2i32.pow(i as u32);
                if idx % width == 0 && idx + width <= idx_end {
                    level_width = Some((i, width));
                    break;
                }
            }
            let (level, width) = level_width.unwrap();
            let idx_in_level = idx_in_level(level, idx);
            tree[level][idx_in_level] =
                std::cmp::min(tree[level][idx_in_level], road_work.position);
            idx += width;
        }
    }
    for idx in 0..q {
        let mut min = std::i32::MAX;
        for level in 0..tree.len() {
            let idx_in_level = idx_in_level(level, idx);
            min = std::cmp::min(min, tree[level][idx_in_level]);
        }
        if min == std::i32::MAX {
            println!("-1");
        } else {
            println!("{}", min);
        }
    }
}

// ない場合はvec.len()を返す
fn find_first_sorted<T>(vec: &Vec<T>, cond: &Fn(&T) -> bool, start: usize, end: usize) -> usize {
    assert_ne!(start, end);
    if end - start == 1 {
        if cond(&vec[start]) {
            start
        } else {
            vec.len()
        }
    } else {
        let mid = start + (end - start) / 2;
        if cond(&vec[mid]) {
            std::cmp::min(find_first_sorted(vec, cond, start, mid), mid)
        } else {
            find_first_sorted(vec, cond, mid, end)
        }
    }
}


Measured memory_bytes: 12664