program XYZTriplets
    implicit none
    
    integer(4) :: n
    integer(4), allocatable :: cnt(:)

    integer(4) :: m, l
    integer(4) :: i, j, k
    read(*, *) n

    m = nint(sqrt(float(n-4)))
    allocate(cnt(1:n))

    cnt(1:n) = 0

    do i = 1, m+1
        do j = 1, m+1
            do k = 1, m+1
                l = i**2 + j**2 + k**2 + i*j + j*k + k*i
                if (l > n) then
                    exit
                end if
                cnt(l) = cnt(l) + 1
            end do
        end do
    end do

    do i = 1, n
        write(*, *) cnt(i)
    end do

    stop

end program XYZTriplets
