program pr3
  implicit none
  integer :: n, i, j, k, t
  integer :: f(10000)
  
  read(*,*) n

  do i = 1, int(sqrt(dble(n))) + 1
     do j = 1, int(sqrt(dble(n))) + 1
        do k = 1, int(sqrt(dble(n))) + 1
           t =  i*i + j*j + k*k + i*j + j*k + k*i
           if ( t <= 10000 ) then
              f(t) = f(t) + 1
           end if
        end do
     end do
  end do

  do i = 1, n
     write(*,'(i0)') f(i)
  end do
 
  stop
end program pr3
