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

num = int(input())
s = input().split(" ")
num_list = [int(x) for x in s]
taken_list, count = num_list.copy(), 0
for x in num_list:
    taken_list.remove(taken_list[0])
    for y in taken_list:
        count += x ^ y
print(count % (pow(10, 9)+7))

### FIXED CODE ###

import numpy as np
 
MAX_DIGIT = 60
MOD = 10**9 + 7
 
N = int(input())
A = np.array([int(a) for a in input().split()])
 
answer = 0
for d in range(MAX_DIGIT + 1):
    A, r = (A>>1), A % 2
    s = int(r.sum())
    base = (1<<d) % MOD
    answer += (base * s * (N - s)) % MOD
 
answer %= MOD
print(answer)
### BUGGY CODE ###

from collections import Counter
ans = 0
s = []
N = int(input())
for i in range(N):
	tmp = []
	string = input()
	for st in string:
		tmp.append(st)
	s.append(tmp)

for m in range(len(s)):
	for n in range(len(s)):
		if Counter(s[n])==Counter(s[m]) and s[m] != s[n]:
			ans+=1
print(int(ans/2))


### FIXED CODE ###

ans = 0
s = {}
N = int(input())
for i in range(N):
	tmp = []
	string = input()
	for st in string:
		tmp.append(st)
	tmp.sort()
	stmp = ''.join(tmp)
	if stmp in s and s[stmp] > 0:
		ans += s[stmp]
		s[stmp] = s[stmp]+1
	else:
		s[stmp] = 1
print(ans)
### BUGGY CODE ###

import math
from math import gcd,pi,sqrt
INF = float("inf")

import sys
sys.setrecursionlimit(10**6)
import itertools
from collections import Counter,deque
def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_str(N): return [s_list() for _ in range(N)]
def s_row_list(N): return [list(s_input()) for _ in range(N)]


def main():
    k,s = i_map()
    ans = 0
    l = list(itertools.combinations_with_replacement(list(range(k+1)),3))
    for i in l:
        x = i[0]
        y = i[1]
        z = i[2]
        if x+y+z == s:
            if len(set(i)) == 1:
                ans += 1
            elif len(set(i)) == 2:
                ans += 3
            else:
                ans += 6
    print(ans)

if __name__=="__main__":
    main()


### FIXED CODE ###

import math
from math import gcd,pi,sqrt
INF = float("inf")

import sys
sys.setrecursionlimit(10**6)
import itertools
from collections import Counter,deque
def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_str(N): return [s_list() for _ in range(N)]
def s_row_list(N): return [list(s_input()) for _ in range(N)]


def main():
    k,s = i_map()
    ans = 0
    for x in range(k+1):
        for y in range(k+1):
            z = s-x-y
            if 0<=z <=k:
                ans += 1
    print(ans)

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

from collections import deque


A = input()
N = len(A)
a = ord('a')

INF = N
na = [[INF] * 26 for _ in range(N)]
for i in range(N - 1, -1, -1):
    c = ord(A[i]) - ord('a')
    for j in range(26):
        na[i][j] = i if c == j else na[(i + 1) % N][j]

q = deque()
q.append(('', -1))

while q:
    s, i = q.popleft()
    for j in range(26):
        ni = na[i + 1][j]
        if ni == INF:
            print(s + chr(a + j))
            exit()
        else:
            q.append((s + chr(a + j), ni))


### FIXED CODE ###

def main():
    # import sys
    # readline = sys.stdin.readline
    # readlines = sys.stdin.readlines
    
    A = input()
    N = len(A)
    a = ord('a')

    INF = N
    na = [[INF] * 26 for _ in range(N + 1)]
    for i in range(N - 1, -1, -1):
        c = ord(A[i]) - a
        for j in range(26):
            na[i][j] = na[i + 1][j]
        na[i][c] = i

    dp = [INF] * (N + 1)
    dp[N] = 1
    recon = [None] * (N + 1)
    for i in range(N - 1, -1, -1):
        for j in range(26):
            ni = na[i][j]
            if ni == N:
                if dp[i] > 1:
                    dp[i] = 1
                    recon[i] = (chr(a + j), N)
            elif dp[i] > dp[ni + 1] + 1:
                dp[i] = dp[ni + 1] + 1
                recon[i] = (chr(a + j), ni + 1)

    # k =
    # for j in range(26):
    #     ni = na[0][j]
    #     if dp[i] > dp[ni] + 1:

    i = 0
    ans = []
    while i < N:
        c, ni = recon[i]
        ans.append(c)
        i = ni

    print(''.join(ans))


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

