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

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

A = { i: a for i, a in enumerate(A)}

def f(i):
    total = 0
    for j in range(N):
        if j % 2 == 0:
            total += A[(i + j) % N]
        else:
            total -= A[(i + j) % N]
    return total

B = [f(i) for i in range(N)]

print(*B)

# A[0] = B[0] // 2 + B[1] // 2
# A[1] = B[1] // 2 + B[2] // 2
# A[2] = B[2] // 2 + B[3] // 2
# A[3] = B[3] // 2 + B[4] // 2
# A[4] = B[4] // 2 + B[0] // 2

# A[0] - A[1] = (B[0] - B[2]) // 2
# A[1] - A[2] = (B[1] - B[3]) // 2
# A[2] - A[3] = (B[2] - B[4]) // 2
# A[3] - A[4] = (B[3] - B[0]) // 2
# A[4] - A[0] - (B[4] - B[1]) // 2

# A[0] - A[1] + A[2] - A[3] + A[4] = B[0]
# A[1] - A[2] + A[3] - A[4] + A[0] = B[1]
# A[2] - A[3] + A[4] - A[0] + A[1] = B[2]
# A[3] - A[4] + A[0] - A[1] + A[2] = B[3]


### FIXED CODE ###

from functools import lru_cache
N = int(input())
A = list(map(int, input().split()))

@lru_cache(maxsize=N)
def f(i):
    if i >= 2:
        return f(i - 2) + 2 * A[i - 1] - 2 * A[i - 2]
    total = 0
    for j in range(N):
        if j % 2 == 0:
            total += A[(i + j) % N]
        else:
            total -= A[(i + j) % N]
    return total

B = (f(i) for i in range(N))

print(*B)
### BUGGY CODE ###

n = input()
t_list = ['dream', 'dreamer', 'erase', 'eraser']
i = 0
while len(n) != 0:
    for t in t_list:
        if n[-len(t):] == t:
            n = n[:-len(t)]
            break
if not n:
    print('YES')
else:
    print('NO')


### FIXED CODE ###

s = input().replace("eraser","").replace("erase","").replace("dreamer","").replace("dream","")
if s:
    print("NO")
else:
    print("YES")
### BUGGY CODE ###

s = input().split()
n = int(s[0])
k = int(s[1])

p_n = input().split()

up_to = n - k + 1

result = 0.0

for i in range(n):
    p_n[i] = (1 + int(p_n[i]))/2

for i in range(up_to):
    sum_ex = 0.0
    for j in range(i,i+k):
        #print(p_n[j])
        sum_ex += p_n[j]
    
    #print(sum_ex)
    if(result < sum_ex):
        result = sum_ex


print('{0:.6f}'.format(result))

### FIXED CODE ###

n,k = map(int,input().split())

pi = [0 for _ in range(n)]
si = [0 for _ in range(n)]

pi = [int(s) for s in input().split()]
pi = [(1+s)/2 for s in pi]

si[0] = pi[0]
for i in range(1,n):
    si[i] = si[i-1] + pi[i]

#print(pi)
#print(si)
#print(si[2]-si[0])

ans = 0
if not (n==k):
    for i in range(n-k):
        ans = max(si[i+k]-si[i],ans)
else:
    ans = si[n-1]

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

N = int(input())
A = [int(x) for x in input().split()]
B = A
count=0
while len(B)!=0:
  b=B[0]
  C=[i for i in B if i != b]
  count+=(len(B)-len(C))*(len(B)-len(C)-1)/2
  B=C
ans=list(map(lambda x: count-(A.count(x)-1),A))
for x in ans:
  print(int(x))

### FIXED CODE ###

from collections import Counter
N = int(input())
B = [int(x) for x in input().split()]
A=Counter(B)
V, C = zip(*A.most_common())
count=0
i=0
dict={}
for x in C:
  count+=x*(x-1)/2
  dict[V[i]]=x
  i+=1
for x in B:
  ans=count-dict[x]+1
  print(int(ans))
