#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <array>
#include <cstdio>
#include <cstring>
#include <cmath>
using namespace std;
using ll = long long;

template <class T>
void chmin(T &a, T b) {
    if (b < a) a = b;
}

struct P {
    int x[2], z;
};

int main() {
    int n;
    cin >> n;

    P p[15];
    for (int i = 0; i < n; i++) {
        int x, y, z;
        cin >> x >> y >> z;

        p[i] = { x, y, z };
    }

    vector<array<array<int, 2>, 15>> v(1 << n);
    for (int i = 0; i < n; i++) {
        for (int h = 0; h < 2; h++) {
            v[0][i][h] = min(abs(p[i].x[0]), abs(p[i].x[1]));
        }
    }
    for (int k = 1; k < 1 << n; k++) {
        int i = __builtin_ctz(k);
        auto u = v[k ^ 1 << i];
        for (int j = 0; j < n; j++) {
            for (int h = 0; h < 2; h++) {
                chmin(u[j][h], abs(p[i].x[h] - p[j].x[h]));
            }
        }
        v[k] = u;
    }

    ll r[15 + 1];
    for (int i = 0; i <= n; i++) {
        r[i] = 1LL << 60;
    }

    for (int k = 0; k < 1 << n; k++) {
        for (int l = k; l >= 0; l--) {
            l &= k;
            int m = k ^ l;

            ll s = 0;
            for (int i = 0; i < n; i++) {
                s += (ll)min(v[l][i][0], v[m][i][1]) * p[i].z;
            }
            chmin(r[__builtin_popcount(k)], s);
        }
    }

    for (int i = 0; i <= n; i++) {
        cout << r[i] << endl;
    }

    return 0;
}