Buggy python submission (verdict: Time Limit Exceeded):
import itertools

N = int(input())

def g(x, y, z):
    g_xyz = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
    return g_xyz


list_g_xyz = []
list_f_n = []
N2 = int(N ** (1 /2) / 2) + 1

for x in range(1, N2 + 1):
    break_flg = False
    for y in range(x, N2 + 1):
        for z in range(y, N2 + 1):
            g_xyz = g(x, y, z)
            f_n = len(set(["".join(map(str, v)) for v in itertools.permutations([x, y, z])]))
            list_g_xyz.append(g_xyz)
            list_f_n.append(f_n)
            # print(f'x, y, z = {x}, {y}, {z},  g(x, y, z) = {g_xyz},  f(n) = {f_n}')

            if g_xyz > N:
                break_flg = True
            if break_flg:
                break
        if break_flg:
            break
            
            
list_ans = []
for target in range(1, N + 1):
    list_index = [i for i, x in enumerate(list_g_xyz) if x == target]
    ans = sum([list_f_n[i] for i in list_index])
    print(ans)
    

Fixed submission:
def g(x, y, z):
    g_xyz = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
    return g_xyz


N = int(input())
ans_list = [0 for _ in range(60000)]
for x in range(1, 100):
  for y in range(1, 100):
      for z in range(1, 100):
          ans_list[g(x=x, y=y, z=z) - 1] += 1
           
for i in range(N):
    print(ans_list[i])

Buggy python submission (verdict: Time Limit Exceeded):
import itertools

N = int(input())

def g(x, y, z):
    g_xyz = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
    return g_xyz

list_ans = []

# list_1 = []
list_g_xyz = []
list_f_n = []
N2 = int(N ** (1 /2) / 2) + 1
for x in range(1, N2 + 1):
    for y in range(x, N2 + 1):
        for z in range(y, N2 + 1):
        #   list_1.append([x, y, z])
          list_g_xyz.append(g(x, y, z))
          list_f_n.append(len(set(["".join(map(str, v)) for v in itertools.permutations([x, y, z])])))

# print(list_g_xyz)
# print(list_f_n)

list_ans = []
for target in range(1, N + 1):
    list_index = [i for i, x in enumerate(list_g_xyz) if x == target]
    ans = sum([list_f_n[i] for i in list_index])
    list_ans.append(ans)
    
for i in list_ans:
    print(i)

Fixed submission:
def g(x, y, z):
    g_xyz = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
    return g_xyz


N = int(input())
ans_list = [0 for _ in range(60000)]
for x in range(1, 100):
  for y in range(1, 100):
      for z in range(1, 100):
          ans_list[g(x=x, y=y, z=z) - 1] += 1
           
for i in range(N):
    print(ans_list[i])

Buggy python submission (verdict: Time Limit Exceeded):
import itertools

N = int(input())

def g(x, y, z):
    g_xyz = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
    return g_xyz

list_ans = []

for target in range(1, N + 1):
    # print(f"\n---- target = {target} ----")
    N2 = int(target ** (1 /2) / 2) + 1
    b = 0
    for x in range(1, N2 + 1):
        for y in range(x, N2 + 1):
            for z in range(y, N2 + 1):
            #   print("x, y, z, g(x, y, z) =", x, y, z, g(x, y, z))
              if g(x, y, z) == target:
                #   print("  -> OK!")
                  tmp = ["".join(map(str, v)) for v in itertools.permutations([x, y, z])]
                  a = set(tmp)
                  b = len(a)
    list_ans.append(b)

for i in list_ans:
    print(i)

Fixed submission:
def g(x, y, z):
    g_xyz = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
    return g_xyz


N = int(input())
ans_list = [0 for _ in range(60000)]
for x in range(1, 100):
  for y in range(1, 100):
      for z in range(1, 100):
          ans_list[g(x=x, y=y, z=z) - 1] += 1
           
for i in range(N):
    print(ans_list[i])

Buggy python submission (verdict: Time Limit Exceeded):
import itertools

N = int(input())

def g(x, y, z):
    g_xyz = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
    return g_xyz

N2 = int(N ** (1 /2) / 2) + 1

list_ans = []

for target in range(1, N + 1):
    b = 0
    for x in range(1, N2 + 1):
        for y in range(x, N2 + 1):
            for z in range(y, N2 + 1):
            #   print("x, y, z, g(x, y, z) =", x, y, z, g(x, y, z))
              if g(x, y, z) == target:
                  tmp = ["".join(map(str, v)) for v in itertools.permutations([x, y, z])]
                  a = set(tmp)
                  b = len(a)
    list_ans.append(b)

for i in list_ans:
    print(i)

Fixed submission:
def g(x, y, z):
    g_xyz = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
    return g_xyz


N = int(input())
ans_list = [0 for _ in range(60000)]
for x in range(1, 100):
  for y in range(1, 100):
      for z in range(1, 100):
          ans_list[g(x=x, y=y, z=z) - 1] += 1
           
for i in range(N):
    print(ans_list[i])

Buggy python submission (verdict: Time Limit Exceeded):
import itertools

N = int(input())

def g(x, y, z):
    g_xyz = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
    return g_xyz

N2 = int(N ** (1 /2)) + 1

list_ans = []

for target in range(1, N + 1):
    b = 0
    for x in range(1, N2 + 1):
        for y in range(x, N2 + 1):
            for z in range(y, N2 + 1):
            #   print("x, y, z, g(x, y, z) =", x, y, z, g(x, y, z))
              if g(x, y, z) == target:
                  tmp = ["".join(map(str, v)) for v in itertools.permutations([x, y, z])]
                  a = set(tmp)
                  b = len(a)
    list_ans.append(b)

for i in list_ans:
    print(i)

Fixed submission:
def g(x, y, z):
    g_xyz = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
    return g_xyz


N = int(input())
ans_list = [0 for _ in range(60000)]
for x in range(1, 100):
  for y in range(1, 100):
      for z in range(1, 100):
          ans_list[g(x=x, y=y, z=z) - 1] += 1
           
for i in range(N):
    print(ans_list[i])