Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys


def max_heapify(index):
    # global heap_length
    left, right, largest = 2 * index, 2 * index + 1, None

    if left <= heap_length and heap_array[left] > heap_array[index]:
        largest = left
    else:
        largest = index

    if right <= heap_length and heap_array[right] > heap_array[largest]:
        largest = right

    if largest != index:
        heap_array[index], heap_array[largest] = heap_array[largest], heap_array[index]
        max_heapify(largest)

    return None


def extract():
    global heap_length
    if heap_length < 1:
        raise SystemExit('Heap underflow!')
    # the root of the heap is always the largest
    heap_max = heap_array[1]

    # move new data to heap root
    heap_array[1] = heap_array[heap_length]
    heap_length -= 1

    # print
    heap_array.pop()
    print(heap_max)
    max_heapify(1)
    # assert len(heap_array) == heap_length + 1
    return heap_max


def insert(data):
    global heap_length
    heap_length += 1
    heap_array.append(-1)
    # assert len(heap_array) == heap_length + 1
    insert_data(heap_length, data)


def insert_data(index, data):
    if data < heap_array[index]:
        raise SystemExit('Not a max-heap!')
    heap_array[index] = data
    while index > 1:
        parent = index // 2
        if heap_array[parent] >= heap_array[index]:
            break
        heap_array[index], heap_array[parent] = heap_array[parent], heap_array[index]
        index //= 2
    return None


def action(_command):
    if _command.startswith('in'):
        insert(int(each[7:]))
    elif _command.startswith('ex'):
        extract()

    return None


if __name__ == '__main__':
    _input = sys.stdin.readlines()
    # command_list = list(map(lambda x: x.split(), _input))

    # allowed_commands = ('insert', 'extract', 'end')
    heap_array, heap_length = [-1], 0
    for each in _input:
        # command, content = each[0], each[-1]
        # if command not in allowed_commands:
        #     raise SystemExit('Illegal command!')

        action(each)

### FIXED CODE ###

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import sys
import heapq as hp

if __name__ == '__main__':
    _input = sys.stdin.readlines()

    heap_array = []
    for each in _input:
        if each.startswith('in'):
            hp.heappush(heap_array, -1 * int(each[7:]))
        elif each.startswith('ex'):
            print(-1 * hp.heappop(heap_array))
### BUGGY CODE ###

a=input()
b=input()

def swap(word,x,y):
	word=word.replace(x,'+')
	word=word.replace(y,'-')
	word=word.replace('+',y)
	word=word.replace('-',x)
	return word
	
for i in range(len(a)):
	if a[i] != b[i]:
		a=swap(a,a[i],b[i])

if a == b:
	print('Yes')
else:
	print('No')
    

### FIXED CODE ###

a=input()
b=input()

memo = []

def swap(word,x,y):
	word=word.replace(x,'+')
	word=word.replace(y,'-')
	word=word.replace('+',y)
	word=word.replace('-',x)
	return word
	
for i in range(len(a)):
	if a[i] != b[i]:
		if a[i] in memo or b[i] in memo:
			print('No')
			break
		else:
			a=swap(a,a[i],b[i])
			memo.append(a[i])
			memo.append(b[i])
	
else:
	if a==b:
		print('Yes')
	else:
		print('No')
### BUGGY CODE ###

from collections import deque
n,k=map(int,input().split())
td=sorted([list(map(int,input().split())) for i in range(n)],reverse=True,key=lambda x:x[1])

ans=0
kinds=dict()
for i in range(k):
    ans+=td[i][1]
    if td[i][0] in kinds:
        kinds[td[i][0]].append(td[i][1])
    else:
        kinds[td[i][0]]=deque()
        kinds[td[i][0]].append(td[i][1])
ans+=(len(kinds)**2)

ans_=[ans]
for i in range(k,n):
    if td[i][0] not in kinds:
        mi=[1000000000,1000000000]
        for j in kinds:
            if len(kinds[j])>1:
                if mi[1]>kinds[j][-1]:
                    mi=[j,kinds[j][-1]]
        if mi==[1000000000,1000000000]:
            break
        else:
            ans=ans-len(kinds)**2+(len(kinds)+1)**2-mi[1]+td[i][1]
            kinds[mi[0]].pop()
            kinds[td[i][0]]=deque()
            kinds[td[i][0]].append(td[i][1])
            ans_.append(ans)

print(max(ans_))


### FIXED CODE ###

