def resultNumber(n)
  cnt = 0
  for i in 1..100
    if i**2 > i
      next
    end
    for j in 1..100
      if j**2 > j
      	next
      end
      for k in 1..100
        if k**2 > k
      	  next
        end
        if i**2 + j**2 + k**2 + i*j + j*k + k*i == n
          cnt += 1
        end
      end
    end
  end
  p cnt
end

f = gets.to_i
for i in 1..f
  resultNumber(i)
end