#![allow(unused_parens)]
#![allow(unused_imports)]
#![allow(non_upper_case_globals)]

#[allow(unused_macros)]
macro_rules! invec {
    ( $ t : ty ) => {{
        let mut s = String::new();
        match std::io::stdin().read_line(&mut s) {
            Ok(0) => Vec::<$t>::new(),
            Ok(n) => s
                .trim()
                .split_whitespace()
                .map(|s| s.parse::<$t>().unwrap())
                .collect::<Vec<$t>>(),
            Err(_) => Vec::<$t>::new(),
        }
    }};
}

#[allow(unused_macros)]
macro_rules! get {
      ($t:ty) => {
          {
              let mut line: String = String::new();
              std::io::stdin().read_line(&mut line).unwrap();
              line.trim().parse::<$t>().unwrap()
          }
      };
      ($($t:ty),*) => {
          {
              let mut line: String = String::new();
              std::io::stdin().read_line(&mut line).unwrap();
              let mut iter = line.split_whitespace();
              (
                  $(iter.next().unwrap().parse::<$t>().unwrap(),)*
              )
          }
      };
      ($t:ty; $n:expr) => {
          (0..$n).map(|_|
              get!($t)
          ).collect::<Vec<_>>()
      };
      ($($t:ty),*; $n:expr) => {
          (0..$n).map(|_|
              get!($($t),*)
          ).collect::<Vec<_>>()
      };
      ($t:ty ;;) => {
          {
              let mut line: String = String::new();
              std::io::stdin().read_line(&mut line).unwrap();
              line.split_whitespace()
                  .map(|t| t.parse::<$t>().unwrap())
                  .collect::<Vec<_>>()
          }
      };
      ($t:ty ;; $n:expr) => {
          (0..$n).map(|_| get!($t ;;)).collect::<Vec<_>>()
      };
}

#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let mut s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($next:expr, [$t:tt]) => {
        {
            let len = read_value!($next, usize);
            (0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
        }
    };
    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

#[cfg(debug_assertions)]
macro_rules! mydbg {
    //($arg:expr) => (dbg!($arg))
    //($arg:expr) => (println!("{:?}",$arg));
      ($($a:expr),*) => {
          eprintln!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
      }
}
#[cfg(not(debug_assertions))]
macro_rules! mydbg {
    ($($arg:expr),*) => {};
}

use std::cmp;
use std::collections::HashMap;

#[allow(dead_code)]
static INF_I64: i64 = 9223372036854775807;
#[allow(dead_code)]
static INF_I32: i32 = 2147483647;
#[allow(dead_code)]
static INF_USIZE: usize = 18446744073709551615;

fn main() {
    input! {
       n: usize,
       q : usize,
       kouji : [(usize,usize,usize);n],
       d : [usize;q],
    }

    let mut ans = 0;

    let mut kouji = kouji;
    kouji.sort_by(|x, y| x.2.cmp(&y.2));
    kouji = kouji
        .iter()
        .map(|x| (if x.0 > x.2 { x.0 - x.2 } else { 0 }, if x.1 > x.2 {x.1 - x.2} else {0}, x.2))
        .collect();
    let mut c = std::collections::BTreeSet::new();
    for &(x, y, _) in &kouji {
        c.insert(x);
        c.insert(y);
    }
    for item in &d {
        c.insert(*item);
    }

    let mut h = std::collections::HashMap::new();
    for (i, &item) in c.iter().enumerate() {
        h.entry(item).or_insert(i);
    }

    let mut v = vec![INF_USIZE; c.len()];
    let sqrtn = ((c.len() as f32).sqrt() as usize);
    let K = (c.len() + sqrtn - 1) / sqrtn;
    let mut lazy = vec![INF_USIZE; K];

    for &(x, y, z) in &kouji {
        let x2 = *h.get(&x).unwrap();
        let y2 = *h.get(&y).unwrap();
        //(x2,y2]
        for k in 0..K {
            let l = k * sqrtn;
            let r = (k + 1) * sqrtn;
            if r <= x2 || y2 <= l {
                continue;
            }
            if x2 <= l && y2 >= r {
                lazy[k] = std::cmp::min(lazy[k], z);
            } else {
                mydbg!(x2, l, y2, r);
                for i in std::cmp::max(x2, l)..std::cmp::min(y2, r) {
                    v[i] = std::cmp::min(v[i], z);
                }
            }
        }
    }

    mydbg!(sqrtn, lazy, v);
    let mut ans = vec![];
    for t in &d {
        let t2 = *h.get(t).unwrap();
        let k = t2 / sqrtn;
        if lazy[k] != INF_USIZE {
            for i in k * sqrtn..(k + 1) * sqrtn {
                v[i] = std::cmp::min(v[i], lazy[k]);
            }
            lazy[k] = INF_USIZE;
        }
        ans.push(v[t2]);
    }

    //mydbg!(ans);
    for item in &ans{
        let hoge = if *item == INF_USIZE { "-1".to_string() } else { item.to_string()};
        println!("{}", hoge);
    }
}


Measured memory_bytes: 66112