#![allow(non_snake_case, unused)]
use std::cmp::*;
use std::collections::*;

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)*}
    };

    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $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, [ $t:tt ]) => {
        {
            let len = read_value!($next, usize);
            (0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
        }
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, bytes) => {
        read_value!($next, String).into_bytes()
    };

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

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

const INF: i64 = 1 << 50;

fn main() {
    input! {
        n: usize,
        xyp: [(i64, i64, i64); n],
    }

    let mut x_cost = vec![vec![INF; n]; (1<<n)];
    let mut y_cost = vec![vec![INF; n]; (1<<n)];
    

    for bit in 0..1<<n {
        for i in 0..n {
            x_cost[bit][i] = xyp[i].0.abs();
            y_cost[bit][i] = xyp[i].1.abs();

            for k in 0..n {
                if bit & (1 << k) !=0 {
                    x_cost[bit][i] = min(x_cost[bit][i], (xyp[i].0 - xyp[k].0).abs());
                    y_cost[bit][i] = min(y_cost[bit][i], (xyp[i].1 - xyp[k].1).abs());
                }
            }
        }
    }

    let mut ans = vec![INF; n+1];

    for t_bit in 0..3usize.pow(n as u32) {
        let mut cnt = 0;
        let mut x = t_bit;
        let mut s = 0;
        let mut t = 0;

        for i in 0..n {
            let y = x % 3;
            if y == 1{
                s += 1 << i;
                cnt += 1;
            }
            else if y == 2 {
                t += 1 << i;
                cnt += 1;
            }
            x /= 3;
        }
        let mut cost = 0;

        for k in 0..n {
            cost += xyp[k].2 * min(x_cost[s][k], y_cost[t][k]);
        }
        ans[cnt] = min(ans[cnt], cost);
        
    
    }

    for i in 0..=n {
        println!("{}", ans[i]);
    }
}


Measured memory_bytes: 11788