"use strict"
function main(arg) {
    let N = arg.trim().split("\n")[0]
    N = Number(N)
    let ans = (new Array(N + 1)).fill(0)
    const MAX = 10e4
    for (let i = 1; i < MAX; i++) {
        let t = fx(i,i,i)
        if (t > N) {
            break
        }
        ans[t] = 1
    }
    for (let i = 1; i < MAX; i++) {
        let j = 1
        for (j = 1; j < MAX; j++) {
            if (i === j) continue
            let t = fx(i,j,j)
            if (t > N) {
                break
            }
            ans[t] = 3
        }
        if (j===1) {
            break
        }
    }
    for (let i = 1; i < MAX; i++) {
        let j = 1
        for (j = 1; j < MAX; j++) {
            if (i === j) continue
            let k = 1;
            for (k = 1; k < MAX; k++) {
                if (k === i || k === j) continue
                let t = fx(i,j,k)
                if (t > N) {
                    break
                }
                ans[t] = 6
            }
            if (k === 1) {
                break
            }
        }
        if (j === 1) {
            break
        }
    }

    ans.shift()
    console.log(ans.join("\n"))
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));

function fx(x,y,z) {
    return x * x  + y * y + z * z + x * y + y * z + z * x 
}