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

def main():
    n, *a = map(int, open(0).read().split())
    m = max(a)
    l = len(bin(m)) - 2
    y = [list(bin(i)[2:].zfill(l)) for i in a]

    mod = 10 ** 9 + 7
    ans = 0
    for i, j in enumerate(zip(*y)):
        o = j.count('1')
        z = n - o
        ans += z * o * pow(2, l - i - 1, mod)
        ans %= mod

    print(ans)


if __name__ == '__main__':
    main()


### FIXED CODE ###

def main():
    from itertools import zip_longest
    n, *a = map(lambda x: bin(int(x))[2:][::-1], open(0).read().split())
    n = int('0b' + n[::-1], 2)

    mod = 10 ** 9 + 7
    ans = 0
    
    for i, j in enumerate(zip_longest(*a)):
        o = j.count('1')
        z = n - o
        ans += z * o * pow(2, i, mod)
        ans %= mod

    print(ans)


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

ans=0
s=input()
if len(s)<4:
  print(0)
  exit()
N=len(s)
for i in range(N-3):
  for j in range(i+4,N+1):
    if int(s[i:j])%2019==0:
      ans+=1
print(ans)

### FIXED CODE ###

ans=0
S=input()
a=len(S)
k=0
c=dict()
mod=2019
s=1
c[0]=1
for i in range(a):
  k+=(s*int(S[a-i-1]))
  k%=mod
  s*=10
  s%=mod
  if k in c:
    c[k]+=1
  else:
    c[k]=1
for i in c:
  ans+=c[i]*(c[i]-1)//2
print(ans)
### BUGGY CODE ###

h,w,m=list(map(int, input("").split()))
bo=[]
hb=[0]*h
wb=[0]*w
for i in range(m):
    a,b=list(map(int, input("").split()))
    #各行列に爆弾いくつあるか
    hb[a-1]+=1
    wb[b-1]+=1
    #爆弾の座標
    bo.append([a,b])
#ソート
mwb=[]
mhb=[]
#爆弾数が最大の行と列番号をメモ
hmax=max(hb)
wmax=max(wb)
for i in range(h):
    if hb[i]==hmax:
        mhb.append(i+1)
for i in range(w):
    if wb[i]==wmax:
        mwb.append(i+1)
c=0
#最大の爆弾数の行と列に含まれる爆弾数=cの確認
for h,w in bo:
    if h in mhb and w in mwb:
        c+=1
#行と列の最大爆弾数の和
out=hmax+wmax
#行と列の最大数の積がcと一致するなら必ず重複があるので－1
if c==len(mwb)*len(mhb):
    out-=1
print(out)

### FIXED CODE ###

h,w,m=list(map(int, input("").split()))
bo=[]
hb=[0]*h
wb=[0]*w
for i in range(m):
    a,b=list(map(int, input("").split()))
    #各行列に爆弾いくつあるか
    hb[a-1]+=1
    wb[b-1]+=1
    #爆弾の座標
    bo.append([a,b])
#ソート
mwb=[]
mhb=[]
#爆弾数が最大の行と列番号をメモ
hmax=max(hb)
wmax=max(wb)
for i in range(h):
    if hb[i]==hmax:
        mhb.append(i)
for i in range(w):
    if wb[i]==wmax:
        mwb.append(i)
c=0
#最大の爆弾数の行と列に含まれる爆弾数=cの確認
for h,w in bo:
     #h in mhb and w in mwb
    if(hb[h-1] == hmax and wb[w-1] == wmax):
        c+=1
#行と列の最大爆弾数の和
out=hmax+wmax
#行と列の最大数の積がcと一致するなら必ず重複があるので－1
if c==len(mwb)*len(mhb):
    out-=1
print(out)
### BUGGY CODE ###

# -*- coding: utf-8 -*-

