#include <iostream>
#include <vector>
#include <fstream>
#include <numeric>
#include <sstream>
#include <cassert>
#include <tuple>
#include <iomanip>
#include <random>
#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <map>
#include <set>
#include <list>
#include <cmath>
#include <ctime>
#include <deque>
#include <queue>
#include <chrono>
#include <stack>
#include <string>
#include <bitset>
#include <unordered_map>
#include <cstdio>
#include <limits>
#include <vector>
#include <climits>
#include <cstring>

using namespace std;

#define all(x) (x).begin(),(x).end()
#define sz(x) (int)(x.size())
#define pb push_back
#define endl "\n" // TODO: remove
//#define int long long

const int N = 322;
const long long inf = (long long)(2e18) + 322;
const int mod = (int)(1e9) + 7; // check modulo

int x[N], y[N];
long long ans[N];
long long p[N];
int vx[N], szx, vy[N], szy;


void solve() {
    int n; cin >> n;
    for(int i = 0; i < n; ++i) {
        cin >> x[i] >> y[i] >> p[i];
        ans[i] = inf;
    }
    int cnt = 0;
    for(int mask = 0; mask < (1 << n); ++mask) {
        int count = __builtin_popcount(mask);
        if (count >= n - 1) continue;
        for(int mask1 = 0; mask1 < (1 << count); ++mask1) {
            int ones = 0;
            szx = 0;
            szy = 0;
            long long cost = 0;
            vx[0] = 0;
            vy[0] = 0;
            for(int i = 0; i < n; ++i) {
                if ((mask >> i) & 1) {
                    if ((mask1 >> ones) & 1) {
                        vx[++szx] = x[i];
                    }else {
                        vy[++szy] = y[i];
                    }
                    ones++;
                }
            }
//            cout << bitset<3>(mask) << ' ' << bitset<3>(mask1) << endl;
//            cout << szx << ' ' << szy << endl;
            sort(vx, vx + szx + 1);
            sort(vy, vy + szy + 1);
//            for(int i = 0; i <= szx; ++i) cout << vx[i] << ' ';
//            cout << endl;
//            for(int i = 0; i <= szy; ++i) cout << vy[i] << ' ';
//            cout << endl;
            for(int i = 0; i < n; ++i) {
                if (!((mask >> i) & 1)) {
                    int X = lower_bound(vx, vx + szx + 1, x[i]) - vx;
                    int Y = lower_bound(vy, vy + szy + 1, y[i]) - vy;
                    long long mn = inf;
                    if (X <= szx) mn = min(mn, abs(vx[X] - x[i]) * p[i]);
                    if (Y <= szy) mn = min(mn, abs(vy[Y] - y[i]) * p[i]);
                    if (X) X--;
                    if (Y) Y--;
                    if (X <= szx) mn = min(mn, abs(vx[X] - x[i]) * p[i]);
                    if (Y <= szy) mn = min(mn, abs(vy[Y] - y[i]) * p[i]);
                    cost += mn;
                }
            }
            ans[count] = min(ans[count], cost);
        }
    }
    for(int i = 0; i < n; ++i) {
        long long mn = inf;
        for(int j = 0; j <= n; ++j) {
            if (i == j) continue;
            mn = min({mn, abs(x[j] - x[i]) * p[i], abs(y[i] - y[j]) * p[i]});
        }
        ans[n - 1] = min(ans[n - 1], mn);
    }
    for(int i = 0; i <= n; ++i) {
        cout << ans[i] << endl;
    }
}

signed main () {
    ios_base :: sync_with_stdio(false);
    cin.tie(NULL);
//    freopen("travel_restrictions_input.txt", "r", stdin);
//    freopen("A.out", "w", stdout);
//    int test; cin >> test;
//    for(int t = 1; t <= test; ++t) {
//        cout << "Case #" << t << ":" << endl;
        solve();
//    }
    return 0;
}



Measured memory_bytes: 3188