n,k=map(int,input().split())
td=sorted([list(map(int,input().split())) for i in range(n)],reverse=True,key=lambda x:x[1])

ans=0
kl=dict()
for i in range(k):
    ans+=td[i][1]
    if td[i][0] in kl:
        kl[td[i][0]]+=1
    else:
        kl[td[i][0]]=1
l=len(kl)
ans+=(l**2)
ans_=ans
now=k-1
for i in range(k,n):
    if td[i][0] not in kl:
        #最小を求めるのをもっと早く
        while now>=0:
            if kl[td[now][0]]>1:
                mi=td[now]
                kl[mi[0]]-=1
                now-=1
                break
            now-=1
        if now==-1:
            break
        else:
            ans=ans+2*l+1-mi[1]+td[i][1]
            kl[td[i][0]]=1
            ans_=max(ans,ans_)
            l+=1

print(ans_)
### BUGGY CODE ###

import sys
input = sys.stdin.readline

def main():
    n = int(input())
    a_li = list(map(int, input().strip().split()))

    a_set = set(a_li)

    a_dict = {}

    for i in range(1, n+1):
        if i in a_set:
            print(a_li.count(i))
        else:
            print(0)

if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
input = sys.stdin.readline

def main():
    n = int(input())
    a_li = list(map(int, input().strip().split()))

    a_dict = {}

    for a in a_li:
        if str(a) in a_dict:
            a_dict[str(a)] += 1
        else:
            a_dict[str(a)] = 1

    for i in range(1, n+1):
        if str(i) in a_dict:
            print(a_dict[str(i)])
        else:
            print(0)

if __name__ == '__main__':
    main()
### BUGGY CODE ###

import sys
sys.setrecursionlimit(10000000)
 
N = int(input())
H = list(list(map(int,input().split())) for _ in range(N))
#sub problem: max cost from 0 to ith day
memo = {}
def rec(i, choice):
  if (i, choice) in memo:
    return memo[(i, choice)]
  if i == len(H):
    return 0
  m = max(H[i][j] + rec(i+1,j) for j in range(3) if j != choice)
  memo[(i, choice)] = m
  return m
print(max(rec(0, j) for j in range(3)))

### FIXED CODE ###

import sys
sys.setrecursionlimit(10000000)
 
N = int(input())
H = list(list(map(int,input().split())) for _ in range(N))
#sub problem: max cost from 0 to ith day
memo = {}
def rec(i, choice):
  if (i, choice) in memo:
    return memo[(i, choice)]
  if i == len(H):
    return 0
  m = max(H[i][j] + rec(i+1,j) for j in range(3) if j != choice)
  memo[(i, choice)] = m
  return m
print(max(rec(0, j) for j in range(3)))
### BUGGY CODE ###

def f_e():
    n = int(input())
    s = input()
    a = 0
    for si in range(n):
        s1, s2 = s[:si], s[si:]
        dp = [[0]*(len(s2)+1) for _ in range(len(s1)+1)]
        for i in range(len(s1)):
            for j in range(len(s2)):
                if s1[i]==s2[j]:
                    dp[i+1][j+1] = dp[i][j]+1
                else:
                    dp[i+1][j+1] = max(dp[i][j+1], dp[i+1][j])
        a = dp[-1][-1] if dp[-1][-1]>a else a
    print(a)

if __name__ == "__main__":
    f_e()


### FIXED CODE ###

def f_e_dp():
    n = int(input())
    s = input()
    dp = [[0]*(n+1) for _ in range(n+1)]
    for i in reversed(range(n)):
        for j in reversed(range(n)):
            if s[i]==s[j] and i<j:
                dp[i][j] = dp[i+1][j+1]+1
    a = 0
    for i in range(n):
        for j in range(n):
            if i<j:
                a = max(a, min(j-i, dp[i][j]))
    print(a)

if __name__ == "__main__":
    f_e_dp()
### BUGGY CODE ###

N,M = map(int,input().split())
a_list = []
b_list = []
c_list = []
for _ in range(M):
    a, b = map(int,input().split())
    c = list(map(int,input().split()))
    c = [cc-1 for cc in c]
    a_list.append(a)
    b_list.append(b)
    c_list.append(c)


takara_keys = {}
for i in range(N):
    takara = []
    for idx, c in enumerate(c_list):
        if i in c:
            takara.append(idx)
    takara_keys[i] = takara