"""
参考：http://drken1215.hatenablog.com/entry/2018/07/22/133200
　　　https://www.hamayanhamayan.com/entry/2018/06/16/091039
・自力ACできたけど、メモをもう一歩深く書けば
　メインのループ1つ落とせるのが分かったのでそっちもやってみる。
"""
 
N, C = map(int, input().split())
D = [list(map(int, input().split())) for i in range(C)]
cN = [list(map(int, input().split())) for i in range(N)]

# [mod 3でどれになるか][今度の色] = そうなった時の違和感の総和
memo = [[0] * C for i in range(3)]
for c in range(C):
    for i in range(N):
        for j in range(N):
            memo[(i+j+2)%3][c] += D[cN[i][j]-1][c]

ans = float('inf')
# 変わる色を全組み合わせループ
for i in range(C):
    for j in range(C):
        for k in range(C):
            if i == j or j == k or k == i:
                continue
            # メモで違和感の合計まで出してあるので、ここではループなし
            sm = memo[0][i] + memo[1][j] + memo[2][k]
            ans = min(sm, ans)
print(ans)


### FIXED CODE ###

# -*- coding: utf-8 -*-
 
N, C = map(int, input().split())
D = [list(map(int, input().split())) for i in range(C)]
cN = [list(map(int, input().split())) for i in range(N)]

# [mod 3でどれになるか][今の色] = 該当する数
memo = [[0] * C for i in range(3)]
for i in range(N):
    for j in range(N):
        memo[(i+j+2)%3][cN[i][j]-1] += 1

ans = float('inf')
# 変わる色を全組み合わせループ
for i in range(C):
    for j in range(C):
        for k in range(C):
            if i == j or j == k or k == i:
                continue
            sm = 0
            # 元の色ループ
            for l in range(C):
                # メモを元に、各塗り替えでどのくらい違和感が出るか算出
                sm += D[l][i] * memo[0][l]
                sm += D[l][j] * memo[1][l]
                sm += D[l][k] * memo[2][l]
            ans = min(sm, ans)
print(ans)
### BUGGY CODE ###

def main():
    A, B, C, D = map(int, input().split())
    # 追加の仕方から考えると、塗られている数はC-A + D-B
    # 縦と横の長さが同じなら、その次の動作で塗れる組み合わせは同じ
    # 選びうる方法を全部数え上げよう

    c = C - A
    d = D - B
    mod = 998244353
    dp = [[0]*(d+1) for i in range(c+1)]
    dp[0][0] = 1

    for i in range(c+1):

        for j in range(d+1):
            if i > 0 and j > 0:
                if i == j == 1:
                    dp[i][j] -= (A+i-1) * (B+j-1)
                else:
                    tmp = dp[i-1][j-1]
                    #print(tmp, i, j)
                    tmp *= (A+i-1)*(B+j-1)

                    # print(dp[i][j], tmp)
                    dp[i][j] -= tmp

            if i < c:
                dp[i+1][j] += dp[i][j]*(B+j)
            if j < d:
                dp[i][j+1] += dp[i][j]*(A+i)
            # print(dp)
            dp[i][j] %= mod

    print(dp[c][d])


main()



### FIXED CODE ###

def main():
    A, B, C, D = map(int, input().split())

    c = C - A
    d = D - B
    mod = 998244353
    dp = [[0]*(d+1) for i in range(c+1)]
    dp[0][0] = 1

    for i in range(c+1):

        for j in range(d+1):
            ret = 0
            if i == 0 and j == 0:
                continue
            if i > 0 and j > 0:
                if i == j == 1:
                    ret -= (A+i-1) * (B+j-1)
                else:
                    ret -= dp[i-1][j-1]
                    ret *= (A+i-1)*(B+j-1)
            ret += dp[i-1][j]*(B+j) + dp[i][j-1]*(A+i)

            ret %= mod
            dp[i][j] = ret
    print(dp[c][d])


main()
### BUGGY CODE ###

import math
import copy

