Harryxun/stf_run huggingface dataset:
x, y = map(hex, input().split())

if x<y :
	print('<')
elif x>y :
	print('>')
else:
	print('=')



### FIXED CODE ###

from sys import stdin

x,y = stdin.readline().split( )

if x<y :
	print('<')
elif x>y :
	print('>')
else:
	print('=')
n=int(input())
dp=list(range(100000))
for i in range(n+1):
    pow6=1
    while pow6<=i:
        dp[i]=min(dp[i],dp[i-pow6]+1)
        pow6 *=6
    pow9=1
    while pow9<=i:
        dp[i]=min(dp[i],dp[i-pow9]+1)
        pow9 *=9    
print(dp[n])

### FIXED CODE ###

n=int(input())
dp=list(range(110000))
for i in range(n+1):
    pow6=1
    while pow6<=i:
        dp[i]=min(dp[i],dp[i-pow6]+1)
        pow6 *=6
    pow9=1
    while pow9<=i:
        dp[i]=min(dp[i],dp[i-pow9]+1)
        pow9 *=9    
print(dp[n])
N = int(input())
color = [-1] * N
G = [[] for _ in range(N)]
W = [[] for _ in range(N)]
for i in range(N-1):
  u, v, w = map(int, input().split())
  G[u-1].append(v-1)
  G[v-1].append(u-1)
  W[u-1].append(w)
  W[v-1].append(w)

def dfs(v, cur):
  color[v] = cur
  for next_v, w in zip(G[v], W[v]):
    if color[next_v] != -1:
      continue
    if w % 2 == 0:
      dfs(next_v, cur)
    else:
      dfs(next_v, 1 - cur)
      
for i in range(N):
  if color[i] != -1:
    continue
  dfs(i, 0)
for i in range(N):
  print(color[i])

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**7)

N = int(input())
color = [-1] * N
G = [[] for _ in range(N)]
W = [[] for _ in range(N)]
for i in range(N-1):
  u, v, w = map(int, input().split())
  G[u-1].append(v-1)
  G[v-1].append(u-1)
  W[u-1].append(w)
  W[v-1].append(w)

def dfs(v, cur):
  color[v] = cur
  for next_v, w in zip(G[v], W[v]):
    if color[next_v] != -1:
      continue
    if w % 2 == 0:
      dfs(next_v, cur)
    else:
      dfs(next_v, 1 - cur)
      
for i in range(N):
  if color[i] != -1:
    continue
  dfs(i, 0)
for i in range(N):
  print(color[i])
N,M=map(int,input().split())
if N%2==1:
  for i in range(M):
    print(i+1,N-i)
else:
  middle=((M+1)/2)
  for i in range(middle):
    print(i+1,N-i)
  for j in range(middle,M):
    print(j+2,N-j)

### FIXED CODE ###

N,M=map(int,input().split())
if N%2==1:
  for i in range(M):
    print(i+1,N-i)
else:
  middle=int((M+1)/2)
  for i in range(middle):
    print(i+1,N-i)
  for j in range(middle,M):
    print(j+2,N-j)
n=int(input())
a=0
for i in range(len(str(n))):
    a+=n[i]
if n%a==0:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

n=input()
a=0
for i in range(len(n)):
    a+=int(n[i])
if int(n)%a==0:
    print("Yes")
else:
    print("No")
H,W = (int(x) for x in input().split())

if H == 0 and W == 0:
    break

i = 0
while i < H:
    j = 0
    while j < W:
        print ("#", end='')
        j += 1
    print ('')
    i += 1


### FIXED CODE ###

while True:
    H,W = (int(x) for x in input().split())
    
    if H == 0 and W == 0:
        break
    
    i = 0 
    while i < H:
        j = 0 
        while j < W:
            print ("#", end='')
            j += 1
        print ('')
        i += 1
    print ('')
h, w = map(int, input().split())
print(h, w)
while h != 0:
    for _ in range(h):
        for _ in range(w):
            sys.stdout.write("#")
        print()
h, w = map(int, input().split())


### FIXED CODE ###

