CodeEff/ECCO huggingface dataset:
# Original solution
from math import sqrt
def circle_center(x1, y1, x2, y2):
    xd = x2 - x1; yd = y2 - y1
    d = xd**2 + yd**2
    k = sqrt((4.0 - d) / d) / 2.0
    xc = (x1 + x2) / 2.0; yc = (y1 + y2) / 2.0
    xd *= k; yd *= k
    return [[xc - yd, yc + xd], [xc + yd, yc - xd]]
while 1:
    n = int(input())
    if n==0: break
    p = sorted(list(map(float, input().split())) for i in range(n))
    prev = 0
    ans = 1
    for i in range(n):
        bx, by = p[i]
        while bx - p[prev][0] >= 2.0: prev += 1
        for j in range(i+1, n):
            cx, cy = p[j]
            if cx - bx >= 2.0: break
            if abs(by - cy) <= 2.0 and (bx - cx)**2 + (by - cy)**2 <= 4.0:
                for ex, ey in circle_center(bx, by, cx, cy):
                    count = 2
                    for k in range(prev, n):
                        if k==i or k==j: continue
                        dx, dy = p[k]
                        if ex - dx >= 1.0: continue
                        if dx - ex >= 1.0: break
                        if abs(ey - dy) <= 1.0 and (ex - dx)**2 + (ey - dy)**2 <= 1.0:
                            count += 1
                    ans = max(ans, count)
    print(ans)

# Optimized solution
from math import sqrt
def circle_center(x1, y1, x2, y2):
    xd = x2 - x1; yd = y2 - y1
    k = sqrt(1.0/(xd**2 + yd**2) - 0.25)
    xc = (x1 + x2) / 2.0; yc = (y1 + y2) / 2.0
    xd *= k; yd *= k
    return [[xc - yd, yc + xd], [xc + yd, yc - xd]]
while 1:
    n = int(input())
    if n==0: break
    p = sorted(list(map(float, input().split())) for i in range(n))
    prev = 0; pvx = p[0][0]
    ans = 1
    for i in range(n):
        bx, by = p[i]
        bxm2 = bx - 2.0; bxp2 = bx + 2.0
        bym2 = by - 2.0; byp2 = by + 2.0
        while bxm2 >= pvx:
            prev += 1; pvx = p[prev][0]
        for j in range(i+1, n):
            cx, cy = p[j]
            if cx >= bxp2: break
            if bym2 <= cy <= byp2 and (bx - cx)**2 + (by - cy)**2 <= 4.0:
                for ex, ey in circle_center(bx, by, cx, cy):
                    count = 2
                    exm1 = ex - 1.0; exp1 = ex + 1.0
                    eym1 = ey - 1.0; eyp1 = ey + 1.0
                    q = prev
                    while exm1 >= p[q][0]: q += 1
                    for k in range(q, n):
                        if k==i or k==j: continue
                        dx, dy = p[k]
                        if dx >= exp1: break
                        if eym1 <= dy <= eyp1 and (ex - dx)**2 + (ey - dy)**2 <= 1.0:
                            count += 1
                    ans = max(ans, count)
    print(ans)
# Original solution
# coding: utf-8

from itertools import accumulate as accum
import sys
input = sys.stdin.readline

def f(N, s):
    MOD = int(1e9 + 7)
    dp = [[0] * N for _ in range(N)]
    for j in range(N):
        dp[0][j] = 1
    for i in range(1, N):
        csum = list(accum(dp[i - 1], lambda x, y: (x + y) % MOD))
        dpi = dp[i]
        csum_ = csum[N - i]
        i_ = i - 1
        for j in range(N - i):  # N-(i+1)+1 = N-i
            dpi[j] = csum[j] if s[i_] == ">" else (csum_ - csum[j] + MOD) % MOD
    return(dp[-1][0])

N = int(eval(input())) # 2 <= N <= 30000
s = input().rstrip() # len(s) = N - 1
print((f(N, s)))


# Optimized solution
# coding: utf-8

import sys
input = sys.stdin.readline