import sys
from queue import Queue


def get_costs(S):
    costs = [[0 for w in range(len(S[0]))] for h in range(len(S))]
    for h in range(len(S)):
        for w in range(len(S[0])):
            if S[h][w] == '#':
                costs[h][w] = -1
    return costs


def print_costs(costs):
    for c in costs:
        print(c)


def solve(inp):
    (H, W) = map(int, inp.readline().strip().split(' '))
    S = [list(inp.readline().strip()) for i in range(H)]

    max_cost = 0
    for start_y in range(H):
        for start_x in range(W):
            if S[start_y][start_x] == '#':
                continue
            costs = get_costs(S)
            queue = Queue()
            queue.put((start_y, start_x, 1))
            cost = 1
            while not queue.empty():
                (y, x, c) = queue.get()
                # print("({},{}): {}".format(y, x, c))
                costs[y][x] = c
                cost = c
                for (next_y, next_x) in [(y - 1, x), (y, x + 1), (y + 1, x), (y, x - 1)]:
                    if 0 <= next_y < H and 0 <= next_x < W and S[next_y][next_x] == '.' and costs[next_y][next_x] == 0:
                        queue.put((next_y, next_x, c + 1))
            if cost > max_cost:
                max_cost = cost
            # print("--- cost={}".format(max_cost))
            # print_costs(costs)
            # print()

    return str(max_cost - 1)


def main():
    result = solve(sys.stdin)
    if result:
        print(result)


if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
from queue import Queue


def print_costs(costs):
    for c in costs:
        print(c)


def solve(inp):
    (H, W) = map(int, inp.readline().strip().split(' '))
    S = [list(inp.readline().strip()) for i in range(H)]

    max_cost = 0
    for start_y in range(H):
        for start_x in range(W):
            if S[start_y][start_x] == '#':
                continue
            costs = [[0 for w in range(W)] for h in range(H)]
            costs[start_y][start_x] = 1
            queue = Queue()
            queue.put((start_y, start_x))
            cost = 1
            while not queue.empty():
                (y, x) = queue.get()
                # print("({},{}): {}".format(y, x, c))
                for (next_y, next_x) in [(y - 1, x), (y, x + 1), (y + 1, x), (y, x - 1)]:
                    if 0 <= next_y < H and 0 <= next_x < W and S[next_y][next_x] == '.' and costs[next_y][next_x] == 0:
                        costs[next_y][next_x] = costs[y][x] + 1
                        if cost < costs[next_y][next_x]:
                            cost = costs[next_y][next_x]
                        queue.put((next_y, next_x))
            if cost > max_cost:
                max_cost = cost
            # print("--- cost={}".format(max_cost))
            # print_costs(costs)
            # print()

    return str(max_cost - 1)


def main():
    result = solve(sys.stdin)
    if result:
        print(result)


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

from collections import defaultdict
N, = map(int, input().split())
dd = defaultdict(int)
ss = []
for _ in range(N):
    a, b, c, d = map(int, input().split())
    dd[(a,b,c,d)] += 1
    dd[(b,c,d,a)] += 1
    dd[(c,d,a,b)] += 1
    dd[(d,a,b,c)] += 1
    ss.append((a,b,c,d))
def icr(x):
    a, b, c, d = x
    for faf in [(b,c,d,a), (c,d,a,b), (d,a,b,c), (a,b,c,d)]:
        dd[faf] += 1