### BUGGY CODE ###

N=int(input())
s=[input() for i in range(N)]
S=sorted(s)
a=1
num=[]
st=[]
for i in range(N-1):
  if S[i+1]==S[i]:
    a+=1
    if i == (N-2):
        num.append(a)
        st.append(S[-1])
  elif S[i+1]!=S[i]:
    num.append(a)
    st.append(S[i])
    a=1
if S[-1]!=S[-2]:
    num.append(1)
    st.append(S[-1])
 
d=max(num)
x=[]
if num.count(d)==1:
    print(st[num.index(max(num))])
else:
    ind=[i for i, v in enumerate(num) if v == max(num)]# 複数の最大値のインデックスを全て取得
    st2=[]
    for i in range(len(ind)):
        st2.append(st[ind[i]])
    [print(i) for i in st2]

### FIXED CODE ###

import collections
N=int(input())
s=[input() for i in range(N)]
#S=sorted(s)
a=1
num=[]
st=[]
c = collections.Counter(s)#要素数が大きい順に辞書型ですべての要素を返す
#print(c)
max_c = max(c.values())#最も多い要素の数
#print(max_c)
st=[]
for k,v in c.items():
    if v==max_c:
        st.append(k)
st2=sorted(st)
[print(i) for i in st2]
### BUGGY CODE ###

n, q = map(int, input().split())
s = input().rstrip()
for _ in range(q):
  i, r = map(int, input().split())
  print(s[i-1:r].count('AC'))


### FIXED CODE ###

def main():
    N, Q = map(int, input().split())
    S = input()

    lis = [0 for _ in range(len(S))]
    for i in range(len(S)):
        if i > 0:
            lis[i] += lis[i - 1]
        if i < len(S) - 1 and S[i] == 'A' and S[i + 1] == 'C':
            lis[i + 1] += 1

    for _ in range(Q):
        L = tuple(map(int, input().split()))
        print(lis[L[1] - 1] - lis[L[0] - 1])


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

from collections import defaultdict
import sys
sys.setrecursionlimit(10**7)
n = int(input())
A = []
ans = 0
adjacent_list = [[] for i in range((n + 2) * n)]
for i in range(n):
    tmp = list(map(int, input().split()))
    pre = tmp[0] - 1
    for j in range(1, len(tmp)):
        l, g = min(i, tmp[j] - 1), max(i, tmp[j] - 1 )
        pre_l, pre_g = min(i, pre), max(i, pre) 
        adjacent_list[pre_l * n + pre_g].append(l * n + g)
        pre = tmp[j] - 1
not_candidate = set()
for i in range((n + 2) * n):
    for j in adjacent_list[j]:
        not_candidate.add(j)
#まず、閉路検
seen = [False for i in range((n + 2) * n)]
visited = [False for i in range((n + 2) * n)]
def check(node):
    seen[node] = True
    for i in adjacent_list[node]:
        if seen[i] and (not visited[i]):
            print(-1)
            exit()
        check(i)
    visited[node] = True
def dfs_path(node):
    if len(adjacent_list[node]) == 0:
        return 1
    if node in finish:
        return finish[node]
    tmp = 0
    for i in adjacent_list[node]:
        tmp = max(tmp, dfs_path(i) + 1)
    finish[node] = max(tmp, finish[node])
    return finish[node]
finished = set()
for i in range((n + 2) * n):
    check(i)
finish = defaultdict(int)
for i in range((n + 2) * n):
    if i not in not_candidate:
        dfs_path(i)
print(max(finish.values()))

### FIXED CODE ###

from collections import defaultdict
import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readline
n = int(input())
A = []
M = [[-1 for _ in range(n)] for _ in range(n)]
cnt = 0
for i in range(n):
    for j in range(i+1,n):
        M[i][j] = cnt
        M[j][i] = cnt
        cnt += 1
