#include <bits/stdc++.h>
using namespace std;

const int MAXN = 20;

int n, x[MAXN], y[MAXN];
long long p[MAXN], dp1[1 << 15], dp[MAXN][1 << 15];

int main(){
	scanf("%d", &n);
	for(int i = 0; i < n; i++)
		scanf("%d %d %lld", &x[i], &y[i], &p[i]);
	
	for(int mask = 0; mask < (1 << n); mask++){
		if(mask == 0)dp1[mask] = 0;
		else{
			dp1[mask] = 1LL << 50;
			for(int i = 0; i < n; i++)if(mask & (1 << i)){
				long long r0 = 0, r1 = 0;
				for(int j = 0; j < n; j++)if(mask & (1 << j)){
					int d = min(abs(x[j]), abs(y[j]));
					r0 += p[j] * min(d, abs(x[j] - x[i]));
					r1 += p[j] * min(d, abs(y[j] - y[i]));
				}
				dp1[mask] = min(dp1[mask], min(r0, r1));
			}
		}
	}
	
	for(int k = 0; k <= n; k++)
	for(int mask = 0; mask < (1 << n); mask++){
		dp[k][mask] = 0;
		for(int i = 0; i < n; i++)if(mask & (1 << i)){
			dp[k][mask] += p[i] * min(abs(x[i]), abs(y[i]));
		}
		
		if(k > 0){
			for(int sub = mask; sub > 0; sub = (sub - 1) & mask){
				dp[k][mask] = min(dp[k][mask], dp[k - 1][mask ^ sub] + dp1[sub]);
			}
		}
	}
	
	for(int k = 0; k <= n; k++){
		printf("%lld\n", dp[k][(1 << n) - 1]);
	}
	
	return 0;
}