neko = 0
n = int(input())
p = [int(x) for x in input().split()]
for i in range(n):
    for j in range(i):
        if p[i] > p[j]:
            neko += 1 
            break
print(n-neko)

### FIXED CODE ###

import math
import copy

neko = 0
low = 10**6
n = int(input())
p = [int(x) for x in input().split()]
for i in range(n):
    if p[i]<low:
        neko += 1
    if p[i]<low:
        low = p[i]
print(neko)
### BUGGY CODE ###

n = int(input())
flag = False
for i in range(3500):
    for j in range(i, 3500):
        num = n * i * j
        den = 4 * i * j - i * n - j * n
        if den > 0 and not num % den:
            k = num // den
            print("{} {} {}".format(i, j, k))
            flag = True
            break
    if flag:
        break


### FIXED CODE ###

n = int(input())
imin = n // 4
flag = False
for i in range(imin, 3501):
    num = i * n
    den = 4 * i - n
    if den <= 0:
        continue
    jmin = num // den
    for j in range(jmin, 3501):
        num = i * j * n
        den = 4 * i * j - i * n - j * n
        if den > 0 and num % den == 0:
            k = num // den
            print("{} {} {}".format(i, j, k))
            flag = True
            break
    if flag:
        break
### BUGGY CODE ###

n = int(input())

d = {}
for i in range(n):
    s = input()
    if s in d:
        d[s] += 1
    else:
        d[s] = 1
max_d_list = [kv[0] for kv in d.items() if kv[1] == max(d.values())]

ans = sorted(max_d_list)

for i in ans:
    print(i)


### FIXED CODE ###

n = int(input())

d = {}
for i in range(n):
    s = input()
    if s in d:
        d[s] += 1
    else:
        d[s] = 1
max_d = max(d.values())
max_d_list = [kv[0] for kv in d.items() if kv[1] == max_d]

ans = sorted(max_d_list)

for i in ans:
    print(i)
### BUGGY CODE ###

N, Q = map(int, input().split())
S = list(input())

start_pair = [-1]
for j in range(N-1):
    if S[j] == 'A' and S[j+1] == 'C':
        start_pair.append(j)

for i in range(Q):
    l, r = map(int, input().split())
    l -= 1
    r -= 1
    Count = 0
    for x in start_pair:
        if l <= x < r:
            Count += 1
    print(Count)

### FIXED CODE ###

N, Q = map(int, input().split())
S = input()
T = [0]*N
for i in range(1, N):
    if S[i-1:i+1] == 'AC':
        T[i] = T[i-1] + 1
    else:
        T[i] = T[i-1]
for j in range(Q):
    left, right = map(int, input().split())
    print(T[right-1]-T[left-1])
### BUGGY CODE ###

# -*- coding: utf-8 -*-

r, g, b, n = map(int, input().split())

l = []
l.append(r)
l.append(g)
l.append(b)

l.sort(reverse = True)

cnt = 0

