Harryxun/stf_run huggingface dataset:
N, M = map(int, input().split())
a = [int(input()) for _ in range(M)] # a_0...a_(M-1)

def f(x): # フィボナッチ数列
    if x == 0:
        return(1)
    elif x == 1:
        return(1)
    elif x == 2:
        return(2)
    else:
        return(f(x-1) + f(x-2))

ans = 0
MOD = 10**9 + 7

if M == 0:
    ans += f(N) % MOD
    print(ans)
else:
    ans += f((a[0]-1) - 0) % MOD # 0段目からa_0-1段目に上る(その後a_0段目を飛ばしてa_0+1段目に上る)
    for i in range(1, M): # iは1からM-1
        stair = (a[i] - 1) - (a[i-1] + 1) # 登る段数
        if stair >= 0:
            ans *= f(stair) % MOD # a_(i-1)+1段目からa_i-1段目に上る(その後a_i段目を飛ばしてa_i+1段目に上る)
        else:
            ans = 0
            break
    ans *= f(N - (a[M-1] + 1)) % MOD # a_M-1段目からN段目に上る
    print(ans % MOD)


### FIXED CODE ###

N, M = map(int, input().split())
a = [int(input()) for _ in range(M)] # a_0...a_(M-1)

def f(x):
    a, b = 1, 1
    if x == 0:
        return a
    elif x == 1:
        return b
    else:
        for i in range(x-1):
            a, b = b, a + b
        return b
"""
# 再帰だとTLEとかREとかになるよ
def f(x): # フィボナッチ数列
    if x == 0:
        return(1)
    elif x == 1:
        return(1)
    else:
        return(f(x-1) + f(x-2))
"""

ans = 0
MOD = 10**9 + 7

if M == 0:
    ans += f(N) % MOD
    print(ans)
else:
    ans += f((a[0]-1) - 0) % MOD # 0段目からa_0-1段目に上る(その後a_0段目を飛ばしてa_0+1段目に上る)
    for i in range(1, M): # iは1からM-1
        stair = (a[i] - 1) - (a[i-1] + 1) # 登る段数
        if stair >= 0:
            ans *= f(stair) % MOD # a_(i-1)+1段目からa_i-1段目に上る(その後a_i段目を飛ばしてa_i+1段目に上る)
        else:
            ans = 0
            break
    ans *= f(N - (a[M-1] + 1)) % MOD # a_M-1段目からN段目に上る
    print(ans % MOD)
n,m = map(int,input().split())
foodlike = [0]*m
for i in range(n):
    data = list(map(int,input().split()))
    for j in range(data[0]):
        foodlike[data[j-1]] += 1
print(foodlike.count(n))

### FIXED CODE ###

n,m = map(int,input().split())
foodlike = [0]*m
for i in range(n):
    data = list(map(int,input().split()))
    for j in range(data[0]):
        foodlike[data[j+1] - 1] += 1
print(foodlike.count(n))
heightOfMountains = []
for i in range(1, 11):
	heightOfMountains.append(int(input()))
heightOfMountains.sort()
for i in range(1, 4):
	print(heightOfMountains[-j])

### FIXED CODE ###

heightOfMountains = []
for i in range(1, 11):
	heightOfMountains.append(int(input()))
heightOfMountains.sort()
for i in range(1, 4):
	print(heightOfMountains[-i])
N = int(input())
H = list(map(int, input().split()))

D  = [0 for _ in range(N-1)]
for i in range(N-1):
    if H[i] >= H[i+1]:
        D[i] = 1

from itertools import groupby
DC = [sum(item) for val, item in groupby([1 if x == 1 else -1 for x in D])]
print(max(DC))

### FIXED CODE ###

N = int(input())
H = list(map(int, input().split()))

D  = [0 for _ in range(N-1)]
for i in range(N-1):
    if H[i] >= H[i+1]:
        D[i] = 1

from itertools import groupby
DC = [sum(item) for val, item in groupby([1 if x == 1 else 0 for x in D])]
if DC == []:
    print(0)
