using System;
using CompLib.Util;

public class Program
{
    private int N;
    private long[] X, Y, P;

    private long[][] Cost;

    private long[] Ans;

    private long Sum;

    public void Solve()
    {
        var sc = new Scanner();
        N = sc.NextInt();
        X = new long[N];
        Y = new long[N];
        P = new long[N];
        for (int i = 0; i < N; i++)
        {
            X[i] = sc.NextInt();
            Y[i] = sc.NextInt();
            P[i] = sc.NextInt();
        }

        Sum = 0;
        Cost = new long[N + 1][];
        for (int i = 0; i <= N; i++)
        {
            Cost[i] = new long[N];
        }

        for (int i = 0; i < N; i++)
        {
            Cost[0][i] = Math.Min(Math.Abs(X[i]), Math.Abs(Y[i])) * P[i];
            Sum += Cost[0][i];
        }

        Ans = new long[N + 1];
        for (int i = 0; i <= N; i++)
        {
            Ans[i] = long.MaxValue;
        }

        Go(0, 0);

        Console.WriteLine(string.Join("\n", Ans));
    }

    void Go(int n, int k)
    {
        Ans[k] = Math.Min(Ans[k], Sum);
        if (k < N && n < N)
        {
            // 何もしない
            Array.Copy(Cost[n], Cost[n + 1], N);
            Go(n + 1, k);
            long diff = 0;
            // 縦
            for (int i = 0; i < N; i++)
            {
                Cost[n + 1][i] = Math.Min(Cost[n][i], Math.Abs(X[n] - X[i]) * P[i]);
                diff += Cost[n + 1][i] - Cost[n][i];
            }

            Sum += diff;
            Go(n + 1, k + 1);
            Sum -= diff;
            diff = 0;
            // 横
            for (int i = 0; i < N; i++)
            {
                Cost[n + 1][i] = Math.Min(Cost[n][i], Math.Abs(Y[n] - Y[i]) * P[i]);
                diff += Cost[n + 1][i] - Cost[n][i];
            }

            Sum += diff;
            Go(n + 1, k + 1);
            Sum -= diff;
        }
    }

    public static void Main(string[] args) => new Program().Solve();
}

namespace CompLib.Util
{
    using System;
    using System.Linq;

    class Scanner
    {
        private string[] _line;
        private int _index;
        private const char Separator = ' ';

        public Scanner()
        {
            _line = new string[0];
            _index = 0;
        }

        public string Next()
        {
            while (_index >= _line.Length)
            {
                _line = Console.ReadLine().Split(Separator);
                _index = 0;
            }

            return _line[_index++];
        }

        public int NextInt() => int.Parse(Next());
        public long NextLong() => long.Parse(Next());
        public double NextDouble() => double.Parse(Next());
        public decimal NextDecimal() => decimal.Parse(Next());
        public char NextChar() => Next()[0];
        public char[] NextCharArray() => Next().ToCharArray();

        public string[] Array()
        {
            _line = Console.ReadLine().Split(Separator);
            _index = _line.Length;
            return _line;
        }

        public int[] IntArray() => Array().Select(int.Parse).ToArray();
        public long[] LongArray() => Array().Select(long.Parse).ToArray();
        public double[] DoubleArray() => Array().Select(double.Parse).ToArray();
        public decimal[] DecimalArray() => Array().Select(decimal.Parse).ToArray();
    }
}

Measured memory_bytes: 27748