def f2(N, s):
    MOD = int(1e9 + 7)
    dp = [1] * N
    for i in range(1, N):
        csum = list(dp)
        for j in range(1, N - i + 1):
            csum[j] += csum[j - 1]
        csum_ = csum[N - i]
        i_ = i - 1
        for j in range(N - i):  # N-(i+1)+1 = N-i
            dp[j] = csum[j] if s[i_] == ">" else (csum_ - csum[j] + MOD) % MOD
    return(dp[0])

N = int(eval(input())) # 2 <= N <= 30000
s = input().rstrip() # len(s) = N - 1
print((f2(N, s)))
# Original solution
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]

n = int(input())
s = input()

def main():
    md=10**9+7
    dp=[[0]*(n+1) for _ in range(n+1)]
    dp[1][0]=1
    dpx=dp[1]
    for x in range(2,n+1):
        dpx1=dpx
        dpx=dp[x]
        for i in range(x):
            if s[n-x]=="<":
                dpx[i]=sum(dpx1[i:x-1])%md
            else:
                dpx[i]=sum(dpx1[:i])%md
    #p2D(dp)
    print(sum(dp[n])%md)

main()


# Optimized solution
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]

n = int(input())
s = input()

def main():
    md=10**9+7
    dp=[[0]*(n+1) for _ in range(n+1)]
    dp[1][0]=1
    dpx=dp[1]
    for x in range(2,n+1):
        dpx1=dpx
        dpx=dp[x]
        if s[n - x] == "<":
            for i in range(x-2,-1,-1):
                dpx[i]=(dpx[i+1]+dpx1[i])%md
        else:
            for i in range(1,x):
                dpx[i]=(dpx[i-1]+dpx1[i-1])%md
    #p2D(dp)
    print(sum(dp[n])%md)

main()
# Original solution
import math
b=list(map(int,input().split(" ")))
c=2*b[0]/b[1]
t=0
for i in range(1,int(c)+1):
    for j in range(1,int(c)+1):
        for k in range(1,int(c)+1):
            if (i+j-k)/2*b[1]>=1 and (i+j-k)/2*b[1]<=b[0] and math.modf((i+j-k)/2*b[1])[0]==0:
                if (k+j-i)/2*b[1]>=1 and (k+j-i)/2*b[1]<=b[0] and math.modf((k+j-i)/2*b[1])[0]==0:
                    if (i+k-j)/2*b[1]>=1 and (i+k-j)/2*b[1]<=b[0] and math.modf((i+k-j)/2*b[1])[0]==0:
                        t+=1
                        
print (t)

# Optimized solution
n,k=list(map(int,input().split()))
c=int(n/k)
if(k%2==1):
    print((c*c*c))
else:
    ans=c*c*c
    c=int((n+k/2)/int(k))
    print((c*c*c+ans))
# Original solution
n,k=list(map(int,input().split()))
l=[i for i in range(1,n+1) if (2*i)%k==0]
cnt=0
for x in range(len(l)):
    for y in range(len(l)):
        for z in range(len(l)):
            if (l[x]+l[y])%k==0 and (l[y]+l[z])%k==0 and (l[z]+l[x])%k==0:
                cnt+=1
print(cnt)

