#include <vector>
#include <iostream>
#include <algorithm>
std::vector<long long> solve(int N, std::vector<int> X, std::vector<int> Y, std::vector<int> P) {
	const long long inf = 1LL << 62;
	int mul = 1;
	for (int i = 0; i < N; ++i) {
		mul *= 3;
	}
	std::vector<std::vector<int> > xsel(1 << N, std::vector<int>(N));
	std::vector<std::vector<int> > ysel(1 << N, std::vector<int>(N));
	for (int i = 0; i < 1 << N; ++i) {
		for (int j = 0; j < N; ++j) {
			xsel[i][j] = std::abs(X[j]);
			ysel[i][j] = std::abs(Y[j]);
			for (int k = 0; k < N; ++k) {
				if ((i >> k) & 1) {
					xsel[i][j] = std::min(xsel[i][j], std::abs(X[j] - X[k]));
					ysel[i][j] = std::min(ysel[i][j], std::abs(Y[j] - Y[k]));
				}
			}
		}
	}
	std::vector<long long> ans(N + 1, inf);
	for (int i = 0; i < 1 << N; ++i) {
		int cnt = 0;
		for (int j = 0; j < N; ++j) {
			if ((i >> j) & 1) ++cnt;
		}
		for (int j = i; j >= 0; --j) {
			j &= i;
			long long cost = 0;
			for (int k = 0; k < N; ++k) {
				if (!((i >> k) & 1)) {
					cost += 1LL * std::min({ xsel[j][k], ysel[i - j][k] }) * P[k];
				}
			}
			ans[cnt] = std::min(ans[cnt], cost);
		}
	}
	return ans;
}
int main() {
	int N;
	std::cin >> N;
	std::vector<int> X(N), Y(N), P(N);
	for (int i = 0; i < N; ++i) {
		std::cin >> X[i] >> Y[i] >> P[i];
	}
	std::vector<long long> ans = solve(N, X, Y, P);
	for (int i = 0; i <= N; ++i) {
		std::cout << ans[i] << std::endl;
	}
	return 0;
}