import sys
h, w = map(int, input().split())
while h != 0:
    for _ in range(h):
        for _ in range(w):
            sys.stdout.write("#")
        print()
    print()
    h, w = map(int, input().split())
l = []
n = int(input())
for _ in range (n):
    cmd = input().split(' ')
    if cmd[0]=='insert':
        l.insert(0,int(cmd[1]))
    if cmd[0]=='delete':
        l.remove(int(cmd[1]))
    if cmd[0]=='deleteFirst':
        l.pop(0)
    if cmd[0]=='deleteLast':
        l.pop(len(l)-1)
print(*l)


### FIXED CODE ###

from collections import deque
n = int(input())
l = deque()
for _ in range (n):
    cmd = input().split(' ')
    if cmd[0]=='insert':
        l.appendleft(cmd[1])  
    if cmd[0]=='delete':
        try:l.remove(cmd[1])
        except :pass
    if cmd[0]=='deleteFirst':
        l.popleft()
    if cmd[0]=='deleteLast':
        l.pop()
print(*l)
import math
N = int(input())

if N%2 == 1:
    ans = 0
else:

    df = math.log10(N)
    d = math.floor(df)
    cnt = 0
    for i in range(d,0,-1):
        cnt += (N//10**i) * (10**i-1)//(10-1)
        N//=10**i

print(cnt)

### FIXED CODE ###

A = int(input())
B = int(input())

print(1+2+3-A-B)
n = int(input())
a = [int(i) for i in input().split()]
s == 0
for i in a:
  s += 1/i
print(1/s)


### FIXED CODE ###

n = int(input())
a = [int(i) for i in input().split()]
s = 0
for j in a:
  s += 1/j
print(1/s)
a = input()
print(int(a+a**2+a**3))

### FIXED CODE ###

a = int(input())
print(a+a**2+a**3)
n = int(input())
a = list(map(int, input().split()))
ans = 1
pre = a[0]
increase = True
if a[1] < a[0]:
    increase = False

for i in range(1, n):
    if a[i] < pre:
        if increase:
            ans += 1
            increase = not increase
    elif a[i] > pre:
        if not increase:
            ans += 1
            increase = not increase
    pre = a[i]
print(ans)

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
inc = False
dec = False
ans = 1

for i in range(n-1):
    if a[i+1] > a[i]:
        if dec:
            ans += 1
            dec = False
        else:
            inc = True
    elif a[i+1] < a[i]:
        if inc:
            ans += 1
            inc = False
        else:
            dec = True

print(ans)
import sys
input = sys.stdin.readline
S = list(input())
T = list(input())
N = len(S)
for i in range(N):
    S = S[-1] + S[:N-1]
    if S == T:
        print("Yes")
        sys.exit()
print("No")

### FIXED CODE ###

import sys
input = sys.stdin.readline
S = list(input().rstrip())
T = list(input().rstrip())
N = len(S)
for i in range(N):
    S = list(S[-1]) + S[:N-1]
    if S == T:
        print("Yes")
        sys.exit()
print("No")
# C - Welcome to AtCoder
# https://atcoder.jp/contests/abc151/tasks/abc151_c

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

ac = 0
wa = 0

AC = "AC"
WA = "WA"

tmp_wa = 0
tmp_ac = 0


for i in range(len(submits)):
    # ACなら正解数をカウントアップ
    if submits[i][1] == AC:
        # 同じ問題に正解してないかチェック
        if submits[i][0] == tmp_ac:
            tmp_ac = submits[i][0]
            continue
        ac += 1
        # WAの数をカウント
        wa += tmp_wa
        # WAを初期化
        tmp_wa = 0
        tmp_ac = submits[i][0]
    else:
        # WAならwa+1
        tmp_wa += 1

print(str(ac) + " " + str(wa))

### FIXED CODE ###

# A - Next Alphabet
# https://atcoder.jp/contests/abc151/tasks/abc151_a

print(chr(ord(input())+1))
list = list(input())
for i in len(list):
    n = 0:
    if list[i] ==1:
        n =+ 1
print(n)


### FIXED CODE ###

L = input()
n=0
for i in range(len(L)):
    if int(L[i]) ==1:
        n += 1
print(n)
number = 2^3:
print("number")


### FIXED CODE ###

x = int(input())
print(x**3)
a,b=map(int,input().split())
if a-b＊2<=0:
  
  print(0)
else:
  print(a-b＊2)
  


### FIXED CODE ###

a,b=map(int,input().split())
if a-b*2<=0:
  
  print(0)
else:
  print(a-b*2)
import math
a,b,c,d=map(int,input().split())

x1=b//c-a//c
x2=b//d-a//d
sks=c * d // math.gcd(c,d)
x3=b//sks-a//sks
ans=(x1+x2)-x3
print (ans)


### FIXED CODE ###

import fractions
a,b,c,d=map(int,input().split())
x1=b//c-(a-1)//c #ｃの割れるやつ
x2=b//d-(a-1)//d #ｄの割れるやつ
sks=c * d // fractions.gcd(c,d)#最小公倍数　普通ならmathメソッドにある
x3=b//sks-(a-1)//sks#ｃ＊ｄの割れるやつ
ans=b-a+1-(x1+x2-x3)
print (ans)
A, V = map(int, input().split(" "))
B, W = map(int, input().split(" "))
T = int(input())

if W > V:
  print("NO")
else:
  if abs(A - B) / (V - W) <= T:
    print("YES")
  else:
    print("NO")

### FIXED CODE ###

A, V = map(int, input().split(" "))
B, W = map(int, input().split(" "))
T = int(input())

if W > V:
  print("NO")
else:

  if abs(A - B) <= T * (V - W):
    print("YES")
  else:
    print("NO")

# if A - B > 0:
#   # 負の方向に逃げる
#   if (B + 10**9) / W <= T:
#     # print("left reach")
#     # T立つよりも先に端に到達してしまう場合
#     Bdist = (B + 10**9)
#   else:
#     # print("run left")
#     Bdist = W * T
# else:
#   # 正の方向に逃げる
#   if (10**9 - B) / W <= T:
#     # print("right reach")
#     Bdist = (10**9 - B)
#   else:
#     # print("run right")
#     Bdist = W * T

# Adist = V * T
# if Bdist + abs(A - B) <= Adist:
#   print("YES")
# else:
#   print("NO")
import math
import sys

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

A = num[0]
B = num[1]
C = num[2]
D = num[3]

def ans_mthd(i, j, k):
    return i - i // j - i // k + i * math.gcd(j, k) / j // k 

ans = ans_mthd(B, C, D)-ans_mthd(A-1, C, D)
# print(math.gcd(C, D))
# print(C * D)
# print(ans_mthd(B, C, D) // 1)
print(ans)

### FIXED CODE ###

import fractions
A,B,C,D=map(int, input().split())
def ans_mthd(i, j, k):
    return (i - i // j - i // k + i * fractions.gcd(j, k) // j // k )
ans = ans_mthd(B, C, D)-ans_mthd(A-1, C, D)
print(ans)
N=int(input())
btc=380000
ans=0
for i in range(N):
  x,u=map(str,input().split())
  x = int(x)
  if u=='BTC':
    x *= btc
  ans += x
print(ans)

### FIXED CODE ###

N = int(input())
btc = 380000
ans = 0
for i in range(N):
    x,u = map(str,input().split())
    x = float(x)
    if u=='BTC':
        x *= btc
    ans += x
print(ans)
import numpy as np

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

s = 0

def step(a, s):
    am = np.argmax(a)
    s = s + np.max(a)*a[am+1:].shape[0] - np.sum(a[am+1:])

    if am == 0:
        return s
    else:
        return step(a[:am], s)

print(step(A, s))


### FIXED CODE ###

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

s = 0

for i in range(1, N):
    if A[i-1] > A[i]:
        s += A[i-1] - A[i]
        A[i] = A[i-1]

print(s)
import numpy as np
import math

def main():
    N, X = map(int, input().split())
    x = np.asarray(list(map(int, input().split())))
    x = np.absolute(x - X)
    if N > 1:
        d = []
        for i in range(x.size-2):
            d.append(x[i+1] - x[i])
        d = list(map(abs, list(set(d))))
        print(mygcd(d))
    else:
        print(x[0])

def mygcd(seq):
    if len(seq) == 1:
        return seq[0]
    else:
        a = seq.pop()
        b = seq.pop()
        return mygcd(seq.append(math.gcd(a, b)))


if __name__ == '__main__':
    main()

### FIXED CODE ###


import numpy as np
import fractions

def main():
    N, X = map(int, input().split())
    x = np.asarray(list(map(int, input().split())))
    x = np.absolute(x - X)
    if N > 1:
        l = None
        for i, n in enumerate(x):
            if i == 0:
                l = n
            else:
                l = fractions.gcd(l, n)
        print(l)
    else:
        print(x[0])


if __name__ == '__main__':
    main()
s1 = list(str(iuput()))
s2 = list(str(iuput()))
s3 = list(str(iuput()))
print(s1[0] + s2[1] + s3[2])


### FIXED CODE ###

s1 = list(str(input()))
s2 = list(str(input()))
s3 = list(str(input()))
print(s1[0] + s2[1] + s3[2])
a, b = map(int, input().split())
if a % 2 != 0 and b % 2 != 0:
  print(“Yes”)
else:
  print(“No”)


### FIXED CODE ###

a, b = map(int, input().split())
if a * b % 2 == 0:
  print("No")
else:
  print("Yes")
import sys
s = input()
n = len(s)

ans = 7

for bit in range(2**(n-1)):
    tmp = s[0]
    for i in range(n-1):
        if (1<<i)&bit:
            tmp += '+'
        else:
            total += '-'
        tmp += s[i+1]
    total = eval(tmp)
    if total == ans:
        print(tmp + '=7')
        sys.exit()


### FIXED CODE ###

import sys
s = input()
n = len(s)

ans = 7

for bit in range(2**(n-1)):
    tmp = s[0]
    for i in range(n-1):
        if (1<<i)&bit:
            tmp += '+'
        else:
            tmp += '-'
        tmp += s[i+1]
    total = eval(tmp)
    if total == ans:
        print(tmp + '=7')
        sys.exit()
import bisect
N, K = map(int, input().split())

LR = [list(map(int, input().split())) for i in range(K)]
S = set()
for i in LR:
    for j in range(i[0], i[1]+1):
        S.add(j)
L = sorted(list(S))

dp = [0 for i in range(N)]
dp[0] = 1
for i in range(1, N):
    x = bisect.bisect(L, i)
    t = L[:x]
    for j in t:
        dp[i] += dp[i-j]
    dp[i] = dp[i] % 998244353

print(dp[-1] % 998244353)


### FIXED CODE ###

S = input()

if S[-1] == 's':
    print(S + 'es')
else:
    print(S + 's')
n,k=map(int, input().split(' '))
a=list(map(int, input().split(' ')))
ans,s=0,0
for i in a:
  if(s<=k) ans+=1
  else break
  s+=i
print(ans)


### FIXED CODE ###

n,k=map(int, input().split(' '))
a=list(map(int, input().split(' ')))
ans,s=0,0
for i in a:
  if s<=k: ans+=1
  else: break
  s+=i

if s<=k: ans+=1
print(ans)
S = sort(input())

if S == 'abc':
	print('Yes')
else:
	print('No')

### FIXED CODE ###

S = list(input())
S.sort()
a = ''.join(S)
if a == 'abc':
	print('Yes')
else:
	print('No')
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10000000)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations
    #from itertools import accumulate, product
    from bisect import bisect_left,bisect_right
    from math import floor, ceil
    #from operator import itemgetter

    #mod = 1000000007
    
    N, W = map(int,input().split())
    wv = [tuple(map(int,input().split())) for i in range(N)]
    dp = [0]*(W+1)
    for i in range(N):
        for j in range(W, wv[i][0]-1, -1):
            dp[j] = max(dp[j], dp[j-wv[i][0]]+wv[i][1])
    print(max(dp))

if __name__ == '__main__':
    main()


### FIXED CODE ###

#典型ナップザック
#10**9はMLE(pypyではRE)

def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10000000)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations
    #from itertools import accumulate, product
    from bisect import bisect_left,bisect_right
    from math import floor, ceil
    #from operator import itemgetter

    #mod = 1000000007

    N, W = map(int, input().split())
    w = [0]*N
    v = [0]*N
    for i in range(N):
        w[i], v[i] = map(int, input().split())
    V = 10**5+1
    inf = float('inf')
    dp = [inf]*V
    dp[0] = 0
    for i in range(N):
        for j in range(V, v[i]-1, -1):
            if dp[j-v[i]]+w[i]<=W:
                dp[j] = min(dp[j], dp[j-v[i]]+w[i])
    for i in range(V):
        if dp[-(i+1)]<=W:
            print(V-(i+1))
            exit()
            
