Buggy python submission (verdict: Runtime Error):
N=int(input())
ans=[0]*N
for x in range(1,N+1):
    if x**2>N:
        break
    for y in range(x,N+1):
        if x**2+y**2>N:
            break
        for z in range(y,N+1):
            if x**2+y**2+z**2>N:
                break
            if x**2+y**2+z**2+x*y+y*z+z*x<=N+1:
                ans[x**2+y**2+z**2+x*y+y*z+z*x-1]=3
if N>=6:
    ans[5]=1
for i in ans:
    print(i)

Fixed submission:
from itertools import permutations
N=int(input())
ans=[0]*(10**6)
for x in range(1,N+1):
    if x**2>N:
        break
    for y in range(1,N+1):
        if x**2+y**2>N:
            break
        for z in range(1,N+1):
            if x**2+y**2+z**2>N:
                break
            else:
                kari=[x,y,z]
                #print(kari)
                if x**2+y**2+z**2+x*y+y*z+z*x<=10**5:
                    ans[x**2+y**2+z**2+x*y+y*z+z*x-1]+=1
                    
for i in range(N):
    print(ans[i])

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
ans=[0]*N
for i in range(1,N+1):
    for x in range(1,N+1):
        if x**2>i:
            break
        for y in range(x,N+1):
            if x**2+y**2>i:
                break
            for z in range(y,N+1):
                if x**2+y**2+z**2>i:
                    break
                if x**2+y**2+z**2+x*y+y*z+z*x==i:
                    ans[i-1]=3
if N>=6:
    ans[5]=1
for i in ans:
    print(i)

Fixed submission:
from itertools import permutations
N=int(input())
ans=[0]*(10**6)
for x in range(1,N+1):
    if x**2>N:
        break
    for y in range(1,N+1):
        if x**2+y**2>N:
            break
        for z in range(1,N+1):
            if x**2+y**2+z**2>N:
                break
            else:
                kari=[x,y,z]
                #print(kari)
                if x**2+y**2+z**2+x*y+y*z+z*x<=10**5:
                    ans[x**2+y**2+z**2+x*y+y*z+z*x-1]+=1
                    
for i in range(N):
    print(ans[i])

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
ans=[0]*N
if N>=6:
    ans[5]=1
for i in range(1,N+1):
    for x in range(1,N+1):
        if x**2>i:
            break
        for y in range(1,N+1):
            if x**2+y**2>i:
                break
            for z in range(1,N+1):
                if x**2+y**2+z**2>i:
                    break
                if x**2+y**2+z**2+x*y+y*z+z*x==i and i!=6:
                    ans[i-1]=3
for i in ans:
    print(i)

Fixed submission:
from itertools import permutations
N=int(input())
ans=[0]*(10**6)
for x in range(1,N+1):
    if x**2>N:
        break
    for y in range(1,N+1):
        if x**2+y**2>N:
            break
        for z in range(1,N+1):
            if x**2+y**2+z**2>N:
                break
            else:
                kari=[x,y,z]
                #print(kari)
                if x**2+y**2+z**2+x*y+y*z+z*x<=10**5:
                    ans[x**2+y**2+z**2+x*y+y*z+z*x-1]+=1
                    
for i in range(N):
    print(ans[i])

Buggy python submission (verdict: Runtime Error):
N=int(input())
ans=[0]*N
ans[5]=1
for i in range(1,N+1):
    for x in range(1,N+1):
        if x**2>i:
            break
        for y in range(1,N+1):
            if x**2+y**2>i:
                break
            for z in range(1,N+1):
                if x**2+y**2+z**2>i:
                    break
                if x**2+y**2+z**2+x*y+y*z+z*x==i:
                    ans[i-1]=3




for i in ans:
    print(i)

Fixed submission:
from itertools import permutations
N=int(input())
ans=[0]*(10**6)
for x in range(1,N+1):
    if x**2>N:
        break
    for y in range(1,N+1):
        if x**2+y**2>N:
            break
        for z in range(1,N+1):
            if x**2+y**2+z**2>N:
                break
            else:
                kari=[x,y,z]
                #print(kari)
                if x**2+y**2+z**2+x*y+y*z+z*x<=10**5:
                    ans[x**2+y**2+z**2+x*y+y*z+z*x-1]+=1
                    
for i in range(N):
    print(ans[i])