# Optimized solution
n,k=list(map(int,input().split()))
if k%2==1:
    print(((n//k)**3))
else:
    kk=k//2
    print(((n//k)**3+((n+kk)//k)**3))
# Original solution
N, K = list(map(int, input().split()))
k = 2*N // K
ans = 0
for a in range(1, N+1):
    b = 0
    if 2*a %K != 0:
        continue
    kmin = a//K +1
    for i in range(kmin, k+1):
        if i*K - a > N:
            break
        b += 1
    ans += b*b
print(ans)
        
    

# Optimized solution
N, K = list(map(int, input().split()))
if K % 2 == 1:
    a = N // K
    print((a**3))
else:
    a = N//K
    a2 = N//(K//2) -a
    print((a**3 +a2**3))
# Original solution
n,k=list(map(int,input().split()))
c=0
s = k if k%2==1 else k//2
for i in range(s,n+1,s):
    for j in range(s,n+1,s):
        for l in range(s,n+1,s):
            if (i+j)%k==0 and (i+l)%k==0 and (j+l)%k==0:
                c+=1
print(c)


# Optimized solution
n,k=list(map(int,input().split()))
c=0
s = k if k%2==1 else k//2
for i in range(s,n+1,s):
    s2 = k if i%k==0 else s
    n2 = (n-s2)//k+1
    c+=n2**2
print(c)
# Original solution
n, k = list(map(int, input().split()))
d = {}
q, r = divmod(n, k)
if r == 0:
    for i in range(k):
        d[i] = q
else:
    for i in range(k):
        if i == 0:
            d[i] = q
        elif 1 <= i <= r:
            d[i] = q+1
        else:
            d[i] = q
#print(d)
ans = 0
if k%2 != 0:
    ans = d[0]**3
else:
    ans = d[0]**3+d[k//2]**3
print(ans)


# Optimized solution
n, k = list(map(int, input().split()))

if k%2 == 0:
    q1, r1 = divmod(n, k)
    if r1 < k//2:
        q2 = q1
    else:
        q2 = q1+1
    ans = q2**3 + q1**3
else:
    q1, r1 = divmod(n, k)
    ans = q1**3
#print(q1, q2)
print(ans)
# Original solution
n,k=list(map(int,input().split()))
ans=0
for a in range(1,n+1):
  aa=a%k
  b=c=(2*k-a-1)%k+1
  if (b+c)%k:continue
  ans+=((n-b)//k+1)**2
print(ans)

# Optimized solution
n,k=list(map(int,input().split()))
ans=0
for a in range(1,n+1):
  b=c=(k-a-1)%k+1
  if (b+c)%k:continue
  ans+=((n-b)//k+1)**2
print(ans)
# Original solution
n,k=list(map(int,input().split()))
ans=0
for a in range(1,n+1):
  b=c=(k-a-1)%k+1
  if (b+c)%k:continue
  ans+=((n-b)//k+1)**2
print(ans)

# Optimized solution
n,k=list(map(int,input().split()))
ans=0
for a in range(1,n+1):
  m=(k-a-1)%k+1
  if (m+m)%k!=0:continue
  ans+=((n-m+k)//k)*((n-m+k)//k)
print(ans)
# Original solution
def main():
    N, K = (int(i) for i in input().split())
    c0 = 0
    c1 = 0
    for num in range(1, N+1):
        if num % K == 0:
            c0 += 1
        elif K % 2 == 0 and num % K == K//2:
            c1 += 1
    print((pow(c0, 3) + pow(c1, 3)))


if __name__ == '__main__':
    main()


# Optimized solution
def main():
    N, K = (int(i) for i in input().split())
    c0 = 0
    c1 = 0
    for num in range(1, N+1):
        if num % K == 0:
            c0 += 1
        elif K % 2 == 0 and num % K == K//2:
            c1 += 1
    print((c0*c0*c0 + c1*c1*c1))


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

if K == 1:
    print((N**3))
    exit()

ans = 0
for k in range(K):
    if (k * 2) % K != 0:
        continue
    M = (N // K) - (1 if k == 0 else 0)
    if N % K >= k:
        M += 1
    ans += M**3
print(ans)


# Optimized solution
N, K = list(map(int, input().split()))

M = N // K
ans = M * (M - 1) * (M - 2) + M * (M - 1) * 3 + M

if K % 2 == 0:
    if N % K >= K // 2:
        M += 1
    ans += M * (M - 1) * (M - 2) + M * (M - 1) * 3 + M

print(ans)
# Original solution
n,k=list(map(int,input().split()))
ans=0
for i in range(1,n+1):
    c=0
    if 2*i%k==0:
        c+=1+(n+i)//k+(-1-i)//k
    #python3 a.pyprint(c)
    ans+=c**2
print(ans)

# Optimized solution
n,k=list(map(int,input().split()))
ans=0
for i in range(1,n+1):
    if 2*i%k==0:
        ans+=(1+(n+i)//k+(-1-i)//k)**2
print(ans)
# Original solution
N, K = list(map(int,input().split()))

ans = 0
for i in range(K, N+1, K):
    for j in range(K, N+1, K):
        for k in range(K, N+1, K):
            ans += 1
if K % 2 == 0:
    for i in range(K//2, N+1, K):
        for j in range(K//2, N+1, K):
            for k in range(K//2, N+1, K):
                ans += 1
print(ans)

# Optimized solution
N, K = list(map(int,input().split()))

ans = 0
cnt = 0
for i in range(K, N+1, K):
    cnt += 1
ans += pow(cnt, 3)

if K % 2 == 0:
    cnt = 0
    for i in range(K//2, N+1, K):
        cnt += 1
    ans += pow(cnt, 3)
print(ans)
# Original solution
n, k = [int(i) for i in input().split()]
cnt = 0
for i in range(1,2*n//k+1):
    if i*k%2 ==1 and k%2 == 1:
        for j in range((i-1)//2):
            a = i*k//2 - (k+2*k*j-1)//2
            if i * k - a <= n:
                cnt += ((a+n)//k - a//k)*2
    elif i*k%2 == 0:
        if k%2 == 0:
            for j in range(i-1):
                a = i * k // 2 - (k + k * j) // 2
                if i*k-a <= n:
                    cnt += ((a + n) // k - a // k) * 2
        else:
            for j in range(1,i // 2):
                a = i * k // 2 - k * j
                if i * k - a <= n:
                    cnt += ((a + n) // k - a // k) * 2
        cnt += ((i*k//2 + n) // k - (i*k//2) // k)
print(cnt)


# Optimized solution
N, K = [int(i) for i in input().split()]
cnt = 0
if K % 2 == 0:
    for i in range(1, 2*N//K+1):
        cnt += 1 + (2*N//K-i)//2 * 6 + (2*N//K-i)//2 * ((2*N//K-i)//2 - 1) * 3
else:
    for i in range(1, N//K+1):
        cnt += 1 + (N//K-i) * 6 + (N//K-i) * ((N//K-i) - 1) * 3

print(cnt)
# Original solution
N,K = list(map(int,input().split()))
if K%2==0:
    k = K//2
    o = (N+k)//K
    e = N//K
    ans = e**3+o**3
else:
    ans = (N//K)**3
print(ans)    

# Optimized solution
N,K = list(map(int,input().split()))
if K%2==1:
    n = N//K
    ans = n**3
else:
    n1 = N//K
    n2 = 1+(N-K//2)//K
    ans = n1**3+n2**3
print(ans)
# Original solution
N,K = list(map(int,input().split()))
if K%2==1:
    n = N//K
    ans = n**3
else:
    n1 = N//K
    n2 = 1+(N-K//2)//K
    ans = n1**3+n2**3
print(ans)

# Optimized solution
N,K = list(map(int,input().split()))
L = N//K
if K%2==1:
    print((L**3))
else:
    M = N//(K//2)
    M -= L
    print((L**3+M**3))
# Original solution
n, k = list(map(int, input().split()))
ans = 0
for a in range(1, n + 1):
    if (a % k == 0):
        ans += (n // k) ** 2
    else:
        q = a % k
        if (2 * q % k != 0):
            continue
        ans += ((n + q) // k) ** 2

print(ans)


# Optimized solution
n, k = list(map(int, input().split()))

ans = 0
for a in range(1, n + 1):
        q = a % k
        if (2 * q % k != 0):
            continue
        ans += ((n + q) // k) ** 2

print(ans)
# Original solution
N, K = list(map(int, input().split()))

ans = 0

num = [0] * (K+1)
for i in range(1, N+1):
    num[i % K] += 1

for a in range(K+1):
    b = (K-a) % K
    c = (K-a) % K
    if ((b+c) % K) == 0:
        ans += (num[a] * num[b] * num[c])

print(ans)


# Optimized solution
N, K = list(map(int, input().split()))

# Kが偶数の場合, 全てKの倍数または全てK//2に倍数の両方考える必要あり
num = [0]*(K+1)  # 1以上N以下の整数で余りが0~K-1の個数をカウントする
for i in range(1, N+1):
    num[i % K] += 1  # i % K の取りうる値は0~K-1

ans = 0
for a in range(K+1):  # aに関して全探索を行う
    b = (K-a) % K
    c = (K-a) % K
    if (b + c) % K == 0:
        ans += num[a] * num[b] * num[c]

print(ans)
# Original solution
import sys
def ii(): return int(sys.stdin.readline())
def mi(): return list(map(int, sys.stdin.readline().split()))
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]
def dp2(ini, i, j): return [[ini]*i for i2 in range(j)]
def dp3(ini, i, j, k): return [[[ini]*i for i2 in range(j)] for i3 in range(k)]
#import bisect #bisect.bisect_left(B, a)
#from collections import defaultdict #d = defaultdict(int) d[key] += value

N, K = mi()
    
cnt_n = 0
ini_n = K
while ini_n <= N:
    cnt_n += 1
    ini_n += K

ans = cnt_n ** 3

if K % 2 == 0:
    ini_k = K // 2
    cnt_k = 0
    while ini_k <= N:
        cnt_k += 1
        ini_k += K
    ans += cnt_k ** 3

print(ans)

# Optimized solution
import sys
def ii(): return int(sys.stdin.readline())
def mi(): return list(map(int, sys.stdin.readline().split()))
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]
def dp2(ini, i, j): return [[ini]*i for i2 in range(j)]
def dp3(ini, i, j, k): return [[[ini]*i for i2 in range(j)] for i3 in range(k)]
#import bisect #bisect.bisect_left(B, a)
#from collections import defaultdict #d = defaultdict(int) d[key] += value

N, K = mi()
    
cnt_n = 0
ini_n = K
#while ini_n <= N:
    #cnt_n += 1
    #ini_n += K
cnt_n = N // K

ans = cnt_n ** 3

if K % 2 == 0:
    ini_k = K // 2
    '''
    cnt_k = 0
    while ini_k <= N:
        cnt_k += 1
        ini_k += K
    ans += cnt_k ** 3
    '''
    if N >= ini_k:
        ans += ((N - ini_k) // K + 1)**3

print(ans)
# Original solution
n, k = list(map(int, input().split()))

s = []
for a in range(1, n + 1):
    if (2 * a) % k == 0:
        s.append(a)

count = 0
for a in s:
    for b in s:
        for c in s:
            if (a + b) % k == 0 and (b + c) % k == 0 and (c + a) % k == 0:
                count += 1

print(count)

# Optimized solution
n, k = list(map(int, input().split()))

s = []
for a in range(1, n + 1):
    if (2 * a) % k == 0:
        s.append(a)

t = []
for a in range(1, n + 1):
    if a % k == 0:
        t.append(a)

print(((len(s) - len(t)) ** 3 + len(t) ** 3))
# Original solution
def kumiawase(num):
    return num + 3*num*(num-1) + num*(num-1)*(num-2)

n, k = list(map(int, input().split()))
if k%2 == 1:
    ans = kumiawase(n//k)
else:
    m = k//2
    if m % k == 0:
        ans = kumiawase(n//m)
    else:
        ans = kumiawase(n//k) + kumiawase(n//m - n//k)
print(ans)

# Optimized solution
def kumiawase(num):
    return num + 3*num*(num-1) + num*(num-1)*(num-2)

n, k = list(map(int, input().split()))
if k%2 == 1:
    ans = kumiawase(n//k)
else:
    m = k//2
    ans = kumiawase(n//k) + kumiawase(n//m - n//k)
print(ans)
# Original solution
import math
from itertools import product
b=list(map(int,input().split(" ")))
c=2*b[0]/b[1]
a=[i for i in range(1,int(c)+1)]
a=list(product(a,repeat=3))
t=0
for i in a:
    if (i[0]+i[1]-i[2])*b[1]/2.0>=1 and (i[0]+i[1]-i[2])*b[1]/2.0<=b[0] and math.modf((i[0]+i[1]-i[2])*b[1]/2.0)[0]==0:
        if (i[0]+i[2]-i[1])*b[1]/2.0>=1 and (i[0]+i[2]-i[1])*b[1]/2.0<=b[0] and math.modf((i[0]+i[2]-i[1])*b[1]/2.0)[0]==0:
            if (i[2]+i[1]-i[0])*b[1]/2.0>=1 and (i[2]+i[1]-i[0])*b[1]/2.0<=b[0] and math.modf((i[2]+i[1]-i[0])*b[1]/2.0)[0]==0:
                t+=1
print (t)


# Optimized solution
N, K = list(map(int, input().split()))

ans = 0
for a in range(1, N+1):
    if(2 * a % K == 0):
        beg = K - a % K
        end = N
        cnt = (end - beg + K) // K
        ans += cnt * cnt

print(ans)
# Original solution
import itertools

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

cnt = 0

if k % 2 == 0:
  k_2 = k // 2
else:
  k_2 = k

for a in range(k_2, n+1, k_2):
  for b in itertools.product(list(range(k-(a%k), n+1, k)), repeat=2):
    cnt += len(b) // 2
        
print(cnt)


# Optimized solution
n, k = list(map(int, input().split()))

cnt = 0

if k % 2 == 0:
  k_2 = k // 2
else:
  k_2 = k

for a in range(k_2, n+1, k_2):
  cnt += len(list(range(k-(a%k), n+1, k))) ** 2
        
print(cnt)
# Original solution
N,K=list(map(int,input().split()))
c=0
if K%2==0:
    d=K//2
else:
    print(((N//K)**3))
    exit()

for i in range(d,N+1,d):
    for j in range(d,N+1,d):
        for k in range(d,N+1,d):
            if (i+j)%K==0 and (j+k)%K==0 and (k+i)%K==0:
                c+=1
print(c)

# Optimized solution
N,K=list(map(int,input().split()))

if K%2==0:
    print(((N//K)**3+((N//(K//2))-(N//K))**3))
else:
    print(((N//K)**3))
# Original solution
list = list()
for i in range(10):
	list.append(eval(input()))
list.sort()
list.reverse()
for i in range(3):
	print(list[i])

# Optimized solution
import sys

l = sorted([int(s) for s in sys.stdin], reverse=True)[:3]
print('\n'.join([str(s) for s in l]))
# Original solution
s = []
for i in range(10):
	s.append(int(input()))
s.sort()
s.reverse()
for i in range(3):
	print(s[i])

# Optimized solution
s = []

for i in range(10):
  s.append(int(input()))

s.sort()

for i in range(3):
  print(s[9-i])
# Original solution
hills = []
for i in range(10):
    hills.append(int(eval(input())))
hills.sort(reverse=True)
for i in range(3):
    print((hills[i]))

# Optimized solution
[print(y) for y in sorted([int(input()) for x in range(10)], reverse=True)[:3]]
# Original solution
heights = []
for i in range(10):
    heights.append(int(eval(input())))

for i in range(10):
    for j in range(i,10):
        if (heights[j] > heights[i]):
            w = heights[i]
            heights[i] = heights[j]
            heights[j] = w

for i in range(3):
    print((heights[i]))

# Optimized solution
heights = []
for i in range(10):
    heights.append(int(eval(input())))

for i in range(10):
    for j in range(i,10):
        if (heights[j] > heights[i]):
            w = heights[i]
            heights[i] = heights[j]
            heights[j] = w

print((heights[0]))
print((heights[1]))
print((heights[2]))
# Original solution
l = []

for i in range(10):
    l.append(int(eval(input())))

l.sort()

for i in range(3):
    print((l[-1 * (i+1)]))

# Optimized solution
mountains = []
for x in range(10):
    mountains.append(int(input()))
mountains.sort()
print((mountains[-1]))
print((mountains[-2]))
print((mountains[-3]))
# Original solution
ans=[]
for i in range (0,10):
    ans.append(int(eval(input())))
ans.sort(reverse=True)
for i in range (0,3):
    print((ans[i]))

# Optimized solution
mountain=[]
for s in range(0,10):
    mountain.append(int(eval(input())))
mountain.sort(reverse=True)
for s in range(0,3):
 print((mountain[s]))
# Original solution
hill = []
while True:
    try:
        hill.append(int(eval(input())))
    except:
        break
for i in range(1, len(hill)):
    key = hill[i]
    j = i-1
    while j >= 0 and hill[j] < key:
        hill[j+1] = hill[j]
        j -= 1
    hill[j+1] = key

for i in range(3):
    print((hill[i]))

# Optimized solution
print(*sorted([int(input()) for _ in [0]*10])[:6:-1], sep="\n")
# Original solution
# Python 3+
#-------------------------------------------------------------------------------
import sys

#ff = open("test.txt", "r")
ff = sys.stdin

arr = [ int(x) for x in ff.readlines() ]

arr.sort(reverse=True)

for x in arr[0:3] : print(x)

# Optimized solution

cnt = 10
top3 = [0,0,0]

for x in range(cnt):
    n = int( input() )

    if top3[2] > n: continue
    top3[2] = n

    if top3[1] > top3[2]: continue
    top3[1], top3[2] = top3[2], top3[1]

    if top3[0] > top3[1]: continue
    top3[0], top3[1] = top3[1], top3[0]

print(top3[0])
print(top3[1])
print(top3[2])
# Original solution
height_list = [int(eval(input())) for i in range(10)]
for i in range(1,4): print((sorted(height_list)[-i]))

# Optimized solution
import sys 
height_li = []
for i in range(10):
    height_li.append(int(eval(input())))
for i in range(3):
    print((sorted(height_li,reverse=True)[i]))
# Original solution
heights = sorted([int(eval(input())) for n in range(10)])
for idx in range(-1, -4, -1):
    print(heights[idx])

# Optimized solution
l = sorted([eval(input()) for x in range(10)], reverse=True)
for h in l[:3]:
    print(h)
# Original solution
a = []
for i in range(10):
  b = int(eval(input()))
  a.append(b)
a.sort()
print(a[9])
print(a[8])
print(a[7])

# Optimized solution
b=[]
for i in range(10):
 a=int(eval(input()))
 b.append(a)
b.sort()
for i in range(9,6,-1):
 print(b[i])
# Original solution
import sys
for i in sorted(map(int,sys.stdin))[:-4:-1]:print(i)

# Optimized solution
import sys
x=sorted(map(int,sys.stdin))[:-4:-1]
for i in x:print(i)
# Original solution
N = int(eval(input()))
A = list(map(int, input().split() ))

ans = []
for k in range(0,len(A)):
    ans.append(A.index(k+1))
    
ans = list([x+1 for x in ans])
ans = list(map(str, ans))
L = " ".join(ans)

print(L)

# Optimized solution
N = int(eval(input()))
A = list(map(int, input().split() ))

sort = [1]*N
for k in range(0,len(A)):
    sort[A[k]-1] = k + 1
    
sort = list(map(str, sort))
ans = " ".join(sort)

print(ans)
# Original solution
N = int(eval(input()))

A = list(map(int, input().split()))
Ad = {}
for i in range(N):
    Ad[i] = A[i]

def get_keys_from_value(d, val):
    return [k for k, v in list(d.items()) if v == val][0]

ans = ''
for j in range(len(Ad)):
    ans += ' ' + str(get_keys_from_value(Ad, j + 1) + 1)

print((ans.strip()))

# Optimized solution
N = int(eval(input()))
A = list(map(int, input().split()))

Ad = {}
for i in range(N):
    Ad[i] = A[i]

Ad_sorted = sorted(list(Ad.items()), key=lambda x:x[1])

ans = ''
for Adi in Ad_sorted:
    ans += ' ' + str(Adi[0] + 1)

print((ans.strip()))
# Original solution
n=int(eval(input()))
l=list(map(int,input().split()))
ans=[str(l.index(i)+1) for i in range(1,n+1)]
print((" ".join(ans)))

# Optimized solution
n=int(eval(input()))
l=list(map(int,input().split()))
ans=[None]*n
i=1
for index in l:
  ans[index-1]=str(i)
  i+=1
print((" ".join(ans)))
# Original solution
n = int(eval(input()))
a = list(map(int,input().split()))
ans = []
for i in range(n):
    ans.append(str(a.index(i + 1) + 1))
print((' '.join(ans)))

# Optimized solution
n = int(eval(input()))
a = list(map(int,input().split()))
ans = [i for i in range(n)]
a1 = sorted(a)
for i in range(n):
    num = a[i]
    ans[num - 1] = str(i + 1)
    
print((' '.join(ans)))
# Original solution
N=int(input())
L=list(map(int,input().split()))
for i in range(1,N+1):
  print(L.index(i)+1,end="")
  if i<N:
    print(" ",end="")
print()


# Optimized solution
N=int(eval(input()))
L=[0]*N
for x,i in enumerate(list(map(int,input().split()))):
  L[i-1]=str(x+1)
print((' '.join(L)))