else:
    print(max(DC))
N = int(input())
x = [list(map(int, input().split()))for _ in range(N)]
ax=x[0][0]
ay=x[0][1]
ah=x[0][2]
for x in range(101):
    for y in range(101):
        H = ah+abs(ax-x)+abs(ay-y)
        if all(max(H-abs(t[0]-x)-abs(t[1]-y), 0) == t[2]for t in p):
            print(x, y, H)


### FIXED CODE ###

n = int(input())
p = [list(map(int, input().split()))for _ in range(n)]
ax, ay, ah = list(filter(lambda x: x[2], p))[0]
for x in range(101):
    for y in range(101):
        H = ah+abs(ax-x)+abs(ay-y)
        if all(max(H-abs(t[0]-x)-abs(t[1]-y), 0) == t[2]for t in p):
            print(x, y, H)
import sys
#import numpy as np

stdin = sys.stdin

ri = lambda: int(rs())
rl = lambda: list(map(int, stdin.readline().split())) # applies to numbers only
rs = lambda: stdin.readline().rstrip()  # ignore trailing spaces

N = ri()
A = [ri() for _ in range(N)]
x_to_i = {x:i for i, x in enumerate(sorted(A))}
rank = [x_to_i[x] for x in A]
answer = sum((i^x)&1 for i,x in enumerate(rank)) // 2
print(B)


### FIXED CODE ###

import sys
import numpy as np

stdin = sys.stdin

ri = lambda: int(rs())
rl = lambda: list(map(int, stdin.readline().split())) # applies to numbers only
rs = lambda: stdin.readline().rstrip()  # ignore trailing spaces

N = ri()
A = [ri() for _ in range(N)]
B = sorted(A)
B = set(B[1::2])
C = [i%2==1 and a not in B for i, a in enumerate(A)]
print(sum(C))
from sys import exit, setrecursionlimit, stdin, stderr
from functools import reduce
from itertools import *
from collections import *
from bisect import *
from heapq import *
import operator
import math
from fractions import gcd
from random import randint

setrecursionlimit(10**8)

def input():
  return stdin.readline().strip()

def read():
  return int(input())
 
def reads():
  return [int(x) for x in input().split()]

N, K = reads()
A = reads()

skip = [-1] * N
first_occ = {}
for i in range(N-1, -1, -1):
  a = A[i]
  if a in first_occ:
    if first_occ[a] < N-1:
      skip[i] = skip[first_occ[a] + 1]
    else:
      skip[i] = first_occ[a] + 1
  else:
    skip[i] = i
  first_occ[a] = i

back = [first_occ[A[i]] + 1 for i in range(N)] + [0]
next_state = [skip[back[q]] for q in range(N+1)]


q = skip[0]

rev = {}
memo = {}
i = 0
while True:
  if q in rev:
    j = rev[q]
    break
  rev[q] = i
  memo[i] = q
  q = next_state[q]
  i += 1

m = i - j
q = memo[j + (K - 1 - j) % m]

s = []
while q < N:
  if skip[q] == q:
    s.append(A[q])
    q += 1
  else:
    q = skip[q]

print(*s)

### FIXED CODE ###

from sys import exit, setrecursionlimit, stdin, stderr
from functools import reduce
from itertools import *
from collections import *
from bisect import *
from heapq import *
import operator
import math
from fractions import gcd
from random import randint

setrecursionlimit(10**8)

def input():
  return stdin.readline().strip()

def read():
  return int(input())
 
def reads():
  return [int(x) for x in input().split()]

N, K = reads()
A = reads()

skip = [-1] * (N + 1)
first_occ = {}
for i in range(N-1, -1, -1):
  a = A[i]
  if a in first_occ:
    if first_occ[a] < N-1:
      skip[i] = skip[first_occ[a] + 1]
    else:
      skip[i] = first_occ[a] + 1
  else:
    skip[i] = i
  first_occ[a] = i
skip[N] = N