clear = [1 for _ in range(N)]
def dp(memos, cost):
    if memos == clear:
        return cost
    costs = [10**9]
    for takara, memo in enumerate(memos):
        hoge_flg = 0
        if memo == 0:
            hoge_flg = 1
            next_keys = takara_keys[takara]
            for key in next_keys:
                tmp_memos = memos[:]
                for takara_idx in c_list[key]:
                    tmp_memos[takara_idx] = 1
                tmp_cost = cost + a_list[key]
                costs.append(dp(tmp_memos,tmp_cost))
        if hoge_flg == 1:
            break
    return min(costs)

length_0_flag = False
for v in takara_keys.values():
    if len(v)==0:
        length_0_flag = True

if length_0_flag:
    print(-1)
else:
    print(dp([0 for _ in range(N)],0))

### FIXED CODE ###

#解説放送見てからの書き直し
import sys
import os
INF = 10**12
ans = INF
N, M = map(int,input().split())
A = [0 for _ in range(M)]
B = [0 for _ in range(M)]
C = []
for i in range(M):
    a, b = map(int,input().split())
    A[i] = a  #鍵の金額
    B[i] = b  #開けられる宝箱の種類数
    tmp = list((map(int,input().split())))
    s = 0
    for j in range(b):
        t = tmp.pop(0)-1
        s |= 1 << t
    C.append(s)
    
dp = [INF]*(1<<N) #2^N
dp[0] = 0 #0 = 0b0000の時、スコアは0（まだ1つも鍵を購入してないので）

for s in range(1<<N): #1<<Nは2^N。つまりどの宝箱が開くかの全ての状態
    for j in range(M): # 全ての鍵について見ていく
        t = s | C[j] # 論理和。sには現在どの宝箱が開けられるかの状態、
                     # C[j]にはその新たな鍵が開ける宝箱。
                     # その論理和はこれまでの鍵と新たな鍵でどの宝箱が開けられるか
        cost = dp[s] + A[j] # その鍵を買った時のコスト
        dp[t] = min(dp[t],cost) #新たな宝箱の状態について、コストがより低くなるようなら保存する。
ans = dp[-1] #dp[-1]、つまり0b1111。宝箱が全て開けられる状態。
if ans == INF: #もし0b1111がINFのまま（最初から変わってない）ということはそこにたどり着けなかったということ。
               #つまり、全ての鍵を使っても宝箱を開けられなかった。
    ans = -1
print(ans)
### BUGGY CODE ###

import bisect
n,m = map(int,input().split())
l = list(map(int,input().split()))
l.sort()
right = 2*10**5+5
left = 0

while right - left >1:
    mid = (right+left+1)//2
    
    x = 0
    for i in range(n):
        a = l[i]
        index = bisect.bisect_left(l,mid-a)
        x += n-index
   
    if x >= m:
        left = mid
    else:
        right = mid
ans = []
for i in range(n):
    a = l[i]
    for j in range(n):
        if a + l[j] >= left:
            ans.append(a+l[j])
ans.sort(reverse=True)

print(sum(ans[0:m]))



### FIXED CODE ###

def main():
    import bisect
    import numpy as np
    n,k = map(int,input().split())
    l = list(map(int,input().split()))
    l.sort()
    l1 = np.array(l)
    def bise(x):
        y = np.searchsorted(l1,x-l1)
        return n*n-y.sum()

    left = -1
    right = l[-1]*2+1

    while right > left+1:
        mid = (right+left)//2
        
        if bise(mid) >= k:
            left = mid
        else:
            right = mid
    ans = 0
    count = 0
    acc = [0]
    for i in l:
        acc.append(acc[-1]+i)
    for i in l:
        index = bisect.bisect_left(l,right-i)
        ans += i*(n-index) + acc[n]-acc[index]
        count += n-index

    print(ans-(count-k)*left)
if __name__ == "__main__":
    main()
### BUGGY CODE ###

a, b, m = map(int, input().split())
priceOfMicrowaves = list(map(int, input().split()))
priceOfRefrigerators = list(map(int, input().split()))
priceTable = [list(map(int,input().split())) for i in range(m)]
cheepest = priceOfMicrowaves[0] + priceOfRefrigerators[0]
for price in priceTable:
    if priceOfMicrowaves[price[0]-1]-price[2] >= cheepest:
        continue
    elif priceOfRefrigerators[price[1]-1]-price[2] >= cheepest:
        continue
    elif priceOfMicrowaves[price[0]-1]+priceOfRefrigerators[price[1]-1]-price[2] < cheepest:
        cheepest = priceOfMicrowaves[price[0]-1]+priceOfRefrigerators[price[1]-1]-price[2]
