use std::cmp::min;

const INF: i64 = 1 << 62;
fn main() {
    let (r, w) = (std::io::stdin(), std::io::stdout());
    let mut sc = IO::new(r.lock(), w.lock());
    let first_n: usize = sc.read();

    let mut pos = vec![];
    for _ in 0..first_n {
        let x: i64 = sc.read();
        let y: i64 = sc.read();
        let p: i64 = sc.read();
        if x == 0 || y == 0 {
            continue;
        }
        pos.push((x, y, p));
    }

    let n = pos.len();
    let mut xi = vec![];
    let mut yi = vec![];
    for i in 0..n {
        let (px, py, _) = pos[i];
        xi.push((px, i));
        yi.push((py, i));
    }
    xi.sort();
    yi.sort();

    let mut dp = vec![INF; n + 1];
    dfs(0, 0, 0, 0, &mut dp, &pos, &xi, &yi);

    for i in 0..=first_n {
        if dp.len() > i {
            sc.write(dp[i]);
        } else {
            sc.write("0");
        }
        sc.write("\n")
    }
}

fn dfs(
    lx: usize,
    ly: usize,
    depth: usize,
    count: usize,
    dp: &mut Vec<i64>,
    pos: &[(i64, i64, i64)],
    xi: &[(i64, usize)],
    yi: &[(i64, usize)],
) {
    if pos.len() == depth {
        dp[count] = min(calc(pos, xi, yi, lx, ly), dp[count]);
        return;
    }
    dfs(lx, ly, depth + 1, count, dp, pos, xi, yi);
    dfs(lx | (1 << depth), ly, depth + 1, count + 1, dp, pos, xi, yi);
    dfs(lx, ly | (1 << depth), depth + 1, count + 1, dp, pos, xi, yi);
}

fn calc(
    pos: &[(i64, i64, i64)],
    xi: &[(i64, usize)],
    yi: &[(i64, usize)],
    lx: usize,
    ly: usize,
) -> i64 {
    let n = pos.len();
    let mut min_cost = [INF; 15];
    for i in 0..n {
        let (px, py, _) = pos[i];
        min_cost[i] = min(px.abs(), py.abs());
    }

    let mut left_x = -INF;
    let mut left_y = -INF;
    for p in 0..n {
        let (x, i) = xi[p];
        if lx & (1 << i) != 0 {
            left_x = x;
        }
        let dx = (left_x - x).abs();
        min_cost[i] = min(min_cost[i], dx);

        let (y, i) = yi[p];
        if ly & (1 << i) != 0 {
            left_y = y;
        }
        let dy = (left_y - y).abs();
        min_cost[i] = min(min_cost[i], dy);
    }

    let mut right_x = INF;
    let mut right_y = INF;
    for p in (0..n).rev() {
        let (x, i) = xi[p];
        if lx & (1 << i) != 0 {
            right_x = x;
        }
        let dx = (right_x - x).abs();
        min_cost[i] = min(min_cost[i], dx);

        let (y, i) = yi[p];
        if ly & (1 << i) != 0 {
            right_y = y;
        }
        let dy = (right_y - y).abs();
        min_cost[i] = min(min_cost[i], dy);
    }

    let mut sum = 0;
    for i in 0..n {
        sum += min_cost[i] * pos[i].2;
    }
    sum
}

pub struct IO<R, W: std::io::Write>(R, std::io::BufWriter<W>);

impl<R: std::io::Read, W: std::io::Write> IO<R, W> {
    pub fn new(r: R, w: W) -> Self {
        Self(r, std::io::BufWriter::new(w))
    }
    pub fn write<S: ToString>(&mut self, s: S) {
        use std::io::Write;
        self.1.write_all(s.to_string().as_bytes()).unwrap();
    }
    pub fn read<T: std::str::FromStr>(&mut self) -> T {
        use std::io::Read;
        let buf = self
            .0
            .by_ref()
            .bytes()
            .map(|b| b.unwrap())
            .skip_while(|&b| b == b' ' || b == b'\n' || b == b'\r' || b == b'\t')
            .take_while(|&b| b != b' ' && b != b'\n' && b != b'\r' && b != b'\t')
            .collect::<Vec<_>>();
        unsafe { std::str::from_utf8_unchecked(&buf) }
            .parse()
            .ok()
            .expect("Parse error.")
    }
    pub fn vec<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.read()).collect()
    }
    pub fn chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
}


Measured memory_bytes: 2168