if __name__ == '__main__':
    main()
def main():
    global n, peso, dp

    n = int(input())
    peso = [int(x) for x in input().split()]
    dp = [-1]*(10**5 + 1)
    
    peso.append(10**9)
    peso.append(10**9)
    
    print(frog(0))
    
def frog(i):
    global n, peso, dp
    
    if i >= n - 1:
        return 0

    if dp[i] != -1:
        return dp[i]

    dp[i] = min(abs(peso[i + 1] - peso[i]) + frog(i + 1),
                abs(peso[i + 2] - peso[i]) + frog(i + 2))
    
    return dp[i]

main()

### FIXED CODE ###

from sys import stdin
n = int(stdin.readline())
h = [int(i) for i in stdin.readline().split(' ')]

minCosts = [0, abs(h[1]-h[0])]
for i in range(2, len(h)):
    minCosts.append(min(abs(h[i]-h[i-2])+minCosts[i-2], abs(h[i]-h[i-1])+minCosts[i-1]))

print(minCosts[-1])
# -*- coding utf-8 -*-

n, k = map(int, input().split())
sushi = [list(map(int, input().split())) for _ in range(n)]
sushi.sort(key = lambda x: x[1], reverse = True)    # sort by d

mp_max = 0
op = 0
taberu_ind = set()
pop_cands = []
t_taberu = set()
# greedy for delicious point
for i in range(k):
    op += sushi[i][1]

    t = sushi[i][0]
    if t_taberu.isdisjoint({t}):    # new type
        t_taberu.add(t)
    else:
        pop_cands.append(i)

    taberu_ind.add(i)