for p in priceOfMicrowaves:
    if p >= cheepest:
        continue
    for q in priceOfRefrigerators:
        if q >= cheepest:
            continue
        if p + q < cheepest:
            cheepest = p + q
print(cheepest)

### FIXED CODE ###

a, b, m = map(int, input().split())
priceOfMicrowaves = list(map(int, input().split()))
priceOfRefrigerators = list(map(int, input().split()))
priceTable = [list(map(int,input().split())) for i in range(m)]
cheepest = priceOfMicrowaves[0] + priceOfRefrigerators[0]
for price in priceTable:
    if priceOfMicrowaves[price[0]-1]-price[2] >= cheepest:
        continue
    elif priceOfRefrigerators[price[1]-1]-price[2] >= cheepest:
        continue
    elif priceOfMicrowaves[price[0]-1]+priceOfRefrigerators[price[1]-1]-price[2] < cheepest:
        cheepest = priceOfMicrowaves[price[0]-1]+priceOfRefrigerators[price[1]-1]-price[2]
if cheepest > min(priceOfMicrowaves) + min(priceOfRefrigerators):
    cheepest = min(priceOfMicrowaves) + min(priceOfRefrigerators)
print(cheepest)
### BUGGY CODE ###

s = list(input())

s_split = []
tmp = []
for i in range(len(s) - 1):
    tmp.append(s[i])
    if s[i] == 'L' and s[i + 1] == 'R':
        s_split.append(tmp)
        tmp = []
tmp.append(s[-1])
s_split.append(tmp)

out = ''
for _split in s_split:
    for i in range(len(_split) - 1):
        if _split[i] == 'R' and _split[i + 1] == 'L':
            idx = i

    tmp = [0] * len(_split)
    if len(_split) % 2 == 0:
        for i in range(len(_split)):
            tmp[idx] = len(_split) // 2
            tmp[idx + 1] = len(_split) // 2

    else:
        r_int = 0
        l_int = 0
        for i in range(len(_split)):
            dist = abs(idx - i)
            if dist % 2 == 0:
                r_int += 1
            else:
                l_int += 1
        tmp[idx] = r_int
        tmp[idx + 1] = l_int

    for i in range(len(_split)):
        out += ' ' + str(tmp[i])

print(out[1:])


### FIXED CODE ###

s = list(input())

s_split = []
tmp = []
idx_all = []
l = -1
for i in range(len(s) - 1):
    tmp.append(s[i])
    if s[i] == 'R' and s[i + 1] == 'L':
        idx_all.append(i - l - 1)
    if s[i] == 'L' and s[i + 1] == 'R':
        s_split.append(tmp)
        tmp = []
        l = i
tmp.append(s[-1])
s_split.append(tmp)

out = ''
for a in range(len(s_split)):
    idx = idx_all[a]
    _split = s_split[a]

    if len(_split) % 2 == 0:
        r_int = len(_split) // 2
        l_int = len(_split) // 2

    else:
        if idx % 2 == 1:
            r_int = (len(_split) - 1) // 2
            l_int = (len(_split) + 1) // 2

        else:
            l_int = (len(_split) - 1) // 2
            r_int = (len(_split) + 1) // 2

    out += ' 0' * idx
    out += ' ' + str(r_int)
    out += ' ' + str(l_int)
    out += ' 0' * (len(_split) - idx - 2)

print(out[1:])
### BUGGY CODE ###

from collections import defaultdict
N,C = map(int,input().split())
D = [list(map(int,input().split())) for _ in range(C)]
c = [list(map(int,input().split())) for _ in range(N)]

strange = [defaultdict(lambda:0) for _ in range(3)]
for i in range(N):
    for j in range(N):
        for color in range(C):
            strange[(i+j)%3][color] += D[c[i][j]-1][color]

ans = 1000*N**2
ref = 0
for c1 in range(C):
    for c2 in range(C):
        for c3 in range(C):
            if c1 != c2 and c2 != c3 and c3 != c1:
                ans = min(ans,strange[0][c1]+strange[1][c2]+strange[2][c3])
print(ans)

### FIXED CODE ###

import numpy as np
D = []
c = []
d0 = {}
d1 = {}
d2 = {}