back = [first_occ[A[i]] + 1 for i in range(N)] + [0]
next_state = [skip[back[q]] for q in range(N+1)]


q = skip[0]

rev = {}
memo = {}
i = 0
while True:
  if q in rev:
    j = rev[q]
    break
  rev[q] = i
  memo[i] = q
  q = next_state[q]
  i += 1

m = i - j
q = memo[j + (K - 1 - j) % m]

s = []
while q < N:
  if skip[q] == q:
    s.append(A[q])
    q += 1
  else:
    q = skip[q]

print(*s)
n = int(input())
h = list(map(int, input().split()))

for i in range(n-1):
    if h[i] - h[i+1] >= 2:
        ans = 'No'
        break
    elif h[i] - h[i+1] == 1:
        h[i] -= 1
        continue
    else:
        ans = 'Yes'
print(ans)

### FIXED CODE ###

n=int(input())
h=[int(i) for i in input().split()]
h=h[::-1]

ans='Yes'
for i in range(n-1):
    if h[i+1]-h[i] >=2:
        ans = 'No'
        break
    elif h[i+1]-h[i] ==1:
        h[i+1]-=1
    
print(ans)
k = int(input())
s = input()
l = len(s)
MOD = 10 ** 9 + 7


def comb(n, r, p):
    if (r < 0) or (n < r):
        return 0
    r = min(r, n - r)
    return fact[n] * factinv[r] * factinv[n - r] % p


p = MOD
N = 10 ** 6 + 1  # N は必要分だけ用意する
fact = [1, 1]  # fact[n] = (n! mod p)
factinv = [1, 1]  # factinv[n] = ((n!)^(-1) mod p)
inv = [0, 1]  # factinv 計算用

