#include<iostream>
#include<algorithm>
#include<cmath>

using namespace std;

using ll = long long;

int main() {
	int n;
	cin >> n;
	ll* x = new ll[n] ;
	ll* y = new ll[n];
	ll* p = new ll[n];
	ll* cost = new ll[n + 1];
	for (int i = 0;i < n;i++) {
		cin >> x[i] >> y[i] >> p[i];
		cost[i] = 1e18;
	}
	cost[n] = 1e18;
	long long** tate = new long long*[n];
	long long** yoko = new long long*[n];
	for (int i = 0;i < n;i++) {
		tate[i] = new long long[1 << n];
		yoko[i] = new long long[1 << n];
		for (int j = 0;j < 1 << n;j++) {
			tate[i][j] = abs(x[i]) * p[i];
			yoko[i][j] = abs(y[i]) * p[i];
		}
	}
	// calc tate and yoko
	for (int i = 0;i < n;i++) {
		for (int j = 0;j < 1 << n;j++) {
			for (int k = 0;k < n;k++) {
				if (j & 1 << k) {
					tate[i][j] = min(tate[i][j], abs(x[k] - x[i]) * p[i]);
					yoko[i][j] = min(yoko[i][j], abs(y[k] - y[i]) * p[i]);
				}
			}
		}
	}
	int* ind = new int[n];
	for (int i = 0;i < n;i++) {
		ind[i] = 0;
	}
	bool flag = true;;
	while (flag) {
		//syori
		int ind_tate, ind_yoko;
		ind_tate = ind_yoko = 0;
		int honsu = 0;
		for (int i = 0;i < n;i++) {
			if (ind[i] == 1) {
				ind_tate += 1<<i;
				honsu++;
			}
			if (ind[i] == 2) {
				ind_yoko += 1 << i;
				honsu++;
			}
		}
		ll c = 0;
		for (int i = 0;i < n;i++) {
			c += min(tate[i][ind_tate], yoko[i][ind_yoko]);
		}
		cost[honsu] = min(c, cost[honsu]);
		//ind update
		flag = false;
		for (int i = 0;i < n;i++) {
			if (ind[i] < 2) {
				ind[i]++;
				flag = true;
				break;
			}
			else {
				ind[i] = 0;
			}
		}

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