ans = 0
nodes = []
adjacent_list = [[] for i in range(n*(n-1)//2)]
for i in range(n):
    tmp = list(map(int, input().split()))
    pre = tmp[0] - 1
    for j in tmp[1:]:
        adjacent_list[M[i][pre]].append(M[i][j-1])
        pre = j - 1
#まず、閉路検
seen = defaultdict(lambda: False)
visited = defaultdict(lambda: False)
def check(node):
    if visited[node]:
        return
    seen[node] = True
    for i in adjacent_list[node]:
        if seen[i] and (not visited[i]):
            print(-1)
            exit()
        check(i)
    visited[node] = True
def dfs_path(node):
    if not adjacent_list[node]:
        return 1
    if finish[node]:
        return finish[node]
    tmp = 0
    for i in adjacent_list[node]:
        tmp = max(tmp, dfs_path(i) + 1)
    finish[node] = tmp
    return finish[node]
finished = set()
finish = [0 for i in range(n*(n-1)//2)]
for i in range(n*(n-1)//2):
    check(i)
    dfs_path(i)
print(max(max(finish), 1))
### BUGGY CODE ###

import bisect
n, m = map(int, input().split())
A = sorted(map(int, input().split()))
BC = []
for j in range(m):
    b, c = map(int, input().split())
    BC.append((b, c))
BC = sorted(BC, key=lambda x: x[1], reverse=True)
ans = 0
for b, c in BC:
    i = bisect.bisect_left(A, c)
    if i == 0:
        break
    else:
        change = min(i, b)
        ans += c * change
        A = A[change:]
ans += sum(A)
print(ans)

### FIXED CODE ###

n, m = map(int, input().split())
A = sorted(map(int, input().split()))
BC = []
for j in range(m):
    b, c = map(int, input().split())
    BC.append((b, c))
BC = sorted(BC, key=lambda x: x[1], reverse=True)
D = []
for b, c in BC:
    D.extend([c for i in range(b)])
    if len(D) >= n:
        D = D[:n]
        break
for x in range(len(D)):
    if A[x] > D[x]:
        break
else:
    x += 1
print(sum(A[x:]) + sum(D[:x]))
### BUGGY CODE ###

from sys import stdin,setrecursionlimit
setrecursionlimit(1000000) 

N, Q = map(int, input().split())
T = [[] for _ in range(2 * (10 ** 5))]
for _ in range(N - 1):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    T[a].append(b)
    T[b].append(a)

d = [0] * N

for _ in range(Q):
    p, x = map(int, input().split())
    d[p - 1] += x

def dfs(u, v):
    global d
    for p in T[u]:
        if p == v:
            continue
        d[p] += d[u]
        dfs(p, u)

dfs(0, -1)

for v in d:
    print(v)


### FIXED CODE ###

from sys import stdin,setrecursionlimit
input = stdin.readline
setrecursionlimit(1000000) 

N, Q = map(int, input().split())
T = [[] for _ in range(2 * (10 ** 5))]
for _ in range(N - 1):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    T[a].append(b)
    T[b].append(a)

d = [0] * N

for _ in range(Q):
    p, x = map(int, input().split())
    d[p - 1] += x

def dfs(u, v):
    global d
    for p in T[u]:
        if p == v:
            continue
        d[p] += d[u]
        dfs(p, u)

dfs(0, -1)

for v in d:
    print(v)
### BUGGY CODE ###

import sys
input = sys.stdin.readline

H, W, K = map(int, input().split())
S = [[int(i) for i in input()[:-1]] for _ in range(H)]

m = float('inf')
for i in range(1 << (H - 1)) :
  pos = [0] * H
  x = 0
  for j in range(H - 1) :
    if i & (1 << j) :
      x += 1
    pos[j+1] = x
      
  x = 0
  cnt = [0] * H
  ret = bin(i)[2:].count('1')
  while x < W :
    for y in range(H) :
      cnt[pos[y]] += S[y][x]
      if cnt[pos[y]] > K :
        cnt = [0] * H
        ret += 1
        break
    else :
      x += 1
      
  m = min(m, ret)
  
print(m)

### FIXED CODE ###

import sys
input = sys.stdin.readline

H, W, K = map(int, input().split())
S = [[int(i) for i in input()[:-1]] for _ in range(H)]

m = float('inf')
for i in range(1 << (H - 1)) :
  pos = [0] * H
  x = 0
  for j in range(H - 1) :
    if i & (1 << j) :
      x += 1
    pos[j+1] = x
  
  ret = x
  x = 0
  cnt = [0] * H
  flag = 0
  while x < W :
    for y in range(H) :
      cnt[pos[y]] += S[y][x]
      if cnt[pos[y]] > K :
        cnt = [0] * H
        ret += 1
        flag += 1
        break
    else :
      x += 1
      flag = 0
      
    if flag == 2 :
      ret = float('inf')
      break
  
  m = min(m, ret)
  
print(m)
### BUGGY CODE ###

N = int(input())
A = [int(input()) for i in range(N)]
A1 = sorted(A,reverse=True)
for i in range (0,N):
  if A[i] == max(A):
    print(A1[1])
  else:
    print(A1[0])

### FIXED CODE ###

N = int(input())
A = [int(input()) for i in range(N)]
A1 = sorted(A,reverse=True)
for i in range (0,N):
  if A[i] == A1[0]:
    print(A1[1])
  else:
    print(A1[0])
### BUGGY CODE ###

import itertools

N = int(input())
S = input()

slen = list(itertools.combinations(S, N - (N - 3)))
setlen = set(slen)

print(len(setlen))


### FIXED CODE ###


N = int(input())
S = input()
ans = 0
anslst = []
for i in range(10):
    for j in range(10):
        for k in range(10):
            anslst.append(str(i) + str(j) + str(k))

tmp = ans
for i in anslst:
    a, b, c = i
    index1 = S.find(a)
    index2 = S.find(b, index1 + 1)
    index3 = S.find(c, index2 + 1)
    if index1 != -1 and index2 != -1 and index3 != -1:
        ans += 1
print(ans)
### BUGGY CODE ###

n, q = map(int, input().split())
s = input()
lr = [list(map(int, input().split())) for i in range(q)]
for i in range(q):
    print(s[lr[i][0]-1:lr[i][1]].count('AC'))

### FIXED CODE ###

n, q = map(int, input().split())
s = input()
lr = [list(map(int, input().split())) for i in range(q)]

# 0-index
for i in range(q):
    for j in range(2):
        lr[i][j] -= 1

# 'AC'のカウントの累積和
ac_cnt = [0 for i in range(n)]
for i in range(n-1):
    ac_cnt[i+1] = ac_cnt[i] + (1 if s[i:i+2] == 'AC' else 0)

for i in range(q):
    print(ac_cnt[lr[i][1]] - ac_cnt[lr[i][0]])
### BUGGY CODE ###

N, A = map(int, input().split())
X = list(map(int, input().split()))

ans = 0

for bit in range(1 << N):
  total = 0
  count = 0

  for i in range(N):
    if bit & (1 << i):
      total += X[i]
      count += 1

  if count != 0:
    if total / count == A:
      ans += 1

print(ans)

### FIXED CODE ###

N, A = map(int, input().split())
X = list(map(int, input().split()))
dp = [[[0] * 3001 for i in range(51)] for j in range(51)]

dp[0][0][0] = 1

for i in range(N):
  for j in range(N):
    for k in range(0, 2501):
      dp[i+1][j][k] += dp[i][j][k]
      dp[i+1][j+1][k+X[i]] += dp[i][j][k]

ans = 0
for n in range(1, N+1):
  ans += dp[N][n][n*A]

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

import math

K = int(input())
valSum = 0

for A in range(1,K+1):
    for B in range(1,K+1):
        for C in range(1,K+1):
            valSum = math.gcd(math.gcd(A,B),C) + valSum

print(valSum)

### FIXED CODE ###

from math import gcd

K = int(input())
valSum = 0

for A in range(1,K+1):
    for B in range(1,K+1):
        for C in range(1,K+1):
            valSum += gcd(gcd(A,B),C)

print(valSum)
### BUGGY CODE ###


def main():
    n = int(input())
    s = input()
    cnt = 0
    for i in range(len(s)):
        x = s[i]
        for j in range(i+1, len(s)):
            y = s[j]
            if x == y:
                continue
            for k in range(j+1, len(s)):
                z = s[k]
                if z == x or z == y:
                    continue
                if j - i == k - j:
                    continue
                cnt += 1
                # print(f"{i} {j} {k}")
    print(cnt)

if __name__ == "__main__":
    main()

### FIXED CODE ###


def main():
    '''
    #このコードだと、tleになる
    n = int(input())
    s = input()
    cnt = 0
    for i in range(len(s)):
        x = s[i]
        for j in range(i+1, len(s)):
            y = s[j]
            if x == y:
                continue
            for k in range(j+1, len(s)):
                z = s[k]
                if z == x or z == y:
                    continue
                if j - i == k - j:
                    continue
                cnt += 1
                # print(f"{i} {j} {k}")
    print(cnt)
    '''
    n = int(input())
    s = input()
    cnt = [0]*3
    ans = 1
    for i in s:
        if i == 'R':cnt[0]+=1
        elif i == 'G':cnt[1]+=1
        else:cnt[2]+=1
    for i in cnt:
        ans *= i
    for i in range(n):
        for j in range(i+1,n):
            k = j + (j - i)
            if k < n:
                if s[i] == s[j]: continue
                if s[j] == s[k]: continue
                if s[k] == s[i]: continue
                ans -= 1
    print(ans)



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

n,q=map(int,input().split())
s=input()
A=[list(map(int,input().split())) for i in range(q)]
B=[0]*(n+1)
for i in range(n):
    t=s[i:]
    cnt=0
    for j in range(len(t)-1):
        if t[j]+t[j+1]=="AC":
            cnt +=1
    B[i+1]=cnt

for l,r in A:
    print(B[l]-B[r])

### FIXED CODE ###

n,q=map(int,input().split())
s=input()+"P"
A=[list(map(int,input().split())) for i in range(q)]
B=[0]*(n+1)
cnt=0
for i in range(1,n):
    if s[i-1]+s[i]=="AC":cnt +=1
    B[i+1]=cnt

for l,r in A:print(B[r]-B[l])
### BUGGY CODE ###

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


def f(x):
    v = 0
    for i in range(len(A)):
        v += abs(A[i] - (x + i + 1))
    return v


left = -(10**9 + 2 * 10**5)
right = 10**9 + 2 * 10**5
v = 10**18
while left + 1 < right:
    x = (left + right) // 2
    # print('left right x', left, right, x)
    a = f(x)
    v = min(v, a)
    if a <= f(x + 1):
        right = x
    elif f(x - 1) >= a:
        left = x

# ans = f(left)
# print('left ans v', left, ans, v)
print(v)


### FIXED CODE ###

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


def f(x):
    v = 0
    for i in range(len(A)):
        v += abs(A[i] - (x + i + 1))
    return v


left = -(10**9 + 2 * 10**5)
right = 10**9 + 2 * 10**5
v = 10**18
while left + 1 < right:
    x = (left + right) // 2
    # print('left right x', left, right, x)
    a = f(x)
    v = min(v, a)
    if a <= f(x + 1):
        right = x
    elif f(x - 1) >= a:
        left = x

# ans = f(left)
# print('left ans v', left, ans, v)
print(v)
### BUGGY CODE ###

n,a=map(int,input().split())
x=list(map(int,input().split()))
X=max(max(x),a)
dp=[[[0]*(n*X+1)for j in range(n+1)]for i in range(n+1)]
dp[0][0][0]=1
for i in range(1,n+1):
  xi=x[i-1]
  for j in range(n+1):
      for h in range(j*X+1):
        if h<xi:dp[i][j][h]=dp[i-1][j][h]
        if xi<=h and j>=1:dp[i][j][h]=dp[i-1][j][h]+dp[i-1][j-1][h-xi]
ans=0
for j in range(1,n+1):ans+=dp[n][j][j*a]
print(ans)

### FIXED CODE ###

n,a=map(int,input().split())
x=list(map(int,input().split()))
X=max(max(x),a)
dp=[[[0]*(X*n+1)for j in range(n+1)]for i in range(n+1)]
dp[0][0][0]=1
for i in range(1,n+1):
  xi=x[i-1]
  for j in range(i+1):
      for h in range(j*X+1):
        if h<xi:dp[i][j][h]=dp[i-1][j][h]
        if xi<=h and j>=1:dp[i][j][h]=dp[i-1][j][h]+dp[i-1][j-1][h-xi]
ans=0
for j in range(1,n+1):ans+=dp[n][j][j*a]
print(ans)
### BUGGY CODE ###

MOD = 998244353
class ModInt(int):
    def __init__(self, x):
        self.x = x % MOD

    def __str__(self):
        return str(self.x)

    __repr__ = __str__

    def __add__(self, other):
        return ModInt(self.x + other.x) if isinstance(other, ModInt) else ModInt(self.x + other)

    def __sub__(self, other):
        return ModInt(self.x - other.x) if isinstance(other, ModInt) else ModInt(self.x - other)

    def __mul__(self, other):
        return ModInt(self.x * other.x) if isinstance(other, ModInt) else ModInt(self.x * other)

    def __floordiv__(self, other):
        if isinstance(other, ModInt):
            return ModInt(self.x * pow(other.x, MOD - 2, MOD))
        else:
            if other == 0:
                raise ZeroDivisionError
            else:
                return ModInt(self.x * pow(other, MOD - 2, MOD))

    def __pow__(self, other):
        return ModInt(pow(self.x, other.x, MOD)) if isinstance(other, ModInt) else ModInt(pow(self.x, other, MOD))

    __radd__ = __add__

    def __rsub__(self, other):
        return ModInt(other.x - self.x) if isinstance(other, ModInt) else ModInt(other - self.x)

    __rmul__ = __mul__

    def __rfloordiv__(self, other):
        return ModInt(other.x * pow(self.x, MOD - 2, MOD)) if isinstance(other, ModInt) else ModInt(other * pow(self.x, MOD - 2, MOD))

    def __rpow__(self, other):
        return ModInt(pow(other.x, self.x, MOD)) if isinstance(other, ModInt) else ModInt(pow(other, self.x, MOD))


def main():
    n, k = map(int, input().split())
    L, R = [], []
    for _ in range(k):
        l, r = map(int, input().split())
        L.append(l)
        R.append(r)
    dp = [0] * (n + 1)
    s = [0] * (n + 1)
    dp[1] = ModInt(1)
    s[1] = ModInt(1)
    for i in range(2, n + 1):
        for j in range(k):
            l = max(1, i - R[j])
            r = i - L[j]
            dp[i] += s[r] - s[l - 1]
        s[i] = s[i - 1] + dp[i]
    print(dp[n])


if __name__ == "__main__":
    main()


### FIXED CODE ###

def main():
    MOD = 998244353
    n, k = map(int, input().split())
    L, R = [], []
    for _ in range(k):
        l, r = map(int, input().split())
        L.append(l)
        R.append(r)
    dp = [0] * (n + 1)
    s = [0] * (n + 1)
    dp[1] = 1
    s[1] = 1
    for i in range(2, n + 1):
        for j in range(k):
            l = max(1, i - R[j])
            r = i - L[j]
            if r < 1: continue
            dp[i] += s[r] - s[l - 1]
            dp[i] %= MOD
        s[i] = s[i - 1] + dp[i]
        s[i] %= MOD
    print(dp[n])


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

import collections
from math import factorial

def permutations_count(n, r):
    ''' 順列 '''
    return factorial(n) // factorial(n - r)

def combinations_count(n, r):
    ''' 組み合わせ '''
    return factorial(n) // (factorial(n - r) * factorial(r))


S = input()

lis = []

for i in range(1,len(S)+1):
    lis.append(int(S[-1*i:]) % 2019)

c = collections.Counter(lis)

su = 0

for k in c:
    if c[k] > 1:
        su += combinations_count(c[k], 2)
        
        
        
su += c[0]

print(su)

### FIXED CODE ###

import collections
from math import factorial

def permutations_count(n, r):
    ''' 順列 '''
    return factorial(n) // factorial(n - r)

def combinations_count(n, r):
    ''' 組み合わせ '''
    return factorial(n) // (factorial(n - r) * factorial(r))


S = input()

lis = []
amari = 1
lis.append(int(S[-1]))

for i in range(2,len(S)+1):
    amari = (amari * 10) % 2019
    lis.append((int(S[-1*i]) * amari + lis[i-2]) % 2019)

c = collections.Counter(lis)

su = 0

for k in c:
    if c[k] > 1:
        su += combinations_count(c[k], 2)
        
        
        
su += c[0]

print(su)
### BUGGY CODE ###

n,l=int(input()),list(map(int,input().split()))
if n%2==0:
  f=all(l.count(l[i])==2 for i in range(n))
else:
  f=all(l.count(l[i])==2 for i in range(n) if l[i]!=0) and l.count(0)==1
print(2**(n//2)%1000000007 if f==True else 0)

### FIXED CODE ###

import collections
n=int(input())
l=list(input().split())
c=collections.Counter(l)
if n%2==0:
  f=all(x==2 for x in c.values())
else:
  g=c.pop("0")==1
  f=all(x==2 for x in c.values()) and g
print(2**(n//2)%1000000007 if f==True else 0)
### BUGGY CODE ###

import sys
sys.setrecursionlimit(1000000)
N,Q = map(int,input().split())
e = [ [ ] for i in range(N)]
for i in range(N-1):
    a,b = map(int,input().split())
    e[a-1].append(b-1)

from collections import defaultdict
d = defaultdict(int)
for i in range(Q):
    p,x = map(int,input().split())
    d[p-1] += x

ansl = [0 for i in range(N)]

def dfs(x,c):
    c += d[x]
    ansl[x] = c
    for v in e[x]:
        dfs(v,c)

dfs(0,0)
print(" ".join(map(str,ansl)))


### FIXED CODE ###

import sys
sys.setrecursionlimit(10000000)

def main():
    N,Q = map(int,sys.stdin.readline().split())
    e = [ [ ] for i in range(N)]
    for i in range(N-1):
        a,b = map(int,sys.stdin.readline().split())
        e[a-1].append(b-1)

    from collections import defaultdict
    d = defaultdict(int)
    for i in range(Q):
        p,x = map(int,sys.stdin.readline().split())
        d[p-1] += x

    ansl = [0 for i in range(N)]

    def dfs(x,c):
        c += d[x]
        ansl[x] = c
        for v in e[x]:
            dfs(v,c)

    dfs(0,0)
    print(" ".join(map(str,ansl)))
if __name__ == '__main__':
    main()
### BUGGY CODE ###

n = int(input())

res = [0] * (n+1)
x = 1
while x*x <= n:
  y = 1
  while y*y <= n:
    z = 1
    while z <= n:
      w = x*x+y*y+z*z+x*y+y*z+z*x
      if w <= n:
        res[w] += 1
      z += 1
    y += 1
  x+= 1
  
for i in range(1,n+1):
  print(res[i])

### FIXED CODE ###

n = int(input())

res = [0] * (n+1)
x = 1
while x*x <= n:
  y = 1
  while y*y <= n:
    z = 1
    while z*z <= n:
      w = x*x+y*y+z*z+x*y+y*z+z*x
      if w <= n:
        res[w] += 1
      z += 1
    y += 1
  x+= 1
  
for i in range(1,n+1):
  print(res[i])