mp_max = op + len(t_taberu)**2

# reduce dericious, gain variety
i += 1
j = i
for i in range(i, n):
    pop_ind = pop_cands.pop()
    taberu_ind.remove(pop_ind)

    for j in range(j, n):
        t = sushi[j][0]
        if t_taberu.isdisjoint({t}):
            t_taberu.add(t)
            break
    else:
        break
    
    # calc points
    op -= sushi[pop_ind][1]
    op += sushi[j][1]
    mp = op + len(t_taberu)**2
    mp_max = max(mp_max, mp)

    taberu_ind.add(i)

    if len(pop_cands) == 0:
        break

print(mp_max)



### FIXED CODE ###

# -*- coding utf-8 -*-

n, k = map(int, input().split())
sushi = [list(map(int, input().split())) for _ in range(n)]
sushi.sort(key = lambda x: x[1], reverse = True)    # sort by d

mp_max = 0
op = 0
taberu_ind = set()
pop_cands = []
t_taberu = set()
# greedy for delicious point
for i in range(k):
    op += sushi[i][1]

    t = sushi[i][0]
    if t_taberu.isdisjoint({t}):    # new type
        t_taberu.add(t)
    else:
        pop_cands.append(i)

    taberu_ind.add(i)
mp_max = op + len(t_taberu)**2

