Harryxun/stf_run huggingface dataset:
n = int(input())

aList = list(map(int, input().split()))

if 0 in aList:
  print(0)
else:
  for i in range(n):
    if i == 0:
      continue
    result = result * aList[i]
    if result > 10 ** 18:
      result = -1
      break
  print(result)

### FIXED CODE ###

n = int(input())
 
aList = list(map(int,input().split()))
 
if 0 in aList:
  print(0)
else:
  result = 1
  for a in aList:
    result = result * a
    if result > 10 ** 18:
      result = -1
      break
  print(result)
def main():
    n, k = map(int, input().split())
    heights = list(map(int, input().split()))

    dp = [float('inf') for i in range(n)]
    dp[0] = 0
    for i in range(1, n):
        # dp[i] = min(dp[j] + abs(heights[i] - heights[j]) for j in range(max(i - k, 0), i))
        dp[i] = min(dp[i - j] + abs(heights[i] - heights[i - j]) for j in range(1, k + 1))

    print(dp[n - 1])


if __name__ == '__main__':
    main()


### FIXED CODE ###

def main():
    n, k = map(int, input().split())
    heights = list(map(int, input().split()))

    dp = [float('inf') for i in range(n)]
    dp[0] = 0
    for i in range(1, n):
        dp[i] = min(dp[j] + abs(heights[i] - heights[j]) for j in range(max(i - k, 0), i))
        # for j in range(1, k + 1):
        #     if i - j < 0:
        #         break
        #     dp[i] = min(dp[i], dp[i - j] + abs(heights[i] - heights[i - j]))

    print(dp[n - 1])


if __name__ == '__main__':
    main()
N, K = map(int, input().split())

def combination(a, b):
    minb = min(a-b, b)
    r = 1
    for i in range(1, b+1):
        r = r * (a-b+i)/i
    return r

for i in range(1, K+1):
    if i-1 == 0:
        must = 1
    else:
        must = combination(K-1, i-1)
    left_ball = N-K-i+1
    if left_ball < 0:
        print(0)
        continue
    elif left_ball == 0:
        print(1)
        continue
    can = combination(left_ball+i, i)
    print(int((must*can)%(1000000007)))

### FIXED CODE ###

N, K = map(int, input().split())
mod = 10**9+7

import math

def combination(a, b):
    minb = min(a-b, b)
    r = 1
    for j in range(1, minb+1):
        r = r * (a-minb+j)//j
    return int(r)

for i in range(1, K+1):
    if N==K and i!=1:
        print(0)
        continue
    must = combination(K-1, i-1)
    if must is None:
        print("K:"+str(K)+", i:"+str(i))
    left_ball = N-K-i+1
    if left_ball < 0:
        print(0)
        continue
    can = combination(left_ball+i, i)
    print((must*can)%mod)
import numpy as np
import math
N = int(input())
H = [int(x) for x in input().split()]

cost = np.full(N, math.inf)
cost[0] = int(0)
cost[1] = abs(H[0]-H[1])
for i in range(2, N):
    cost[i] = min(abs(H[i]-H[i-1]) + cost[i-1], abs(H[i]-H[i-2]) + cost[i-2])

print(int(cost[N-1]))
    

### FIXED CODE ###

import numpy as np
N = int(input())
H = [int(x) for x in input().split()]

cost = np.full(N, float('inf'))
cost[0] = int(0)
cost[1] = abs(H[0]-H[1])
for i in range(2, N):
    cost[i] = min(abs(H[i]-H[i-1]) + cost[i-1], abs(H[i]-H[i-2]) + cost[i-2])

print(int(cost[N-1]))
isstr=input()
n,m = [int(i) for i in isstr.split(' ')]
gate=[0]*m
for i in range(m):
    a,b=[int(i) for i in input().split(' ')]
    gate[i]=set([j for j in range(a,b+1)])
result=reduce(lambda x,y:x&y, gate)
count=0
for re in result:
  if re <=n:
    count+=1
print(count)
  	

### FIXED CODE ###

isstr=input()
n,m = [int(i) for i in isstr.split(' ')]
l=[0]*m
r=[0]*m
for i in range(m):
    l[i],r[i]=[int(i) for i in input().split(' ')]
result=min(r)-max(l)+1
result=result if result>0 else 0
print(result)
n = int(input())
p = list(map(int, input().split()))