N,C = map(int,input().split())
a = np.zeros((3,C))
for i in range(C):
    D.append(list(map(int,input().split())))
for i in range(N):
    c.append(list(map(int,input().split())))

D = np.array(D)
c = np.array(c)

for i in range(N):
    for j in range(N):
        a[(i+j)%3] += D[c[i][j]-1]

l = []
for C1 in range(C):
    for C2 in range(C):
        for C3 in range(C):
            if C1 != C2 and C2 != C3 and C3 != C1:
                l.append(a[0][C1]+a[1][C2]+a[2][C3])

print(int(min(l)))
### BUGGY CODE ###

import numpy as np
n = int(input())
A = [[ord(i) for i in input()] for j in range(n)]
count = 0
for a in range(n):
    for b in range(n):
        arr = np.roll(A, a, axis=0)
        arr = np.roll(arr, b, axis=1)
        if np.allclose(arr,arr.T):
            count += 1
print(count)

### FIXED CODE ###

n = int(input())
A = [input() for _ in range(n)]
# AT = list(map(''.join,zip(*A)))
count = 0
for a in range(n):
    arr = A[a:][:] + A[:a][:]
    arrT = list(map(''.join, zip(*arr)))
    for i in range(n):
        if arr[i][i+1:] != arrT[i][i+1:]:
            break
    else:
        count += n
print(count)
### BUGGY CODE ###

# D - Equals

import sys
from collections import deque

N, M = map(int, sys.stdin.readline().split())
p = list(map(int, sys.stdin.readline().split()))
xy = sys.stdin.readlines()

neighbor = [[] for _ in range(N)]
for idx in range(M):
    x,y = map(int, xy[idx].split())
    neighbor[x-1].append(y-1)
    neighbor[y-1].append(x-1)
    
can_swap = []
visited = [-1]*N

for start in range(N):
    if visited[start] == -1:
        tmp = [start] # startから到達可能なpointのリスト
        d = deque([start])
        while d:
            current_point = d.pop()
            visited[current_point] = 1
            for next_point in neighbor[current_point]:
                if visited[next_point] == -1:
                    d.append(next_point)
                    tmp.append(next_point)
        can_swap.append(tmp)                

ans = 0
for idx_group in can_swap:
    tmp_p = [p[idx]-1 for idx in idx_group]
    ans += len(set(tmp_p) & set(idx_group))

print(ans)

### FIXED CODE ###

# D - Equals

from collections import deque

N, M = map(int, input().split())
p = list(map(int, input().split()))
xy = [list(map(int, input().split())) for _ in range(M)]

neighbor = [[] for _ in range(N)]
for idx in range(M):
    neighbor[xy[idx][0]-1].append(xy[idx][1]-1)
    neighbor[xy[idx][1]-1].append(xy[idx][0]-1)
    
can_swap = []
visited = [-1]*N

for start in range(N):
    if visited[start] == -1:
        tmp = [start] # startから到達可能なpointのリスト
        d = deque([start])
        while d:
            current_point = d.pop()
            visited[current_point] = 1
            for next_point in neighbor[current_point]:
                if visited[next_point] == -1:
                    d.append(next_point)
                    tmp.append(next_point)
        can_swap.append(tmp)                

ans = 0
for idx_group in can_swap:
    tmp_p = [p[idx]-1 for idx in idx_group]
    ans += len(set(tmp_p) & set(idx_group))

print(ans)
### BUGGY CODE ###

n=int(input())
p=list(map(int,input().split()))
l=[p[0]]
for i in range(1,n):
	l.append(p[i])
	flag="True"
	for j in range(i):
		if flag=="True":
			if p[i]>p[j]:
				l.remove(p[i])
				flag="False"
print(len(l))


### FIXED CODE ###

n=int(input())
p=list(map(int,input().split()))
a=p[0]
cnt=1
for i in range(1,n):
	if p[i]<a:
		cnt+=1
		a=p[i]
print(cnt)
### BUGGY CODE ###

n = int(input())
dp = [0 for i in range(n+1)]
maxn = 201
for x in range(1,maxn):
    for y in range(1,maxn):
        for z in range(1,maxn):
            p = (x+y+z)**2
            p-=(x*y + y*z + z*x)
            if p<=n:
                dp[p]+=1
for i in dp[1::]:
    print(i)

### FIXED CODE ###