for i in range(2, N + 1):
    fact.append((fact[-1] * i) % p)
    inv.append((-inv[p % i] * (p // i)) % p)
    factinv.append((factinv[-1] * inv[-1]) % p)

# Sn の位置をx = l-1,l,..,l+k-1まで全て動かす
# pow(25,x-l-1,MOD)* x-1Cl-1 * pow(26,l+k-1-x,MOD) をかければOK
ans = 0
for x in range(l - 1, l + k):
    ans += pow(25, x - l + 1, MOD) * comb(x, l - 1, MOD) * pow(26, l + k - 1 - x, MOD)
    ans %= MOD
print(ans)
"""
# dp[i][j]:k+l の長さの文字列の中で、長さi で、sのj番目の文字列まじで含む文字列の個数とする
# dp[i][j] = dp[i-1][j-1] + dp[i-1][j] * 25 となる
# これだと10**12でTLEなので、まとめる
# 答えたいのは、dp[k+l][l]で初期化はdp[1][1] = 1 dp[1][0] = 25
# l までいったら遷移の仕方が変わって*26を続けるだけで良いようになる
dp = [[0] * (l + 1) for _ in range(k + l + 1)]
dp[0][0] = 1
for i in range(1, k + l + 1):
    for j in range(l + 1):
        if j == l:
            dp[i][j] = dp[i - 1][j - 1] + dp[i - 1][j] * 26
        else:
            dp[i][j] = dp[i - 1][j - 1] + dp[i - 1][j] * 25
        dp[i][j] %= MOD
print(dp[k + l][l])
"""


### FIXED CODE ###

k = int(input())
s = input()
l = len(s)
MOD = 10 ** 9 + 7


def comb(n, r, p):
    if (r < 0) or (n < r):
        return 0
    r = min(r, n - r)
    return fact[n] * factinv[r] * factinv[n - r] % p


p = MOD
N = 10 ** 6 * 2 + 10 # N は必要分だけ用意する
fact = [1, 1]  # fact[n] = (n! mod p)
factinv = [1, 1]  # factinv[n] = ((n!)^(-1) mod p)
inv = [0, 1]  # factinv 計算用

for i in range(2, N + 1):
    fact.append((fact[-1] * i) % p)
    inv.append((-inv[p % i] * (p // i)) % p)
    factinv.append((factinv[-1] * inv[-1]) % p)

# Sn の位置をx = l-1,l,..,l+k-1まで全て動かす
# pow(25,x-l-1,MOD)* x-1Cl-1 * pow(26,l+k-1-x,MOD) をかければOK
ans = 0
for x in range(l - 1, l + k):
    ans += pow(25, x - l + 1, MOD) * comb(x, l - 1, MOD) * pow(26, l + k - 1 - x, MOD)
    ans %= MOD
print(ans)
"""
# dp[i][j]:k+l の長さの文字列の中で、長さi で、sのj番目の文字列まじで含む文字列の個数とする
# dp[i][j] = dp[i-1][j-1] + dp[i-1][j] * 25 となる
# これだと10**12でTLEなので、まとめる
# 答えたいのは、dp[k+l][l]で初期化はdp[1][1] = 1 dp[1][0] = 25
# l までいったら遷移の仕方が変わって*26を続けるだけで良いようになる
dp = [[0] * (l + 1) for _ in range(k + l + 1)]
dp[0][0] = 1
for i in range(1, k + l + 1):
    for j in range(l + 1):
        if j == l:
            dp[i][j] = dp[i - 1][j - 1] + dp[i - 1][j] * 26
        else:
            dp[i][j] = dp[i - 1][j - 1] + dp[i - 1][j] * 25
        dp[i][j] %= MOD
print(dp[k + l][l])
"""
x,y,z=list(map(int,input(),split()))

print(z,x,y)


### FIXED CODE ###

x,y,z=list(map(int,input().split()))

print(z,x,y)
S = input()
T = input()
code = S
match = 0
maxmatchloc = 0
if (len(T) <= len(S)):
    for x in range(len(S)):
        match = 0
        for i in range(len(T)):
            if (S[x+i] == T[i]):
                match += 1
            if (S[x+i] != T[i] and S[x+i] != '?'):
                match = 0
                break
        if (match > maxmatchloc and match != (len(T))):
            maxmatchloc = x

    #Building the code#
    if (maxmatchloc == 0):
        print('UNRESTORABLE')
    else:
        for x in range(len(S)):
            if (S[x] == '?'):
                code = code[:x] + 'a' + code[x+1:]
        code = code[:maxmatchloc] + T + code[maxmatchloc + len(T):]
        print(code)
else:
    print('UNRESTORABLE')


### FIXED CODE ###

def search(S,T):
    match = 0
    maxmatch = 0
    maxmatchloc = -1
    for x in range(len(S)-(len(T)-1)):
        match = 0
        if (S[x] == T[0] or S[x] == '?'):
            for i in range(0,len(T)):
                ##print(S[x+i] + '-' + T[i])
                if (S[x+i] == T[i] or S[x+i] == "?"):
                    match += 1
                else:
                    ##print("Entered!")
                    match = 0
                    break
            if (match >= maxmatch and match != 0):
                ##print("ENTERED")
                maxmatchloc = x
                maxmatch = match
        ##print('At x = ' + str(x) + ': maxmatchlocation is ' + str(maxmatchloc) + ' match is ' + str(match) + ' maxmatch is' + str(maxmatch))
    return maxmatchloc

S = input()
T = input()
code = S
if '?' in S:
    if (len(T) <= len(S)):
        startpoint = search(S,T)
        for x in range(len(S)):
            if (S[x] == '?'):
                code = code[:x] + 'a' + code[x+1:] 
        if(startpoint >= 0):
            code = code[:startpoint] + T + code[startpoint + len(T):]
            print(code)
        else:
            print('UNRESTORABLE')
    else:
        print('UNRESTORABLE')
else:
    print(S)
import re
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
import functools
def v(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
cnt = 0
ans = 0
inf = float("inf")

n,k=I()
a = l()
town = []
num = [0]*(n+1)
cnt = 1
num[0]=1

for i in range(n):
    num[a[cnt-1]] += 1
    if num[a[cnt-1]] == 2:
        ans = a[cnt-1]
        break
    town.append(a[cnt-1])
    cnt = a[cnt-1]

p = town.index(ans)
b = town[p:]
x = len(town)
y = len(b)
q = k-x+y
if y == 0:
    print(town[k-1])
z = q%y
if z == 0:
    print(town[k-1])
else:
    print(b[z-1])


### FIXED CODE ###

import re
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
import functools
def v(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
cnt = 0
ans = 0
inf = float("inf")

n,k=I()
a = l()
town = []
num = [0]*(n+1)
cnt = 1
num[0]=1

for i in range(n):
    num[a[cnt-1]] += 1
    if num[a[cnt-1]] == 2:
        ans = a[cnt-1]
        p = town.index(ans)
        b = town[p:]
        x = len(town)
        y = len(b)
        q = k-x+y
        if y == 0:
            print(town[n-1])
            sys.exit()
        if q < 0:
            print(town[k-1])
            sys.exit()
        z = q%y
        if z == 0:
            print(town[z-1])
        else:
            print(b[z-1])
        sys.exit()
        break
    town.append(a[cnt-1])
    cnt = a[cnt-1]
N, A, B = map(int, input().split())
l = ""
cnt = 0
for i in range(10 **100):
    n1 = "b" * A
    n2 = "r" * B
    l += n1 + n2
    for j in range(N):
       if j == "b":
           cnt += 1
print(cnt)

### FIXED CODE ###

n, a, b = map(int,input().split())
if a == 0 and b == 0:
    print(0)
if a != 0 or b != 0:
         
    kumi = n // (a + b)
    nokori = n % (a + b)
    if nokori == 0:
        print(a * kumi)
    elif nokori >= 1 and nokori < a:
        print(a * kumi + nokori)
    elif nokori >= a:
        print(a * kumi + a)
n = int(input())
a = [int(input())-1 for x in range(n)]
ans = 1
ok = False
i = a.index(1)
for x in range(n):
    if i == 0:
        ok = True
        break
    i = a.index(i)
    ans += 1

print([-1, ans][ok])

### FIXED CODE ###

n = int(input())
a = [int(input())-1 for x in range(n)]
ans = 0
ok = False
i = 0
for x in range(n):
    if i == 1:
        ok = True
        break
    i = a[i]
    ans += 1

print([-1, ans][ok])
S = raw_input()
lis = list(S)
for i in lis:
	mat = []
	if i in S:
		print "no"
		break
	mat.append(i)
	else:
		print "yes"

### FIXED CODE ###

S = raw_input()
lis = list(S)
mat = []
for i in lis:
	if i in mat:
		print "no"
		break
	mat.append(i)
else:
	print "yes"
a,b,c = map(float,input().split())
import decimal

roota = decimal.Decimal.sqrt(a)
rootb = decimal.Decimal.sqrt(b)
rootc = decimal.Decimal.sqrt(c)
if roota + rootb < rootc:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

import decimal
a,b,c = map(decimal.Decimal,input().split())
roota = decimal.Decimal.sqrt(a)
rootb = decimal.Decimal.sqrt(b)
rootc = decimal.Decimal.sqrt(c)
if roota + rootb < rootc:
  print("Yes")
else:
  print("No")
a, b = map(int, input().split())
import math
print(a*b/math.gcd(a,b))


### FIXED CODE ###

a = int(input())
b = int(input())

print(6-(a+b))
a, b, c = input()

cnt = c - a + b

if(cnt < 0):
  cnt = 0
else:
  continue
  
print(cnt)

### FIXED CODE ###

a, b, c = map(int, input().split())

cnt = c - a + b

if(cnt < 0):
  cnt = 0

print(cnt)
import math

r = float(input())
x = math.pi

print(x*r*r + " "+  2*x**r)


### FIXED CODE ###

import math
x = math.pi

r = float(input())
print("{} {}".format(x*r*r,2*x*r))
import collections
import numpy as np
import math
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


N = int(input())
s = [""]*N
S = []
for i in range(N):
    s[i] = input()
    # print(s[i])
    # test = sorted(collections.Counter(input()))
    test = [*s[i]]
    test.sort()
    S.append("".join(test))
# print(s)
# print(S)
# count = 0
# for i in range(N-1):
#     for j in range(i+1,N):
#         if S[i] == S[j]:
#             count+=1
# print(count)
ana = sorted(collections.Counter(S).values())
ana_test = np.array(ana) - np.array([1]*(len(ana)))
# print(ana)
count = 0
for i in ana:
    if i >= 2:
        count += combinations_count(i,2)

print(count)

### FIXED CODE ###

import collections
import math

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

N = int(input())
s = [""]*N
S = []
for i in range(N):
    s[i] = input()
    test = list(s[i])
    test.sort()
    S.append("".join(test))
ana = sorted(collections.Counter(S).values())
count = 0
for i in ana:
    if i >= 2:
        count += combinations_count(i,2)
print(count)
n = int(raw_input())
lst = []
#store all the cards
for i in ["S","H","C","D"]:
	for j in xrange(1,14):
		lst.append("{0} {1}".format((i,j))
#discard the given cards
for i in xrange(0,n):
	a = raw_input()
	lst.remove(a)
#print the result
for i in xrange(0,len(lst)):
	print lst[i]

### FIXED CODE ###

n = int(raw_input())
lst = []
#store all the cards
for i in ["S","H","C","D"]:
	for j in xrange(1,14):
		lst.append("{0} {1}".format(i,j))
#discard the given cards
for i in range(n):
	a = raw_input()
	lst.remove(a)
#print the result
for i in range(len(lst)):
	print lst[i]
a = [int(input()) for i in range(n)]
m = max(a)
print(a)
p = a.index(m)
a.remove(m)
s = max(a)
print(s)
for i in range(n):
    if i != p:
        print(m)
    else:
        print(s)

### FIXED CODE ###

n = int(input())
a = [int(input()) for i in range(n)]
m = max(a)
p = a.index(m)
a.remove(m)
s = max(a)
for i in range(n):
    if i != p:
        print(m)
    else:
        print(s)
N, Y = map(int, input().split())
x = False
Y = Y//1000
for i in range(N+1):
        for j in range(N-i+1):
                b = N - i
                c = N - i - j
                if a + b + c == N and Y == a*10 + b*5 +c:
                    x = True
                    break
        break
if x:
    print(a, b, c , sep=(' '))        
                    
else:
    print(-1, -1, -1, sep=(' '))

### FIXED CODE ###

N, Y = map(int, input().split())
a = -1
b = -1
c = -1

Y = Y//1000
for i in range(N+1):
    for j in range(N-i+1):
        if Y == i*9 + j*4 +N:
            a = i
            b = j
            c = N-i-j
            #print(a,b,c)
            break
        else:
            continue
        break
        
          
print(a, b, c , sep=(' '))
k = int(input())
s = input()
if len(s) == k :
    print(s)
else :
    for i in range (k) :
        print(s[i],end="")
    print("...")

### FIXED CODE ###

k = int(input())
s = input()
if len(s) <= k :
    print(s)
else :
    for i in range (k) :
        print(s[i],end="")
    print("...")
import math
A,B = map(int,input().split())
print(int(A * B / math.gcd(A,B)))

### FIXED CODE ###

A,B = map(int,input().split())
def euclid(a, b):
    if b == 0:
        return a
    else:
        return euclid(b, a%b)
print(A*B // euclid(A, B))
#!/usr/bin/env python
# coding: utf-8

# In[1]:


import sys
#import numpy as np
#import itertools
input = sys.stdin.readline
N, K = map(int, input().split())
V = list(map(int, input().split()))


# In[2]:


#print(N, K)
#print(V)


# In[ ]:


"""
6 4
-10 8 2 1 2 6
"""


# In[29]:


scs = []
for i in range(K//2):
    #print("{}個返す".format(i))
    scss = []
    for j in range(K+1-i):
        #print("左から{}個　右から{}個/{}".format(j,K-j-i, K-i))
        if j == K-i:
            choices = V[:j]
        else:
            choices = V[:j] + V[-K+j+i:]
        #print(choices)
        #print(sorted(choices)[i:])
        scss.append(sum(sorted(choices)[i:]))
    scs.append(max(scss))
s = max(scs)
s = 0 if s<0 else s
print(s)


# In[ ]:






### FIXED CODE ###

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

# In[30]:


import sys
#import numpy as np
#import itertools
input = sys.stdin.readline
N, K = map(int, input().split())
V = list(map(int, input().split()))


# In[36]:


#print(N, K)
#print(V)


# In[ ]:


"""
6 4
-10 8 2 1 2 6
"""


# In[46]:


ans = 0
for l in range(K+1):
    if l > N:
        continue
    for r in range(K+1-l):
        if l+r>K or l+r>N:
            continue
        d = K-(l+r)
        picked = V[:l] + V[-r:] if r != 0 else V[:l]
        #print("l:{}, r:{}, picked{}".format(l, r, picked))
        sp = sorted(picked)
        now = sum(picked)
        #print(sp)
        for i in range(d):
            if i >= len(picked):
                break
            if sp[i] > 0:
                break
            now -= sp[i]
        ans = max(ans, now)
print(ans)
        
"""
if N < K:
    scs = []
    for i in range(K-N):
        scs.append(sorted(V[i:]))
    s = max(scs)
else:
    scs = []
    for i in range(K//2):
        #print("{}個返す".format(i))
        scss = []
        for j in range(K+1-i):
            #print("左から{}個　右から{}個/{}".format(j,K-j-i, K-i))
            if j == K-i:
                choices = V[:j]
            else:
                choices = V[:j] + V[-K+j+i:]
            #print(choices)
            #print(sorted(choices)[i:])
            scss.append(sum(sorted(choices)[i:]))
        scs.append(max(scss))
    s = max(scs)
    s = 0 if s<0 else s
print(s)
"""


# In[ ]:
N = int(input())
arr = [0]*(N)
lim = int(N**0.5 + 1)
for i in range(1,lim):
    for j in range(1,lim):
        for k in range(1,lim):
            num = i**2 + j**2 + k**2 + i*j + j*k + k*i - 1
            if num <= N:
                arr[num] += 1

print(*arr, sep='\n')



### FIXED CODE ###

N = int(input())
arr = [0]*(N)
lim = int(N**0.5 + 1)
for i in range(1,lim):
    for j in range(1,lim):
        for k in range(1,lim):
            num = i**2 + j**2 + k**2 + i*j + j*k + k*i - 1
            if num <= N-1:
                arr[num] += 1

print(*arr, sep='\n')
a=input()
b=input()
if(a[0]==b[2] and a[1]==b[1] and a[2]=b[0]):
    print("YES")
else:
    print("NO")


### FIXED CODE ###

a=input()
b=input()
if(a[0]==b[2] and a[1]==b[1] and a[2]==b[0]):
    print("YES")
else:
    print("NO")
import bisect
 
n = int(input())
a = list(map(int, input().split()))
a.sort()
 
res = 0
for i in range(n - 1 , -1, -1):
    if a[i] == int(a[i]):#判定
        b = 1
        while b <= A[i]:
            b =b*2
 
        j = bisect.bisect_left(A, b - A[i])
        if i > j:
            if b - a[i] == a[j]:
                c += 1
                a[j] = a[j] - 0.5
                a[i] = a[i] + 0.5
print(res)

### FIXED CODE ###

import bisect
 
N = int(input())
A = [int(a) for a in input().split()]
A = sorted(A)
 
c = 0
for i in range(N - 1 , -1, -1):
    if A[i] == int(A[i]):
        b = 1
        while b <= A[i]:
            b <<= 1
 
        j = bisect.bisect_left(A, b - A[i])
        if i > j:
            if b - A[i] == A[j]:
                c += 1
                A[j] = A[j] - 0.5
                A[i] = A[i] + 0.5
print(c)