# reduce dericious, gain variety
i += 1
j = i
for i in range(i, n):
    if len(pop_cands) == 0:
        break

    pop_ind = pop_cands.pop()
    taberu_ind.remove(pop_ind)

    for j in range(j, n):
        t = sushi[j][0]
        if t_taberu.isdisjoint({t}):
            t_taberu.add(t)
            break
    else:
        break
    
    # calc points
    op -= sushi[pop_ind][1]
    op += sushi[j][1]
    mp = op + len(t_taberu)**2
    mp_max = max(mp_max, mp)

    taberu_ind.add(i)    # not necessary actually
print(mp_max)
# -*- coding: utf-8 -*-

x = int(input())
xx = list(reversed(range(1,x+1)))
xxx = set()

for i in range(1, 32):
    for j in range(2, 11):
        if i**j <= 1000:
            xxx.add(i**j)

for i in xx:
    if i in xxx:
        print(i)
        break

### FIXED CODE ###

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

a, b, c, d = map(int, input().split())

if abs(c - a) <= d or (abs(b - a) <= d and abs(c - b) <= d):
    print('Yes')
else:
    print('No')
n = int(input())
array = [int(x) for x in input().split()]

cnt = 1
tmp = array.pop(0)
tmp2 = array.pop(0)
mode = "plus" if tmp2 > tmp else "minus" if tmp2 != tmp else "equal"
tmp = tmp2