def dcr(x):
    a, b, c, d = x
    for faf in [(b,c,d,a), (c,d,a,b), (d,a,b,c), (a,b,c,d)]:
        dd[faf] -= 1

def f(ff, gg):
    a,b,c,d=ff
    e, h, g, f = gg
    tl = [(a,e,f,b), (b,f,g,c), (c,g,h,d), (d,h,e,a)]
    r = 1
    for cp in tl:
        r *= dd[cp]
        dcr(cp)
    for cp in tl:
        icr(cp)
    return r

r = 0
for i in range(N):
    a,b,c,d = ss[i]
    ff = (a,b,c,d)
    dcr(ff)
    for j in range(i+1, N):
        if i == j:
            continue
        x, y, z, w = ss[j]
        sl = [(x,y,z,w), (y,z,w,x), (z,w,x,y), (w,x,y,z)]
        for s in sl:
            dcr(s)
            r += f(ff,s)
            icr(s)
    icr(ff)
print(r//3)
 


### FIXED CODE ###

from collections import defaultdict
N, = map(int, input().split())

def normal(xs):
    mnx = min(xs)
    xi = xs.index(mnx)
    if xs[(xi+3)%4] == mnx:
        if xs[(xi+2)%4] == mnx:
            xi = (xi+2)%4
        else:
            xi = (xi+3)%4
    if xs[(xi+1)%4] > xs[(xi+3)%4]:
        xi = (xi+2)%4
    return (xs[xi%4], xs[(xi+1)%4], xs[(xi+2)%4], xs[(xi+3)%4])
#x = (0,2,2,0)
#print(normal(x))

dd = defaultdict(int)
ss = []
for _ in range(N):
    a, b, c, d = map(int, input().split())
    x = normal([a,b,c,d])
    n=1
    if x[0] == x[2] and x[1] == x[3]:
        n *= 2
        if x[0] == x[1]:
            n *= 2
    dd[x] += n
    ss.append(x)

def icr(x):
    n = 1
    if x[0] == x[2] and x[1] == x[3]:
        n *= 2
        if x[0] == x[1]:
            n *= 2
    dd[x] += n

def dcr(x):
    n = 1
    if x[0] == x[2] and x[1] == x[3]:
        n *= 2
        if x[0] == x[1]:
            n *= 2
    dd[x] -= n

def f(ff, gg):
    #print(dd)
    a,b,c,d=ff
    e,h,g,f=gg
    tl = list(map(normal, [(a,e,f,b), (b,f,g,c), (c,g,h,d), (d,h,e,a)]))
    r = 1
    for cp in tl:
        if cp not in dd:
            r = 0
            break
        r *= dd[cp]
        dcr(cp)
    for cp in tl:
        if cp not in dd:
            break
        icr(cp)
    return r

r = 0
for i in range(N):
    ff = ss[i]
    dcr(ff)
    for j in range(i+1, N):
        sl = ss[j]
        dcr(sl)
        x, y, z, w = sl
        sls = [(x,y,z,w), (y,z,w,x), (z,w,x,y), (w,x,y,z)]
        for s in sls:
            r += f(ff, s)
        icr(sl)
    icr(ff)
print(r//3)
### BUGGY CODE ###

N = int(input())
S = input()
dp = [[0]*(N+1) for _ in range(N+1)]
for i in range(N)[::-1]:
    for j in range(N)[::-1]:
        if S[i] == S[j]:
            dp[i][j] = dp[i+1][j+1] + 1

print(max(max(min(dp[a][b], a-b) for a in range(b, N)) for b in range(N)))

### FIXED CODE ###

N = int(input())
S = input()
ans = 0
for i in range(N):
    if N-i<ans:
        break
    if S[i+1:].find(S[i-ans:i+1])>=0:
        ans += 1
print(ans)
### BUGGY CODE ###

N = int(input())
ss = []

for i in range(N):
    ss.append(sorted(input()))
    
ans = 0

for i in ss:
    k = ss.count(i)
    ans += k-1

print(int(ans/2))


### FIXED CODE ###

N = int(input())
ss = {}
ht = []
ans = 0

for i in range(N):
    s = ''.join(sorted(input()))
    if not s in ss.keys():
        ss[s] = 1
    else:
        ans += ss[s]
        ss[s] += 1

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

n = int(input())
s = input()
d = n-3
ans = set()
for i in range(n-2):
  for j in range(i+1,n-1):
    for k in range(j+1,n):
      ans.add(s[i]+s[j]+s[k])
print(len(ans))

### FIXED CODE ###

input()
S = [int(i) for i in input()]
cnt = 0
for i in range(0, 1000):
  c = (i//100, (i//10)%10, i%10)
  f = 0
  for s in S:
    if s == c[f]:
      f += 1 
      if f==3:break 
  if f==3:cnt += 1
print(cnt)
### BUGGY CODE ###

# -*- coding: utf-8 -*-
import math

def combinations_count(n, r):
    if n < r:
        return 0
    else:
        return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

def main():
    N = int(input())
    A = [int(i) for i in input().split()]
    counter = 0
    for a in set(A):
        counter+=combinations_count(A.count(a),2)

    for a in A:
        print(counter-A.count(a)+1)

if __name__ == "__main__":
    main()


### FIXED CODE ###

# -*- coding: utf-8 -*-
import math
import collections

def combinations_count(n, r):
    if n < r:
        return 0
    else:
        return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

def main():
    N = int(input())
    A = [int(i) for i in input().split()]
    counter = 0
    a_c = collections.Counter(A)
    for v in a_c.values():
        counter += combinations_count(v,2)

    for a in A:
        print(counter-a_c[a]+1)

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

r, g, b, n = map(int, input().split())
count=0
for i in range(0,(int)(n/r)+1):
    for j in range(0, (int)(n/g)+1):
        if (n-i*r-j*g)%b == 0 and (n-i*r-j*g)>=0:
            count+=1

print(count)

### FIXED CODE ###

r, g, b, n = map(int, input().split())
count=0
for i in range(0,(int)(n/r)+1):
    for j in range(0, (int)((n-i*r)/g)+1):
        v = n-i*r-j*g
        if v%b == 0 and v>=0:
            count+=1

print(count)
### BUGGY CODE ###

n, m =map(int, input().split())
a=m//n
c=0
while c==0:
  if((m-a*n)%a==0):
      c=a
  a=a-1
print(c)


### FIXED CODE ###

n,m=map(int,input().split())
a=1
for i in range(1,min(int(m**0.5),m//n)+1):
    if(m%i==0):
        if(i>=n):
            a=m//i
            break
        else:
            a=i
print(a)
### BUGGY CODE ###

from math import factorial
import sys

input=sys.stdin.readline

num=int(input())
stl =[''.join(sorted(input())) for i in range(num)]

duplicate=[x for x in set(stl) if stl.count(x) > 1]

count=0

for dup in duplicate:
    n=stl.count(dup)
    count += factorial(n) // 2 // factorial(n - 2)
print(count)

### FIXED CODE ###

num=int(input())
stl =[''.join(sorted(input())) for i in range(num)]

#duplicate=[x for x in set(stl) if stl.count(x) > 1]

t = {}
for i in range(num):
  if stl[i] in t:
    t[stl[i]] += 1
  else:
    t[stl[i]] = 1
print(sum(t[k] * (t[k] -1) // 2 for k in t))
### BUGGY CODE ###

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

queue = [input().split() for y in range(n)]
time = 0;

while True:
    if int(queue[0][1]) <= q:
        time += int(queue[0][1])
        print(queue[0][0], time)
        if len(queue) == 1:
            break
        queue.pop(0)
    else:
        time += q
        queue[0][1] = str(int(queue[0][1]) - q)
        queue = queue[1:] + queue[:1]



### FIXED CODE ###

n, quantum = list(map(int, input().split()))
queue = []
sumOfTime = 0

for _ in range(n):
    name, time = input().split()
    queue.append([name, int(time)])

while len(queue) > 0:
    name, time = queue.pop(0)
    if time > quantum:
        sumOfTime += quantum
        queue.append([name, time - quantum])
    else:
        sumOfTime += time
        print(name, sumOfTime)
### BUGGY CODE ###

from itertools import combinations
from collections import defaultdict
inf=10**7
n,x,y=map(int,input().split())
x-=1
y-=1
dis={}
cnt=defaultdict(int)
for i,j in combinations(range(n),2):
  dis[(i,j)]=min(abs(j-i),abs(j-y)+1+abs(i-x),abs(j-x)+1+abs(i-y))
for i,j in combinations(range(n),2):
  cnt[dis[(i,j)]]+=1
for k in range(1,n):
  print(cnt[k])

### FIXED CODE ###

from itertools import combinations
from collections import defaultdict
n,x,y=map(int,input().split())
x-=1
y-=1
cnt=defaultdict(int)
for i,j in combinations(range(n),2):
  cnt[min(abs(j-i),abs(j-y)+1+abs(i-x),abs(j-x)+1+abs(i-y))]+=1
for k in range(1,n):
  print(cnt[k])
### BUGGY CODE ###

n, m, R = list(map(int, input().split()))
dist = [[float("INF") if i!=j else 0 for i in range(n)] for j in range(n)]
r = list(map(int, input().split()))
for i in range(m):
  a, b, c = list(map(int, input().split()))
  a, b = a-1, b-1
  dist[a][b] = c
  dist[b][a] = c
for k in range(n):
  for i in range(n):
    for j in range(n):
      dist[i][j] = min(dist[i][j], dist[i][k] + dist[k][j])

from itertools import permutations
ans = float("INF")
for e in permutations(r):
  cur = 0
  for i in range(R-1):
    cur += dist[e[i]-1][e[i+1]-1]
  ans = min(ans, cur)
print(ans)

### FIXED CODE ###

n, m, R = list(map(int, input().split()))
dist = [[float("INF") if i!=j else 0 for i in range(n)] for j in range(n)]
r = list(map(int, input().split()))
for i in range(m):
  a, b, c = list(map(int, input().split()))
  a, b = a-1, b-1
  dist[a][b] = c
  dist[b][a] = c
for k in range(n):
  for i in range(n):
    for j in range(n):
      dist[i][j] = min(dist[i][j], dist[i][k] + dist[k][j])

from itertools import permutations
ans = float("INF")
for e in permutations(r):
  cur = 0
  for i in range(R-1):
    cur += dist[e[i]-1][e[i+1]-1]
  ans = min(ans, cur)
print(ans)
### BUGGY CODE ###

n = int(input())
a = list(map(int,input().split()))
a_sort = sorted(a)
from collections import Counter
dp = [[0 for _ in range(n+1)] for _ in range(n)]
cnt = Counter()
dic= {}
for i in range(n):
    if dic.get(a[i]) is None:
        dic[a[i]] = [i]
    else:
        dic[a[i]] += [i]
    cnt[a[i]]+=1

def maximize(rang_, pos_):
    pos = pos_.copy()
    rang = rang_.copy()
    ret= 0 
    while pos != []:
        if abs(rang[0]-pos[-1]) < abs(rang[-1]-pos[0]):
            ret += abs(rang[-1]-pos[0])
            del rang[-1]
            del pos[0]
        else:
            ret += abs(rang[0]-pos[-1]) 
            del rang[0]
            del pos[-1]
    return ret

sorted_keys = sorted(cnt.keys())
acm=0
for x in sorted_keys:
    num = cnt[x]
    for i in range(n):
        if i + acm + num <= n:
            if acm == 0:
                dp[i][acm+num] = x*maximize(list(range(i,i+num)), dic[x])
            else:
                for j in range(i,i+num+1):
                    #print(f"dp[{i}][{acm}+{num}] = max(dp[{i}][{acm}+{num}],dp[{j}][{acm}] + {x}*maximize(list(range({i},{j}))+list(range({j}+{acm},{i}+{acm}+{num})), dic[{x}]))")
                    #print(j,acm,dp[j][acm])
                    dp[i][acm+num] = max(dp[i][acm+num],dp[j][acm] + x*maximize(list(range(i,j))+list(range(j+acm,i+acm+num)), dic[x]))
    acm += num

print(max(dp[0]))

### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
from collections import Counter
dp = [[0 for _ in range(n+1)] for _ in range(n)]
cnt = Counter()
dic= {}
for i in range(n):
    if dic.get(a[i]) is None:
        dic[a[i]] = [i]
    else:
        dic[a[i]] += [i]
    cnt[a[i]]+=1

def maximize(rang, pos):
    lb_rang = 0
    ub_rang = len(rang) - 1
    lb_pos = 0
    ub_pos = len(pos) - 1
    ret= 0 
    while lb_rang <= ub_rang:
        if abs(rang[lb_rang]-pos[ub_pos]) < abs(rang[ub_rang]-pos[lb_pos]):
            ret += abs(rang[ub_rang]-pos[lb_pos])
            ub_rang -= 1
            lb_pos += 1
        else:
            ret += abs(rang[lb_rang]-pos[ub_pos]) 
            lb_rang += 1
            ub_pos -= 1
    return ret

sorted_keys = sorted(cnt.keys())
acm=0
for x in sorted_keys:
    num = cnt[x]
    for i in range(n):
        if i + acm + num <= n:
            if acm == 0:
                dp[i][acm+num] = x*maximize(list(range(i,i+num)), dic[x])
            else:
                for j in range(i,i+num+1):
                    #print(f"dp[{i}][{acm}+{num}] = max(dp[{i}][{acm}+{num}],dp[{j}][{acm}] + {x}*maximize(list(range({i},{j}))+list(range({j}+{acm},{i}+{acm}+{num})), dic[{x}]))")
                    #print(j,acm,dp[j][acm])
                    dp[i][acm+num] = max(dp[i][acm+num],dp[j][acm] + x*maximize(list(range(i,j))+list(range(j+acm,i+acm+num)), dic[x]))
    acm += num

print(max(dp[0]))
### BUGGY CODE ###

import copy
 
h, w = map(int, input().split())
s = [input() for _ in range(h)]
canlight = [[int(c == '.') for c in s[y]] for y in range(h)]
leftbeam = copy.deepcopy(canlight)
rightbeam = copy.deepcopy(canlight)
downbeam = copy.deepcopy(canlight)
upbeam = copy.deepcopy(canlight)
 
for y in range(h):
    for x in range(w - 1):
        leftbeam[y][x + 1] = (leftbeam[y][x] + 1) * canlight[y][x + 1]
    for x in range(1, w):
        rightbeam[y][-(x + 1)] = (rightbeam[y][-x] + 1) * canlight[y][-(x + 1)]
 
for x in range(w):
    for y in range(h - 1):
        downbeam[y + 1][x] = (downbeam[y][x] + 1) * canlight[y + 1][x]
    for y in range(1, h):
        upbeam[-(y + 1)][x] = (upbeam[-y][x] + 1) * canlight[-(y + 1)][x]
 
ans = 0
for y in range(h):
    for x in range(w):
        ans = max(ans, leftbeam[y][x] + rightbeam[y][x]
                     + downbeam[y][x] + upbeam[y][x] - 3)
print(ans)

### FIXED CODE ###

h, w = map(int, input().split())
s = [input() for _ in range(h)]
leftbeam = [[0 for _ in range(w)] for _ in range(h)]
rightbeam = [[0 for _ in range(w)] for _ in range(h)]
downbeam = [[0 for _ in range(w)] for _ in range(h)]
upbeam = [[0 for _ in range(w)] for _ in range(h)]

def can_light(y, x):
    return (0 <= y < h) and (0 <= x < w) and s[y][x] == '.'

for y in range(h):
    beamlen = 0
    for x in range(w):
        if can_light(y, x):
            beamlen += 1
        else:
            beamlen = 0
        leftbeam[y][x] = beamlen

for y in range(h):
    beamlen = 0
    for x in range(w):
        if can_light(y, w - x - 1):
            beamlen += 1
        else:
            beamlen = 0
        rightbeam[y][w - x - 1] = beamlen


for x in range(w):
    beamlen = 0
    for y in range(h):
        if can_light(y, x):
            beamlen += 1
        else:
            beamlen = 0
        downbeam[y][x] = beamlen

for x in range(w):
    beamlen = 0
    for y in range(h):
        if can_light(h - y - 1, x):
            beamlen += 1
        else:
            beamlen = 0
        upbeam[h - y - 1][x] = beamlen

ans = 0
for y in range(h):
    for x in range(w):
        ans = max(ans, leftbeam[y][x] + rightbeam[y][x]
                     + downbeam[y][x] + upbeam[y][x] - 3)

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

S = input()
N = len(S)

children = [0] * N

for j in range(N): # 子供ごと

	if S[j] == 'R':
		pos_next = j + 1
		while S[pos_next] == 'R':
			pos_next += 1

		num_until_turn = pos_next - j
		num_after_turn = 10**100 - num_until_turn

		if num_after_turn % 2 == 0:
			children[pos_next] += 1
		else:
			children[pos_next-1] += 1

	else:  # 'L'
		pos_next = j - 1
		while S[pos_next] == 'L':
			pos_next -= 1

		num_until_turn = pos_next - j
		num_after_turn = 10**100 - num_until_turn

		if num_after_turn % 2 == 0:
			children[pos_next] += 1
		else:
			children[pos_next+1] += 1

print(*children)


### FIXED CODE ###

S = input()
N = len(S)

children = [0] * N

turn_position = list()

for i in range(N-1):
	if S[i]=='R' and S[i+1]=='L':
		turn_position.append(i)

for turn_i in range(len(turn_position) - 1):
	turn_pos = turn_position[turn_i]
	turn_pos_next = turn_position[turn_i + 1]

	children[turn_pos] += 1
	children[turn_pos+1] += 1

	for pos_i in range(turn_pos+2, turn_pos_next):
		if S[pos_i] == 'L':
			if (pos_i - turn_pos) % 2 == 0:
				children[turn_pos] += 1
			else:
				children[turn_pos+1] += 1
		else:
			if (turn_pos_next - pos_i) % 2 == 0:
				children[turn_pos_next] += 1
			else:
				children[turn_pos_next+1] += 1

turn_pos_first = turn_position[0]
for pos_i in range(0, turn_pos_first):
	if (turn_pos_first - pos_i) % 2 == 0:
		children[turn_pos_first] += 1
	else:
		children[turn_pos_first+1] += 1

turn_pos_last = turn_position[-1]
children[turn_pos_last] += 1
children[turn_pos_last+1] += 1
for pos_i in range(turn_pos_last+2, N):
	if (pos_i - turn_pos_last) % 2 == 0:
		children[turn_pos_last] += 1
	else:
		children[turn_pos_last+1] += 1

print(*children)
### BUGGY CODE ###

n = int(input())

lst = [0]*n
a = int(n ** 0.5)

for x in range(1, a):
    for y in range(1, a):
        for z in range(1, a):
            b = x**2 + y**2 + z**2 + x*y + y*z + z*x
            while b <= n:
                lst[b - 1] += 1

for i in lst:
    print(i) 


### FIXED CODE ###

n = int(input())

lst = [0]*n
a = int(n ** 0.5)

for x in range(1, a):
    for y in range(1, a):
        for z in range(1, a):
            b = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if b > n:
                continue
            else:
                lst[b - 1] += 1

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

n = int(input())
a = list(map(int, input().split()))
b = []
for i in range(n):
    b.append(a[i])
    b = b[::-1]
print(' '.join(map(str, b)))

### FIXED CODE ###

from collections import deque
n = int(input())
a = list(map(int, input().split()))
b = deque()
for i in range(n):
    if i % 2 == n % 2:
        b.append(a[i])
    else:
        b.appendleft(a[i])

print(*list(b))