for i in range((n//l[0])+1):
    sum = i*l[0]

    for j in range(((n-i*l[0])//l[1])+1):
        sum = i*l[0]    #足しすぎていた。
        sum = sum + j*l[1]

        if (n - sum)%l[2] == 0:
            cnt = cnt + 1
print(cnt)

### FIXED CODE ###

# -*- coding: utf-8 -*-

r, g, b, n = map(int, input().split())

ans = 0
for i in range((n//r)+1):
    for j in range(((n-i*r)//g)+1):
        if (n - i*r - j*g)%b == 0:
            ans += 1
print(ans)
### BUGGY CODE ###

N = float(input())
ans = float(0)
for i in range(int(N)):
  q = N // int(i+1)
  #print(type(i),type(q),type(ans))
  n = float(i)+1
  b = n*q*(q+1)/2
  ans += float(b)
print(int(ans))

### FIXED CODE ###

N = int(input())
ans = 0
for i in range(int(N)):
  q = N // (i+1)
  #print(type(i),type(q),type(ans))
  ans += (i+1)*q*(q+1)/2
print(int(ans))
### BUGGY CODE ###

import math
from functools import reduce

K = int(input())

def gcd(*numbers):
    return reduce(math.gcd, numbers)

sum = 0

for a in range(1, K + 1):
    for b in range(1, K + 1):
        for c in range(1, K + 1):
            sum += gcd(a, b, c)

print(sum)

### FIXED CODE ###

import math
from functools import reduce

K = int(input())

def gcd(*numbers):
    return reduce(math.gcd, numbers)

sum = 0

for a in range(1, K + 1):
    for b in range(1, K + 1):
        for c in range(1, K + 1):
            sum += gcd(a, b, c)

print(sum)
### BUGGY CODE ###

N,M,L = map(int,input().split())
INF = 10**18
d = [[INF for j in range(N)] for i in range(N)]

# 入力
for _ in range(M):
    A,B,C = map(int,input().split())
    if L < C:
        continue
    d[A-1][B-1] = C
    d[B-1][A-1] = C

# 初期化
for i in range(N):
    d[i][i] = 0

# ワーシャルフロイド1回目
for k in range(N):
    for i in range(N):
        for j in range(N):
            d[i][j] = min(d[i][j], d[i][k] + d[k][j])

for i in range(N):
    for j in range(N):
        if d[i][j] <= L:
            d[i][j] = 1
        else:
            d[i][j] = INF

# 初期化
for i in range(N):
    d[i][i] = 0

# ワーシャルフロイド2回目
for k in range(N):
    for i in range(N):
        for j in range(N):
            d[i][j] = min(d[i][j], d[i][k] + d[k][j])

Q = int(input())

for _ in range(Q):
    s,t = map(int,input().split())
    if d[s-1][t-1] == INF:
        print(-1)
    else:
        print(d[s-1][t-1]-1)



### FIXED CODE ###

N,M,L = map(int,input().split())
INF = 10**18
d = [[INF for j in range(N)] for i in range(N)]

# 入力
for _ in range(M):
    A,B,C = map(int,input().split())
    if L < C:
        continue
    d[A-1][B-1] = C
    d[B-1][A-1] = C

# 初期化
for i in range(N):
    d[i][i] = 0

# ワーシャルフロイド1回目
for k in range(N):
    for i in range(N):
        for j in range(N):
            d[i][j] = min(d[i][j], d[i][k] + d[k][j])

for i in range(N):
    for j in range(N):
        if d[i][j] <= L:
            d[i][j] = 1
        else:
            d[i][j] = INF

# 初期化
for i in range(N):
    d[i][i] = 0

# ワーシャルフロイド2回目
for k in range(N):
    for i in range(N):
        for j in range(N):
            d[i][j] = min(d[i][j], d[i][k] + d[k][j])

Q = int(input())

for _ in range(Q):
    s,t = map(int,input().split())
    if d[s-1][t-1] == INF:
        print(-1)
    else:
        print(d[s-1][t-1]-1)
### BUGGY CODE ###

def main():
    import sys
    input = lambda : sys.stdin.readline().rstrip()

    from heapq import heappush, heappop 

    running = []
    events = []
    delete = set()

    n, q = map(int, input().split())
    for _ in range(n):
        s, t, x = map(int, input().split())
        events.append((s - x, x, 1)) # 追加イベント
        events.append((t - x, x, 0)) # 削除イベント
    for _ in range(q):
        d = int(input())
        events.append((d, 10**10, 2))
    events.sort()
    for i in range(len(events)):
        temp = events[i]
        if temp[-1] == 1:
            heappush(running, temp[1])
            delete.discard(temp[1])
        elif temp[-1] == 0:
            delete.add(temp[1])
        else:
            flag = 1
            while running:
                p = heappop(running)
                if p not in delete:
                    flag = 0
                    heappush(running, p)
                    print(p)
                    break
            if flag:
                print(-1)
if __name__ == '__main__':
    main()





### FIXED CODE ###

import sys
input = lambda : sys.stdin.readline().rstrip()

from heapq import heappush, heappop 

running = []
events = []
delete = set()

n, q = map(int, input().split())
for _ in range(n):
    s, t, x = map(int, input().split())
    time = max(s - x, 0)
    if t - x < 0:
        continue
    events.append((s - x, x, 1)) # 追加イベント
    events.append((t - x, x, 0)) # 削除イベント
events.sort()
ans = []
idx = -1
for _ in range(q):
    d = int(input())
    if d >= events[-1][0]:
        print(-1)
        #ans.append(-1)
        continue
    while events[idx + 1][0] <= d:
        idx += 1
        if events[idx][2] == 1:
            heappush(running, events[idx][1])
            delete.discard(events[idx][1])
        else:
            delete.add(events[idx][1])
    flag = 1
    while running:
        x = heappop(running)
        if x not in delete:
            heappush(running, x)
            print(x)
            #ans.append(x)
            flag = 0
            break
    if flag:
        print(-1)
### BUGGY CODE ###

nl = lambda: list(map(int, input().split()))
sl = lambda: input().split()
n = lambda: int(input())
s = lambda: input()

N, M = nl()
S = nl()
T = nl()

import numpy as np
dp = np.zeros((N+1, M+1), dtype=np.uint32)
for i, s in enumerate(S):
    for j, t in enumerate(T):
        dp[i+1, j+1] += dp[i, j+1] + dp[i+1, j]
        if s == t:
            dp[i+1, j+1] += 1
        else:
            dp[i+1, j+1] -= dp[i, j]
        dp[i+1, j+1] %= 1000000007

print(int(dp[N, M]+1))


### FIXED CODE ###

nl = lambda: list(map(int, input().split()))
sl = lambda: input().split()
n = lambda: int(input())
s = lambda: input()

N, M = nl()
S = nl()
T = nl()

dp = [0] * (M+1)
for i, s in enumerate(S):
    dp2 = dp[:]
    for j, t in enumerate(T):
        dp2[j+1] += dp2[j] - dp[j]
        if s == t:
            dp2[j+1] += dp[j] + 1
    dp = dp2

print((dp[M]+1) % 1000000007)
### BUGGY CODE ###

import numpy as np

N,K,Q = list(map(int , input().split()))
As = [int(input()) for _ in range(Q)]

#特典初期設定
Score = np.ones(N,dtype = int)
Score = Score * K

for A in As:
    Score -= 1
    Score[A - 1] += 1

for ans in Score:
    if(ans > 0):
        print("Yes")
    
    else:
        print("No")


### FIXED CODE ###

N,K,Q = list(map(int , input().split()))
As = [int(input()) for _ in range(Q)]

#特典初期設定
Score = [0 for _ in range(N)]

for A in As:
    Score[A-1] +=1

for ans in Score:
    if(K + ans - Q > 0):
        print("Yes")
    
    else:
        print("No")
### BUGGY CODE ###

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

A = [v-i-1 for i,v in enumerate(A)]
print(min(sum(abs(v - b) for v in A) for b in range(min(A),max(A)+1)))


### FIXED CODE ###

from statistics import median_low

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

A = [v-i-1 for i,v in enumerate(A)]
x = median_low(A)

print(sum(abs(v - x) for v in A))
### BUGGY CODE ###

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

c = {a: A.count(a) for a in A if A.count(a) >= 2}
cc = sorted(c)
x = len(c)
if(x <= 1):
  ans = 0
elif(c.get(cc[x-1]) >= 4):
  ans = cc[x-1] * cc[x-1]
else:
  ans = cc[x-1] * cc[x-2]
print(ans)

### FIXED CODE ###

N = int(input())
A = list(map(int,input().split()))
d = {}
for a in A:
  if(a in d):
    d[a] += 1
  else:
    d[a] = 1
x, y = 0, 0
for k, v in d.items():
  if(v >= 2 and k > y):
    if(k >= x):
      if(v >= 4):
        y = k
      else:
        y = x
      x = k
    else:
      y = k
print(x * y)
### BUGGY CODE ###

_sum = 0
N = int(input())
for i in range(1, N):
    _sum += i

print(_sum)

### FIXED CODE ###

N = int(input())
print((N-1)*(N) // 2)
### BUGGY CODE ###

N = int(input())
A = map(int, input().split())
ans = 1
for a in A:
    ans *= a

if ans > 10**18:
    ans = -1
print(ans)
    

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
if 0 in A:
    ans = 0
else:
    ans = 1
    for a in A:
        ans *= a
        if ans > 10**18:
            ans = -1
            break
print(ans)
### BUGGY CODE ###

n, m = map(int, input().split())
a = list(map(int, input().split()))
bc = [[int(i) for i in input().split()] for i in range(m)]
bc.sort(key = lambda x:x[1], reverse = True)


for i in range(m):
        a.sort()
        bc_temp = bc[i]
        if bc_temp[1] < a[0]:
                break
        for j in range(bc_temp[0]):
                if a[j] < bc_temp[1]:
                        a[j] = bc_temp[1]
                elif a[j] > bc_temp[1]:
                        break

print(sum(a)) 

### FIXED CODE ###

n, m = map(int, input().split())
a = list(map(int, input().split()))
bc = [[int(i) for i in input().split()] for i in range(m)]

bc.sort(key = lambda x:x[1], reverse = True)

a.sort()

a_count = 0
for b, c in bc:
        if c > a[a_count]:
                for i in range(b):
                        if c > a[a_count]:
                                a[a_count] = c
                                a_count += 1    
                        else:
                                break
                        if a_count == n:
                                        break

        else:
                break
        if a_count == n:
                break        

print(sum(a))
### BUGGY CODE ###

string = list(input())
erase = 'erase'
eraser = 'eraser'
dream = 'dream'
dreamer = 'dreamer'
er = 'er'
a = 'a'
r = 'r'
while True:
    if "".join(string[:5]) == dream:
        if "".join(string[5:7]) == er:
            if "".join(string[7:8]) == a:
                string = string[5:]
            else:
                string = string[7:]
        else:
            string = string[5:]
    elif "".join(string[:5]) == erase:
        if "".join(string[5:6]) == r:
            if "".join(string[6:7]) == a:
                string = string[5:]
            else:
                string = string[6:]
        else:
                string = string[5:]
    elif string == []:
        print('YES')
        break
    else:
        print('NO')
        break

### FIXED CODE ###

string = input()
erase = 'erase'
eraser = 'eraser'
dream = 'dream'
dreamer = 'dreamer'
er = 'er'
a = 'a'
r = 'r'
while True:
    if string[:5] == dream:
        if string[5:7] == er:
            if string[7:8] == a:
                string = string[5:]
            else:
                string = string[7:]
        else:
            string = string[5:]
    elif string[:5] == erase:
        if string[5:6] == r:
            if string[6:7] == a:
                string = string[5:]
            else:
                string = string[6:]
        else:
            string = string[5:]
    elif string == '':
        print('YES')
        break
    else:
        print('NO')
        break
### BUGGY CODE ###


from operator import itemgetter
from copy import deepcopy

rlist = []
def dfs(i1,r1,alist1,q,qlist):
    if i1 >= q:
        rlist.append(r1)
    else:
        eq = qlist[i1]
        eq0 = eq[0]
        eq1 = eq[1]
        eq2 = eq[2]
        eq3 = eq[3]
        if alist1[eq0] != -1 and alist1[eq1] != -1 and alist1[eq1] - alist1[eq0] == eq2:
            r1 += eq3
        alist1t1 = deepcopy(alist1)
        dfs(i1+1, r1, alist1t1,q,qlist) #alistを変えずに再帰
        alist1t2 = deepcopy(alist1)
        if alist1t2[eq1] == -1 and alist1t2[eq0] == -1:
            alist1t2[eq1] = 100000
            alist1t2[eq0] = 100000 - eq2
            r1 += eq3
        elif alist1t2[eq1] == -1 and alist1t2[eq0] != -1:
            alist1t2[eq1] = alist1t2[eq0] + eq2
            r1 += eq3
        elif alist1t2[eq1] != -1 and alist1t2[eq0] == -1:
            alist1t2[eq0] = alist1t2[eq1] - eq2
            r1 += eq3
        dfs(i1+1,r1,alist1t2,q,qlist)

def main():
    n, m, q = map(int, input().split())
    qlist = []
    for _ in range(q):
        qlist.append(tuple(map(int, input().split())))
    qlist.sort(key=itemgetter(3), reverse=True)
    alist = [-1] * (n + 1)
    r = 0
    dfs(0,r,alist,q,qlist)
    print(max(rlist))

if __name__ == '__main__':
    main()

### FIXED CODE ###

from itertools import combinations_with_replacement
def main():
    n, m, q = map(int, input().split())
    qlist = []
    for _ in range(q):
        qlist.append(tuple(map(int, input().split())))

    nums = [i for i in range(1, m + 1)]
    alist = tuple(combinations_with_replacement(nums, n))

    r = 0
    for al in alist:
        tr = 0
        for eq in qlist:
            eq0 = eq[0] - 1
            eq1 = eq[1] - 1
            eq2 = eq[2]
            eq3 = eq[3]
            if al[eq1] - al[eq0] == eq2:
                tr += eq3
        r = max(r, tr)

    print(r)

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

n = int(input())
a = [int(i) for i in input().split()]

b = []
b.append(a[0])

for i in range(n-1):
    b.append(a[i+1])
    b = b[::-1]
    
print(*b)

### FIXED CODE ###

n = int(input())
a = [int(i) for i in input().split()]

b = []

for i in range((n+1)//2):
    #print(i)
    b.append(a[n-1-2*i])

even = False

if n % 2 == 0:
    even = False
else:
    even = True

if even == True:
    for i in range(n//2):
        b.append(a[1+2*i])
else:
    for i in range(n//2):
        b.append(a[2*i])
    

print(*b)
### BUGGY CODE ###

N = int(input())
S = input()
 
r , g, b = S.count("R"), S.count("G"), S.count("B")
ans = r * g * b
 
for i in range(N-2):
    for d in range(N//2+1):
        j = i + d
        k = j + d
        if k < N:
            if S[i] != S[j] and S[j] != S[k] and S[k] != S[i]:
                ans -= 1
print(ans)

### FIXED CODE ###

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

r , g, b = S.count("R"), S.count("G"), S.count("B")
ans = r * g * b

for i in range(N-2):
    for d in range(N//2+1):
        j = i + d
        k = j + d
        if k >= N:break
        if S[i] != S[j] and S[j] != S[k] and S[k] != S[i]:
            ans -= 1
print(ans)
### BUGGY CODE ###

N = int(input())
f = [ i for i in range(1, N + 1)]
for i in f:
  ans = 0
  for x in range(1, i + 1):
    for y in range(1, i + 1):
      for z in range(1, i + 1):
        if (x**2 + y**2 + z**2 + x*y + y*z + z*x) == i:
          ans += 1
  print(ans)

### FIXED CODE ###

N = int(input())
ans = [ 0 for _ in range(10500)]
for i in range(1, 105):
  for j in range(1, 105):
    for k in range(1, 105):
      v = i**2 + j**2 + k**2 + i*j + j*k + k*i
      if v < 10500:
        ans[v] += 1
for i in range(N):
  print(ans[i + 1])