#include <vector>
#include <cmath>
#include <functional>
#include <iostream>
using namespace std;
int main() {
    int n; cin >> n;
    long long x[n], y[n], p[n];
    for (int i = 0; i < n; i++) cin >> x[i] >> y[i] >> p[i];
    vector<long long> ans(n+1, 1LL<<60);
    long long memox[1<<n][n], memoy[1<<n][n];
    for (int s = 0; s < 1<<n; s++) {
        for (int i = 0; i < n; i++) {
            long long xx = abs(x[i]), yy = abs(y[i]);
            for (int j = 0; j < n; j++) {
                if ((s >> j) & 1) {
                    yy = min(yy, abs(y[i] - y[j]));
                    xx = min(xx, abs(x[i] - x[j]));
                }
            }
            memox[s][i] = xx * p[i];
            memoy[s][i] = yy * p[i];
        }
    }
    for (int s = 0; s < 1<<n; s++) {
        const int k = __builtin_popcount(s);
        for (int t = s; ; t = (t - 1) & s) {
            long long cost = 0;
            int h = s ^ t;
            for (int i = 0; i < n; i++) {
                cost += min(memox[h][i], memoy[t][i]);
            }
            ans[k] = min(ans[k], cost);
            if (t == 0) break;
        }
    }
    for (int i = 0; i <= n; i++) cout << ans[i] << endl;
}