n = int(input())
dp = [0 for i in range(n+1)]
maxn = n**0.5
maxn = int(maxn)+1
for x in range(1,maxn):
    for y in range(1,maxn):
        for z in range(1,maxn):
            p = x*x + y*y + z*z + x*y + y*z +z*x
            if p<=n:
                dp[p]+=1
for i in dp[1::]:
    print(i)
### BUGGY CODE ###

def main():
    sts=input()
    n= len(sts)
    s = []
    for c in sts:
        s.append(c)

    dp = [[0 for _ in range(100005)]for _ in range(13)]

    ss = s[0]
    if ss == '?':
        for i in range(10):
            dp[i][0] = 1
    else:
        ss = int(ss)
        dp[ss][0] = 1

    for i in range(1,n):
        ss = s[i]
        if ss == "?":
            for k in range(10):
                for j in range(13):
                    dp[(j * 10 +k) % 13][i] += dp[j][i-1]
        else:
            for j in range(13):
                dp[(j * 10 +int(ss)) % 13][i] += dp[j][i-1]

    print(dp[5][n-1] % (10**9+7))

main()

### FIXED CODE ###

def main():
    sts=input()
    n= len(sts)
    mod = 10**9+7
    s = []
    for c in sts:
        s.append(c)

    dp = [[0 for _ in range(13)]for _ in range(n)]

    ss = s[0]
    if ss == '?':
        for i in range(10):
            dp[0][i] = 1
    else:
        ss = int(ss)
        dp[0][ss] = 1

    for i in range(1,n):
        ss = s[i]
        if ss == "?":
            for k in range(10):
                for j in range(13):
                    dp[i][(j * 10 +k) % 13] += dp[i-1][j]
        else:
            for j in range(13):
                dp[i][(j * 10 +int(ss)) % 13] += dp[i-1][j]
        for j in range(13):
            dp[i][j]%= mod


    print(dp[n-1][5])

main()
### BUGGY CODE ###

s=input()
k=int(input())
n=len(s)
print(sorted(list(set(s[i:j] for i in range(n) for j in range(i+1,n+1))))[k-1])


### FIXED CODE ###

s=input()
k=int(input())
st=[[] for i in range(26)]
n=len(s)
for i in range(n):
    st[ord(s[i])-97].append(i)

pre=0
now=set()
for i in st:
    for v in i:
        for c in range(v+1,min(n+1,v+6)):
            now.add(s[v:c])
    if len(now)+pre<k:pre+=len(now);now=set()
    else:
        print(sorted(list(now))[k-pre-1]);exit()
### BUGGY CODE ###

import sys

def main():
    l = input().split()
    a = int(l[0])
    b = int(l[1])

    temp = 1
    for i in range(a, b+1):
        temp *= i
    else:
        if temp == 0:
            print("Zero")
        elif temp > 0:
            print("Positive")
        else:
            print("Negative")


if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys

def main():
    l = input().split()
    a = int(l[0])
    b = int(l[1])

    if a <= 0 and b >= 0:
        print("Zero")
    elif a > 0:
        print("Positive")
    elif b < 0:
        if (b - a) % 2 != 0:
            print("Positive")
        else:
            print("Negative")

if __name__ == '__main__':
    main()
### BUGGY CODE ###

import sys


def resolve():
    import math

    readline = sys.stdin.readline

    N = int(readline())

    for i in range(1, N + 1):
        ans = 0
        li = int(math.sqrt(i) // 1)
        for x in range(1, li):
            for y in range(1, li):
                xx = x * x
                yy = y * y
                xy = x * y
                value = (x + y) ** 2 - 4 * (xx + yy + xy - i)
                if value <= 0:
                    continue
                cal = math.sqrt(value)
                z1 = (-(x + y) + cal) / 2
                z2 = (-(x + y) - cal) / 2
                if (1
                        and 1 <= z1
                        and z1 % 1 == 0):
                    ans += 1
                if (1
                        and 1 <= z2
                        and z2 % 1 == 0):
                    ans += 1
        print(ans)


resolve()


### FIXED CODE ###

import sys


def resolve():
    import numpy as np

    readline = sys.stdin.readline

    N = int(readline())

    f = np.zeros(10001, np.int64)

    for x in range(1, 101):
        for y in range(1, 101):
            for z in range(1, 101):
                n = x * x + y * y + z * z + x * y + y * z + z * x
                if n > 10000:
                    continue
                f[n] += 1
    for i in range(1, N + 1):
        print(f[i])

resolve()