j = p[0]
count = 0
for i in range(n):
    if p[i] <= j:
        count += 1
        j = p[i]
print(count)

### FIXED CODE ###

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

result = "Yes" if n == m else "No"
print(result)
N,K = map(int, input().split())
A = list(map(int,input().split()))
MAX = 10**5+1
nxt = [-1 for i in range(MAX)]

last_index = [-1 for i in range(MAX)]
next_index = [-1 for i in range(MAX)]
first_index = [-1 for i in range(MAX)]
for i in range(N):
	a = A[i]
	last = last_index[a]
	if last >= 0:
		next_index[last] = i
	else:
		first_index[a] = i
	last_index[a] = i

start_stat = 0
while True:
	current = first_index[start_stat] + 1
	while current < N and next_index[current] != -1:
		current = next_index[current] + 1
	if current >= N:
		nxt[start_stat] = 0
		break
	else:
		stat = A[current]
		nxt[start_stat] = A[current]
		if nxt[A[current]] == -1:
			start_stat = A[current]
			continue
		else:
			break

order = [0]
in_order = [False for i in range(MAX)]
in_order[0] = True
last_stat = nxt[0]
while not in_order[last_stat]:
	order.append(last_stat)
	in_order[last_stat] = True
	last_stat = nxt[last_stat]
a,b = 0,len(order)
for x in order:
	if x == last_stat:
		break
	else:
		a += 1
		b -= 1
stat_index = K if K < a else (K-a) % b
init_status = order[stat_index]
before_stat = order[(stat_index - 1) % len(order)]
current = first_index[before_stat] + 1
if init_status == 0:
	print("")
	exit()
ans = []
while current < N:
	if next_index[current] != -1:
		current = next_index[current] + 1
	else:
		ans.append(A[current])
		current += 1
print( " ".join(list(map(str, ans))))


### FIXED CODE ###

N,K = map(int, input().split())
A = list(map(int,input().split()))
MAX = 2 * 10**5+1
nxt = [-1 for i in range(MAX)]

last_index = [-1 for i in range(MAX)]
next_index = [-1 for i in range(MAX)]
first_index = [-1 for i in range(MAX)]
for i in range(N):
	a = A[i]
	last = last_index[a]
	if last >= 0:
		next_index[last] = i
	else:
		first_index[a] = i
	last_index[a] = i

start_stat = 0
while True:
	current = first_index[start_stat] + 1
	while current < N and next_index[current] != -1:
		current = next_index[current] + 1
	if current >= N:
		nxt[start_stat] = 0
		break
	else:
		stat = A[current]
		nxt[start_stat] = A[current]
		if nxt[A[current]] == -1:
			start_stat = A[current]
			continue
		else:
			break

order = [0]
in_order = [False for i in range(MAX)]
in_order[0] = True
last_stat = nxt[0]
while not in_order[last_stat]:
	order.append(last_stat)
	in_order[last_stat] = True
	last_stat = nxt[last_stat]
a,b = 0,len(order)
for x in order:
	if x == last_stat:
		break
	else:
		a += 1
		b -= 1
stat_index = K if K < a else (K-a) % b
init_status = order[stat_index]
before_stat = order[(stat_index - 1) % len(order)]
current = first_index[before_stat] + 1
if init_status == 0:
	print("")
	exit()
ans = []
while current < N:
	if next_index[current] != -1:
		current = next_index[current] + 1
	else:
		ans.append(A[current])
		current += 1
print( " ".join(list(map(str, ans))))
n = int(input())
a = list(map(int,input()))
s = a[0]
ans = 0
for i in range(1,n):
  ans += max(0,a[i]-s)
  s = max(s,a[i])
print(ans)

### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
s = a[0]
ans = 0
for i in range(1,n):
  ans += max(0,s-a[i])
  s = max(s,a[i])
print(ans)
k=input()

li=input()

li.sort()
sum=0
for k in range(len(li)):
  
  if k%2==0:
   
    sum=sum+li[k]
 
print(sum)


### FIXED CODE ###

k = int(input())
li= list(map(int, input().split()))
li.sort()
sum=0
for k in range(len(li)):
  
  if k%2==0:
   
    sum=sum+li[k]
 
print(sum)
a, b = map(int,  for in input().split())
if a > b:
	print(“a > b”)