for i in array:
    if tmp < i:
        if mode == "minus":
            cnt += 1
            mode = "equal"
        elif mode == "equal":
            mode = "plus"
    elif tmp > i:
        if mode == "plus":
            cnt += 1
            mode = "equal"
        elif mode == "equal":
            mode = "minus"
    tmp = i
print(cnt)

### FIXED CODE ###

import sys

n = int(input())
array = [int(x) for x in input().split()]

cnt = 1
if n ==1:
    print(cnt)
    exit()

tmp = array.pop(0)
tmp2 = array.pop(0)
mode = "plus" if tmp2 > tmp else "minus" if tmp2 != tmp else "equal"
tmp = tmp2

for i in array:
    if tmp < i:
        if mode == "minus":
            cnt += 1
            mode = "equal"
        elif mode == "equal":
            mode = "plus"
    elif tmp > i:
        if mode == "plus":
            cnt += 1
            mode = "equal"
        elif mode == "equal":
            mode = "minus"
    tmp = i
print(cnt)
print(x**3)

### FIXED CODE ###

x = int(input())
print(x**3)
N = input()
A = list(map(int,input().split()))
#２の倍数かどうかを調べる関数　引数:4→True,5→False

def isAllEVEN(A):
    return (not (False in (list(map(lambda x:x%2==0,A)))))

i = 0
while(isAllEVEN(A)):
	A = list(map(lambda x:x/2,A))
    i++;
print(i)    
       

### FIXED CODE ###

def choise(s):
  return len(list(filter(lambda x:x=='1',s)))

if __name__ == "__main__":
    i1 = input()
    print(choise(i1))
from itertools import combinations, count
 
n = int(input())
r = range(n)
a = [(set(), set()) for _ in r]
for i in r:
  for _ in range(int(input())):
    x, y = map(int, input().split())
    a[i][y].add(x - 1)
r = next(i for i in count(n, -1) for x in map(set, combinations(r, i))
         if set.union(*(a[j][0] for j in x)).isdisjoint(x) and
         set.union(*(a[j][1] for j in x)) <= x)
print(r)


### FIXED CODE ###

from itertools import combinations

n = int(input())
r = range(n)
a = [(set(), set()) for _ in r]
for i in r:
  for _ in range(int(input())):
    x, y = map(int, input().split())
    a[i][y].add(x - 1)

fail = lambda x: (not all(a[i][0].isdisjoint(x) and a[i][1] < x for i in x))

while n and all(map(fail, map(set, combinations(r, n)))):
  n -= 1
print(n)
t = input()
o = ""
for i in range(len(t)):
    if t[i] == "?":
        if t[i - 1] == "P":
            o += "D"
        elif i != len(t):
            if t[i + 1] == "D":
                o += "P"
        else:
            o += "D"
    else:
        o += t[i]

print(o)

### FIXED CODE ###

