program ms_solution
  implicit none
  integer(8), parameter :: inf = 1e16
  integer :: n, i, j, k, l, u
  integer(8) :: x(15) = 0, y(15) = 0, p(15) = 0
  integer(8) :: mx(0:2 ** 15, 15) = inf, my(0:2 ** 15, 15) = inf
  integer(8) :: m(0:15) = inf
  logical :: used(0:2 ** 15)
  read(*,*) n
  do i = 1, n
    read(*,*) x(i), y(i), p(i)
  end do
  do i = 1, n
    mx(:, i) = min(abs(x(i)), abs(y(i))) * p(i)
    my(:, i) = mx(:, i)
  end do
  u = lshift(1, n) - 1
  do i = 0, u
    do j = 1, n
      if (.not.btest(i, j - 1)) cycle
      do l = 1, n
        mx(i, l) = min(mx(i, l), abs(x(l) - x(j)) * p(l))
        my(i, l) = min(my(i, l), abs(y(l) - y(j)) * p(l))
      end do
    end do
  end do
  call dfs(0, 0, 1)
  do i = 0, n
    write(*,'(i0)') m(i)
  end do
contains
  recursive subroutine dfs(ix, iy, cnt)
    integer, intent(in) :: ix, iy, cnt
    integer :: k, i, j
    if (cnt == n + 1) then
      k = popcnt(ix) + popcnt(iy)
      m(k) = min(m(k), sum(min(mx(ix, 1:n), my(iy, 1:n))))
      return
    end if
    call dfs(ibset(ix, cnt - 1), iy, cnt + 1)
    call dfs(ix, ibset(iy, cnt - 1), cnt + 1)
    call dfs(ix, iy, cnt + 1)
  end
end program ms_solution