elif a < b:
	print(“a < b”)
else:
	print(“a == b”)



### FIXED CODE ###

a,b = map(int, input().split())
if a > b:
 print("a > b")
elif a < b:
 print("a < b")
else:
 print("a == b")
import math
x, y = map(int, input().split())
if math.gcd(x, y) == x:
	print(-1)
else:
	print(x)

### FIXED CODE ###

x, y = map(int, input().split())
if x % y == 0:
    print(-1)
else:
    print(x)
N,K = map(int, input().split())
print(min(N % K, K - N % K))

### FIXED CODE ###

N, K = map(int, input().split())
print(min(N % K, K - N % K))
def solve():

    D = int(input())

    if D == 25:
        print(`Christmas`)
    else if D == 24:
        print(`Christmas Eve`)
    else if D == 23:
        print(`Christmas Eve Eve`)
    else if D == 22:
        print(`Christmas Eve Eve Eve`)


if __name__ == "__main__":
    solve()


### FIXED CODE ###


def solve():

    D = int(input())

    if D == 25:
        print("Christmas")
    elif D == 24:
        print("Christmas Eve")
    elif D == 23:
        print("Christmas Eve Eve")
    elif D == 22:
        print("Christmas Eve Eve Eve")


if __name__ == "__main__":
    solve()
S=str(input())
if len(S)==2:
    print(S)
else:
    print(S.reverse())

### FIXED CODE ###


S=str(input())
if len(S)==2:
    print(S)
else:
    print(S[::-1])
s = input()
t = input()
s = s[::-1]
t = t[::-1]
for i in range(len(s)):
  for j in range(len(t)):
    if s[i+j] != t[j] and s[i+j] != '?':
      break
  else:
    break
s = s[:i] + t + s[i+len(t):]
s = s.replace('?','a')
s = s[::-1]
print(s)

### FIXED CODE ###

s = input()
t = input()
s = s[::-1]
t = t[::-1]
for i in range(len(s)-len(t)+1):
  for j in range(len(t)):
    if s[i+j] != t[j] and s[i+j] != '?':
      break
  else:
    break
else:
  print('UNRESTORABLE')
  exit(0)
s = s[:i] + t + s[i+len(t):]
s = s.replace('?','a')
s = s[::-1]
print(s)
import operator
for e in iter(input,'0'):
    target = [[*map(int,input().split())]for _ in[0]*int(e)]
    bx, by = min(target)
    target = {(x - bx, y - by) for x, y in target}
    max_tx = max(map(operator.itemgetter(0), target))
    b = {tuple(map(int,input().split()))for _ in[0]*int(input())}
    max_sx = max(map(operator.itemgetter(0), b))
    lim_x = max_sx - max_tx
    for x,y in b:
        if x > lim_x:continue
        for u,v in target:
            if (x + tx, y + ty) not in b:break
        else:
            print(x - bx, y - by)
            break


### FIXED CODE ###

for e in iter(input,'0'):
 a=[[*map(int,input().split())]for _ in[0]*int(e)]
 s,t=min(a)
 b={tuple(map(int,input().split()))for _ in[0]*int(input())}
 m=max(b)[0]-max(a)[0]+s
 for x,y in b:
  if x<=m:
   for u,v in a:
    if(x+u-s,y+v-t)not in b:break
   else:print(x-s,y-t);break
_ = input()
l = list(map(int,input().split()))
l.sort()
l.reverse()
print(sum(l[::2]-sum(l[1::2])))

### FIXED CODE ###

_ = input()
l = list(map(int,input().split()))
l.sort()
l.reverse()
print(sum(l[::2])-sum(l[1::2]))
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil,sqrt
from operator import itemgetter
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
def printns(x): print('\n'.join(x))
def printni(x): print('\n'.join(list(map(str,x))))
inf = 10**17
mod = 10**9 + 7
#s=input().rstrip()

n,K=MI()
ls=sorted(LI(),reverse=True)
ans=0
for i in range(k):
    ans+=ls[i]
print(ans)

### FIXED CODE ###

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil,sqrt
from operator import itemgetter
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
def printns(x): print('\n'.join(x))
def printni(x): print('\n'.join(list(map(str,x))))
inf = 10**17
mod = 10**9 + 7
#s=input().rstrip()

n,k=MI()
ls=sorted(LI(),reverse=True)
ans=0
for i in range(k):
    ans+=ls[i]