print(input().replace('?','D'))
# program to print the new string after performing append operation in the string s "..." 
# if only the character s is more than k but if the character s is at most k
# the output will not change
#first we will define the new string

k =int(input())
s = input()

str = s
dots = "..."
if len(S) == k:
print(S)
elif len(S) > k:
print (str[0:k],"...")



### FIXED CODE ###

# Take both input K & S, then compare the length of S with K and assign it to length
# If the length is <= K print all
# And if length is >K print some of the character

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

x = 0

length = len(S)

if length <= K:
    print(S)
else:
    while x < K:
        print(S[x], end=(""))
        x += 1
    print("...")
n = int(input())
a = list(map(int, raw_input().split()))
for i in range(n):
    v = a[i]
    j = i - 1
    while j >= 0 and a[j] > v:
        a[j+1] = a[j]
        j -= 1
        a[j+1] = v
    print(" ".join(str(s) for s in a)

### FIXED CODE ###

#!/usr/bin/env python
# encoding: utf-8

from __future__ import print_function


class Solution:
    """
    @param prices: Given an integer array
    @return: Maximum profit
    """

    @staticmethod
    def insertion_sort():
        # write your code here
        array_length = int(input())
        unsorted_array = [int(x) for x in input().split()]

        for i in range(array_length):
            v = unsorted_array[i]
            j = i - 1
            while j >= 0 and unsorted_array[j] > v:
                unsorted_array[j + 1] = unsorted_array[j]
                j -= 1
            unsorted_array[j + 1] = v
            print(" ".join(map(str, unsorted_array)))


if __name__ == '__main__':
    solution = Solution()
    solution.insertion_sort()
n = int(input())
lis = list(int,input().split())
print(max(lis)-min(lis))

### FIXED CODE ###

n = int(input())
lis = list(map(int,input().split()))
print(max(lis)-min(lis))
N = int(input())
L = [0 if x//3==0 or x//5==0 else x for x in range(1,16)]
Q = N//15
R = N%15
S = 30 * Q * (Q+1) + sum(L[R-1])
print(S)

### FIXED CODE ###

N = int(input())
S = 0
for i in range(N+1):
  if i%3 != 0 and i%5 != 0:
    S += i
print(S)
f = open("input.txt", "r")
input = map(lambda x : int(x), f.read().strip().split("\n"))
f.close()
d, n, m = input[0], input[1], input[2]
S, K = set(sorted([0]+input[3:3+n-1])), input[3+n-1:]
sum = 0
for k in K:
	i = 1
	while (True):
		if (k+i)%8 in S or (k-i)%8 in S: break
		i += 1
	sum += i
f = open("output.txt", "w")
f.write(str(sum))
f.close()

### FIXED CODE ###

def find(l, e):
	start, end = 0, len(l)
	while True:
		mid = (start+end)//2
		if l[mid] == e: 
			return (e, e)
		elif (l[mid] > e):
			if (l[mid-1] < e):
				return (l[mid-1], l[mid])
			end = mid
			continue
		elif (l[mid] < e):
			if (l[mid+1] > e):
				return (l[mid], l[mid+1])
			start = mid

def print_sum():
	d = int(raw_input())
	if d == 0: return False
	n, m = int(raw_input()), int(raw_input())
	S = [int(raw_input()) for _ in range(n-1)]
	K = [int(raw_input()) for _ in range(m)]
	S = [0] + sorted(S) + [d]
	sum = 0
	for k in K:
		low, high = find(S, k)
		sum += min(k-low, high-k)
	print sum
	return True

while (print_sum()):
	pass
N, A, B = map(int, input().split())

counter = [0 for _ in range(N)]
ans = 0
for i in range(1,N+1):
    st = str(i)
    for j in range(len(st)):
        counter[i] = counter[i] + int(st[j])
    if A<=counter[i]<=B :
        ans = ans + i

print(ans)

### FIXED CODE ###

N, A, B = map(int, input().split())
ans = 0

for i in range(1, N+1):
    num_sum = 0
    for j in str(i):
        num_sum += int(j)
    if A<= num_sum <= B:
        ans += i

print(ans)