print(ans)
n,d = map(int,input().split())
obj = [list(map(int,input().split())) for _ in range(n)]
ans = 0
for i in range(n):
    for j in range(n):
        if i == j:
            pass
        else:
            dis = 0
            for k in range(d):
                dis += (obj[i][k] - obj[j][k])**2
            dis = dis ** 0.5
            if dis == dis // 1:
                ans += 1

print(ans//2

### FIXED CODE ###

n,d = map(int,input().split())
obj = [list(map(int,input().split())) for _ in range(n)]
ans = 0
for i in range(n):
    for j in range(n):
        if i == j:
            pass
        else:
            dis = 0
            for k in range(d):
                dis += (obj[i][k] - obj[j][k])**2
            dis = dis ** 0.5
            if dis == dis // 1:
                ans += 1

print(ans//2)
a=int(input())
b=int(input())

list=[1, 2, 3]

list.pop(a)
list.pop(b)

print(list[0])

### FIXED CODE ###

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

list=[1, 2, 3]

list.remove(a)
list.remove(b)

print(list[0])
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():
    s = s_input()
    k = i_input()
    if k == 1:
        print(s[0])
    else:
        for i in range(k-1):
            if s[i] != "1":
                print(s[i+1])
                exit()
        print(s[-1])


if __name__=="__main__":
    main()


### FIXED CODE ###

from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,datetime
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inpl(): return list(map(int, input().split()))
def inpl_s(): return list(input().split())

S = input()
K = int(input())

for i in range(K):
	if S[i] == '1':
		continue
	else:
		print(S[i])
		sys.exit()

print(S[K-1])
N = int(input())
ans = 1
for i in range(1, N+1):
  (ans *= i) %= 1000000007
print(ans)

### FIXED CODE ###

N = int(input())
ans = 1
for i in range(1, N+1):
  ans *= i
  ans %= 1000000007
print(ans)
import sys,heapq
sys.setrecursionlimit(10030)
from collections import deque,defaultdict
printn = lambda x: sys.stdout.write(x)
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
DBG = True  and False
MOD = 10**9 + 7
def ddprint(x):
  if DBG:
    print(x)

def f(s,r):
    sz = len(s)
    n = int(s[0])
    if sz==1:
        sum = 0
        for i in range(n+1):
          if (r-i)%d == 0:
            sum += 1
        return sum
    sum = f(s[1:], (r-n)%d)
    for i in range(n):
        ddprint("sum {} sz {} r {} i {} d {} dp {}".format(sum, sz, r, i, d, dp[sz-1][(r-i)%d]))
        sum = (sum + dp[sz-1][(r-i)%d]) % MOD
    ddprint("f s={} r={} rtns {}".format(s,r,sum))
    return sum

k = input()
d = inn()
e = len(k)
ddprint("k {} d {} e {}".format(k,d,e))
dp = [ [0 for i in range(d)] for j in range(e) ]
for i in range(10):
    dp[1][i%d] += 1
ddprint(dp[1])
for i in range(2,e):
  for j in range(d):
    for m in range(10):
        dp[i][j] += dp[i-1][(j-m)%d]
  ddprint(dp[i])
print(f(k,0)-1)


### FIXED CODE ###

import sys
sys.setrecursionlimit(10070)
printn = lambda x: sys.stdout.write(x)
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
DBG = True  and False
MOD = 10**9 + 7

def f(s,r):
    sz = len(s)
    n = int(s[0])
    if sz==1:
        sum = 0
        for i in range(n+1):
          if (r-i)%d == 0:
            sum += 1
        return sum
    sum = f(s[1:], (r-n)%d)
    for i in range(n):
        sum += dp[sz-1][(r-i)%d]
        if sum >= MOD:
            sum -= MOD
    return sum

k = input()
d = inn()
e = len(k)
dp = [ [0 for i in range(d)] for j in range(max(2,e)) ]
for i in range(10):
    dp[1][i%d] += 1
for i in range(2,e):
  for j in range(d):
    for m in range(10):
        dp[i][j] += dp[i-1][(j-m)%d]
        if dp[i][j] >= MOD:
            dp[i][j] -= MOD
print((f(k,0)-1)%MOD)
import numpy as np
H, W = map(int,input().split())
S = []
for h in range(H):
   S.append(input())
def calc(LR,RL,H,W,S):
   for h in range(H):
       for w in range(W):
           if S[h][w]==".":
               LR[h+1][w+1] = LR[h+1][w] + 1
           else:
               LR[h+1][w+1] = 0
           if S[h][W-w-1]==".":
               RL[h+1][W-w] = RL[h+1][W-w+1] + 1
           else:
               RL[h+1][W-w] = 0
   return LR, RL
LR = np.zeros((H+2,W+2)).astype(np.int)
RL = np.zeros((H+2,W+2)).astype(np.int)
UD = np.zeros((H+2,W+2)).astype(np.int)
DU = np.zeros((H+2,W+2)).astype(np.int)
LR, RL = calc(LR,RL,H,W,S)
S2 = ["" for i in range(len(S[0]))]
for i in range(len(S[0])):
   for j in range(len(S)):
       S2[i]+=(S[j][i])

UD, DU = calc(UD.T,DU.T,W,H,S2)
mx = 0
for h in range(H):
   for w in range(W):
       p = 0
       if (S[h][w]=="."):
           p = LR[h+1][w]+RL[h+1][w+2] + UD.T[h][w+1]+DU.T[h+2][w+1] + 1
           mx = max(mx,p)
print (mx)

### FIXED CODE ###

import numpy as np
H , W = list(map(int, input().split()))
S = np.array([list(input().rstrip()) for _ in range(H)]) == '.'
U = np.zeros((H, W), dtype=int)
D = np.zeros((H, W), dtype=int)
R = np.zeros((H, W), dtype=int)
L = np.zeros((H, W), dtype=int)
for h in range(1, H):
    U[h] = (U[h - 1] + 1) * S[h - 1]
for h in reversed(range(H - 1)):
    D[h] = (D[h + 1] + 1) * S[h + 1]
for w in range(1, W):
    L[:, w] = (L[:, w - 1] + 1) * S[:, w - 1]
for w in reversed(range(W - 1)):
    R[:, w] = (R[:, w + 1] + 1) * S[:, w + 1]
print(np.max((U+D+L+R) * S) + 1)
class edge():
    def __init__(self,_to,_cost):
        self.to = _to;
        self.cost = _cost;

N = int(input())
tree = [[] for i in range(N)]

for i in range(N-1):
    a,b,c = list(map(int,input().split()))
    a = a - 1
    b = b - 1
    tree[a].append(edge(b,c))
    tree[b].append(edge(a,c))
Q,K = list(map(int,input().split()))
K = K - 1

depth = [-1] * N

def DFS(v,p,d):
    depth[v] = d
    for e in tree[v]:
        if e.to == p:
            continue
        DFS(e.to, v, d + e.cost)
DFS(K,-1,0)

for _ in range(Q):
    x,y = list(map(int, input().split()))
    x = x - 1
    y = y - 1
    print(depth[x] + depth[y])


### FIXED CODE ###

n = input()
s = []
for i in range(len(n)):
    s.append(n[len(n)-1-i])
if(n=="".join(s)):
    print("Yes")
else:
    print("No")
import sys
sys.setrecursionlimit(10000)
A=list(input())
B=list(input())
C=list(input())
t='a'
d=1
while d==1:
    if t=='a':
        t=A.pop(0)
    if t=='b':
        t=B.pop(0)
    if t=='c':
        t=C.pop(0)
    if t=='a' and A==[]:
        print('A')
        break
    if t=='b' and B==[]:
        print('B')
        break
    if t=='c' and C==[]:
        print('C')
        break

### FIXED CODE ###

A=list(input())
B=list(input())
C=list(input())
t='a'
d=1#ずっとまわすつもり。
while d==1:
    if t=='a':
        t=A.pop(0)
    elif t=='b':
        t=B.pop(0)
    elif t=='c':
        t=C.pop(0)
    if t=='a' and A==[]:
        print('A')
        break
    elif t=='b' and B==[]:
        print('B')
        break
    elif t=='c' and C==[]:
        print('C')
        break
for n in range(input()):
  a,b,c=sorted(map(int,raw_input().split()))
  print ["YES","NO"][c*c-a*a-b*b] 

### FIXED CODE ###

m=["NO","YES"]
for n in range(input()):
  a,b,c=sorted(map(int,raw_input().split()))
  print m[c*c==a*a+b*b]
a = int(input())

b = list(map(int,input().split()))

b.sorted()

su = 0

for i in range(a-1):
  su += b[2*i]

### FIXED CODE ###

a = int(input())

b = list(map(int,input().split()))

b.sort()

su = 0

for i in range(a):
  su += b[2*i]
print(su)
a,b,x=map(int,input().split())
import math
if x<=a*a*b/2:
  print(90-math.degrees(math.asin(2*x/a/b/((2*x/a/b)*2+b**2)**0.5)))
else:
  print(90-math.degrees(math.atan(a*a/2/(-x/a+a*b))))

### FIXED CODE ###

a,b,x=map(float,input().split())
import math
if x<=a*a*b/2:
  print(math.degrees(math.atan(a*b*b/2/x)))
elif (-x/a+a*b)==0:
  print(0)
else:
  print(math.degrees(math.atan(2/a/a*(a*b-x/a))))
s = int(intpu())
if s[-1] == 3:
  print('bon')
elif s[-1] == 0 or s[-1] == 1 or s[-1] == 6 or s[-1] == 8:
  print('pon')
else:
  print('hon')

### FIXED CODE ###

s = int(input())
ichi = s%10
if ichi == 3:
    print('bon')
elif ichi == 0 or ichi==1 or ichi== 6 or ichi ==8:
    print('pon')
else :
    print('hon')
a,b,c,d = map(int,input().split())
while a <= 0 or c <= 0:
    c =c - b
    a =a - d
if c <= 0:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

S,W =map(int,input().split())
if S <= W:
    print('unsafe')
else:
    print('safe')
l,n=map(int,input().split())
list=[]
for _ in range(n):
    list.append(input())

list.sort()
ans=""
for i in list:
    ans+=i
print(ans)

### FIXED CODE ###

n,l=map(int,input().split())
list=[]
for _ in range(n):
    list.append(input())
 
list.sort()
ans=""
for i in list:
    ans+=i
print(ans)
#! coding: UTF-8
N,A,B = list(map(int,input().split(" ")))
V = list(map(int,input().split(" ")))
V.sort(reverse=True)
max_avr = sum(V[:A]) / A
a_num = V.count(V[A-1])
a_pos = V[:A].count(V[A-1])

#確率統計nCr
import math
def nCr(n,r):
    f = math.factorial
    return f(n) // f(r) // f(n-r)

if V[0] == V[A-1]:
    cnt = sum(nCr(a_num,i) for i in range(A,min(B,a_num))) 
else:
    cnt = nCr(a_num,a_pos)
print("{0:.10f}".format(max_avr))
print(int(cnt))


### FIXED CODE ###

data = list(map(int,input().split(" ")))
x = sum(data)
if x >= 24:
	print(x%24)
else:
    print(x)
# coding=utf-8
import math.sqrt
x1, y1, x2, y2 = map(int, raw_input().split())
print math.sqrt((x1 - x2) ** 2 + (y1 - y2) ** 2)

### FIXED CODE ###

# coding=utf-8
from math import sqrt
x1, y1, x2, y2 = map(float, raw_input().split())
print sqrt((x1 - x2) ** 2 + (y1 - y2) ** 2)
k = int(input())
a,b = map(int, input().split))

aa = a % k
bb = b % k

if(b - a > k):
    print('OK')
if(aa > bb):
    print('OK')
if(aa == 0):
    print('OK')
else:
    print('NG')


### FIXED CODE ###

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

aa = a % k
bb = b % k

if(b - a >= k):
    print('OK')
elif(aa > bb):
    print('OK')
elif(aa == 0):
    print('OK')
else:
    print('NG')
ans_lis = [0 for _ in range(n)]
n = int(input())
for x in range(1,101):
    for y in range(1, 101):
        for z in range(1, 101):
            f = x**2+y**2+z**2+x*y+y*z+z*x
            if f<=n:
#                 print(f)
                ans_lis[f-1]+=1
for ans in ans_lis:
    print(ans)

### FIXED CODE ###


n = int(input())
ans_lis = [0 for _ in range(n)]
for x in range(1,101):
    for y in range(1, 101):
        for z in range(1, 101):
            f = x**2+y**2+z**2+x*y+y*z+z*x
            if f<=n:
                ans_lis[f-1]+=1
for ans in ans_lis:
    print(ans)