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

def isLunLun(num):
  pre = num%10
  while num != 0:
    num, mod = divmod(num, 10)
    if abs(mod-pre) > 1:
      return False
    pre = mod
  return True

K=int(input())
k=0
num = 1
latestLunLun = 0
while k != K:
  if isLunLun(num):
    k+=1
    latestLunLun = num
  num+=1
print(latestLunLun)

### FIXED CODE ###


def makeLunLun(num):
  lunlunNums = []
  m = num % 10 -1
  z = m + 1
  p = m + 2
  if m >= 0:
    lunlunNums.append(num * 10 + m)
  lunlunNums.append(num * 10 + z)
  if p <= 9:
    lunlunNums.append(num * 10 + p)
  return lunlunNums

K=int(input())

queue = [1,2,3,4,5,6,7,8,9]
i=0
while K > len(queue):
  lunluns = makeLunLun(queue[i])
  queue += lunluns
  i += 1
print(queue[K-1])
### BUGGY CODE ###

a = list(map(int,input().split()))
s = 1
for i in range(a[0],a[1]):
    s *= i
s *= a[1]
if s < 0:
    print("Negative")
elif s > 0:
    print("Positive")
else:
    print("Zero")

### FIXED CODE ###

a, b = map(int, input().split())
ans = ''
if a > 0 and b > 0:
  ans = 'Positive'
elif a <= 0 and b >= 0:
  ans = 'Zero'
elif a < 0 and  b < 0:
  if (b - a) % 2 == 0:
    ans = 'Negative'
  else:
    ans = 'Positive'
print(ans)
### BUGGY CODE ###

X, Y = map(int, input().split())
Z = (10**18 // X) * X
if (X == Y) or (Y == 1):
    print(-1)
elif X < Y :
    print(X)
else:
    for i in range(Z, 0, -X):
        if i % Y != 0:
            print(i)
            break
    else:
        print(-1)

### FIXED CODE ###

X, Y = map(int, input().split())
Z = (10**18 // X) * X
if (X == Y) or (Y == 1) or (X % Y == 0):
    print(-1)
elif X < Y:
    print(X)
else:
    for i in range(Z, 0, -X):
        if i % Y != 0:
            print(i)
            break
    else:
        print(-1)
### BUGGY CODE ###

#!/usr/bin/env python3
def main():
    from collections import deque

    def bfs(S, start_h, start_w, goal_h, goal_w, H, W):
        que0 = deque()
        que1 = deque()
        dist = [[INF] * W for _ in range(H)]
        dist[start_h][start_w] = 0
        que0.append((start_h, start_w))
        while que0 or que1:
            nh, nw = que0.popleft() if que0 else que1.popleft()
            for dh in range(-2, 3):
                for dw in range(-2, 3):
                    next_h = nh + dh
                    next_w = nw + dw
                    cost = 0 if abs(dh) + abs(dw) <= 1 else 1
                    if not (0 <= next_h < H and 0 <= next_w < W):
                        continue
                    if S[next_h][next_w] == '#':
                        continue
                    if dist[next_h][next_w] > dist[nh][nw] + cost:
                        dist[next_h][next_w] = dist[nh][nw] + cost
                        if cost == 0:
                            que0.append((next_h, next_w))
                        else:
                            que1.append((next_h, next_w))
        return dist[goal_h][goal_w] if dist[goal_h][goal_w] != INF else - 1
        
    H, W = map(int, input().split())
    Ch, Cw = (int(i) - 1 for i in input().split())
    Dh, Dw = (int(i) - 1 for i in input().split())
    S = [input() for _ in range(H)]
    
    INF = 10 ** 6
    ans = bfs(S, Ch, Cw, Dh, Dw, H, W)
    print(ans)


if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
def main():
    from collections import deque

    def bfs(S, start_h, start_w, goal_h, goal_w, H, W):
        que0 = deque()
        que1 = deque()
        dist = [[INF] * W for _ in range(H)]
        dist[start_h][start_w] = 0
        que0.append((start_h, start_w))
        while que0 or que1:
            nh, nw = que0.popleft() if que0 else que1.popleft()
            for dh in range(-2, 3):
                for dw in range(-2, 3):
                    next_h = nh + dh
                    next_w = nw + dw
                    cost = 0 if abs(dh) + abs(dw) <= 1 else 1
                    if not (0 <= next_h < H and 0 <= next_w < W):
                        continue
                    if S[next_h][next_w] == '#':
                        continue
                    if dist[next_h][next_w] > dist[nh][nw] + cost:
                        dist[next_h][next_w] = dist[nh][nw] + cost
                        if cost == 0:
                            que0.append((next_h, next_w))
                        else:
                            que1.append((next_h, next_w))
        return dist[goal_h][goal_w] if dist[goal_h][goal_w] != INF else - 1
        
    H, W = map(int, input().split())
    Ch, Cw = (int(i) - 1 for i in input().split())
    Dh, Dw = (int(i) - 1 for i in input().split())
    S = [input() for _ in range(H)]
    
    INF = 10 ** 6
    ans = bfs(S, Ch, Cw, Dh, Dw, H, W)
    print(ans)


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

N = int(input())
A = list(map(int, input().split()))
res = True
p = 1
for n in range(N):
    for i in range(p, N):
        if A[n] == A[i]:
            res = False
    p += 1
if res:
    print('YES')
else:
    print('NO')

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
A.sort()
res = A[0]
cnt = True
for n in range(1, N):
    if A[n] == res:
        cnt= False
    res = A[n]
if cnt:
    print('YES')
else:
    print('NO')
### BUGGY CODE ###

#import numpy as np
H, W = map(int, input().split())
S = [0]*H
counth = [[0]*W for _ in range(H)]  
countw = [[0]*W for _ in range(H)]

for i in range(H):
  S[i] = input()
  
for i in range(H):
  for j in range(W):
    if S[i][j]=='.':
      if counth[i][j]==0:
        b=False
        for k in range(j,W):
          if S[i][k]=='#':
            b = True
            break
        if b==False:
          k+=1
        #print(S[i][j:],l)
        for l in range(j,k):
          #print(i,j,l)
          counth[i][l]=k-j
      if countw[i][j]==0:
        b=False
        for k in range(i,H):
          if S[k][j]=='#':
            b=True
            break
        if b==False:
          k+=1
        #print(S[i:][j],m)
        for l in range(i,k):
          #print(i,j,l)
          countw[l][j]=k-i
      #print(i,j,count)
#print(counth,countw)
maxim = 0
for i in range(H):
  for j in range(W):
    maxim = int(max(maxim,counth[i][j]+countw[i][j]-1))
print(maxim)

### FIXED CODE ###

#import numpy as np
H, W = map(int, input().split())
S = [0]*H
counth = [[0]*W for _ in range(H)]  
countw = [[0]*W for _ in range(H)]

for i in range(H):
  S[i] = input()
  
for i in range(H):
  for j in range(W):
    if S[i][j]=='.':
      if counth[i][j]==0:
        b=False
        for k in range(j,W):
          if S[i][k]=='#':
            b = True
            break
        if b==False:
          k+=1
        #print(S[i][j:],l)
        for l in range(j,k):
          #print(i,j,l)
          counth[i][l]=k-j
      if countw[i][j]==0:
        b=False
        for k in range(i,H):
          if S[k][j]=='#':
            b=True
            break
        if b==False:
          k+=1
        #print(S[i:][j],m)
        for l in range(i,k):
          #print(i,j,l)
          countw[l][j]=k-i
      #print(i,j,count)
#print(counth,countw)
maxim = 0
for i in range(H):
  for j in range(W):
    maxim = int(max(maxim,counth[i][j]+countw[i][j]-1))
print(maxim)
### BUGGY CODE ###

n = int(input())

s = [str(input()) for i in range(n)]

from collections import Counter
c = Counter(s)

result = [i[0] for i in c.items() if i[1]==max(c.values())]
result.sort()


for i in range(len(result)):
    print(result[i])

### FIXED CODE ###

n = int(input())
 
s = [str(input()) for i in range(n)]
 
from collections import Counter
c = Counter(s)

max_num = max(c.values())

result = [i[0] for i in c.items() if i[1]==max_num]
result.sort()
 
for i in range(len(result)):
    print(result[i])
### BUGGY CODE ###

S = input()
con = 10**9 + 7

T = [s if s != "?" else "0" for s in S]
T = int(''.join(T))
SS = T % 13

def get_mod(S):
    c = {}
    iii = 1
    for i in range(len(S)):
        if S[len(S) - i - 1] != "?":
            iii *= 10
            iii %= 13
            continue
        c[i] = {(j * iii) % 13: 1 for j in range(0, 10)}
        iii *= 10
        iii %= 13
    return c
c = get_mod(S)

def get_tdp(pdp):
    tdp = {i: 0 for i in range(13)}
    for r in v.keys():
        for _r, _v in pdp.items():
            i = (_r + r) % 13
            tdp[i] += _v
    for i in range(13):
        tdp[i] %= con
    return tdp

pdp = {i: 0 for i in range(13)}
pdp[SS] += 1
for k, v in c.items():
    pdp = get_tdp(pdp)

ans = pdp[5]
print(ans)

### FIXED CODE ###

S = input()
con = 10**9 + 7

T = [s if s != "?" else "0" for s in S]
T = int(''.join(T))
SS = T % 13

def get_mod(S):
    c = {}
    iii = 1
    for i in range(len(S)):
        if S[len(S) - i - 1] != "?":
            iii *= 10
            iii %= 13
            continue
        c[i] = {(j * iii) % 13: 1 for j in range(0, 10)}
        iii *= 10
        iii %= 13
    return c
c = get_mod(S)

def get_tdp(pdp):
    tdp = {i: 0 for i in range(13)}
    for r in v.keys():
        for _r, _v in pdp.items():
            tdp[(_r + r) % 13] += _v
    for i in range(13):
        tdp[i] %= con
    return tdp

pdp = {i: 0 for i in range(13)}
pdp[SS] += 1
for k, v in c.items():
    pdp = get_tdp(pdp)

ans = pdp[5]
print(ans)
### BUGGY CODE ###

from bisect import bisect_left, bisect_right
N = int(input())
A = list(map(int, input().strip().split()))
B = list(map(int, input().strip().split()))
C = list(map(int, input().strip().split()))
A.sort()
B.sort()
C.sort()
ans = 0
for a in A:
    i = bisect_right(B, a)
    for b in B[i:]:
        j = bisect_right(C, b)
        ans += len(C[j:])
print(ans)

### FIXED CODE ###

import bisect
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
A.sort()
B.sort()
C.sort()
ans = 0
for b in B:
    i = bisect.bisect_left(A, b)
    j = bisect.bisect_right(C, b)
    ans += i*(N-j)
print(ans)
### BUGGY CODE ###

import sys
sys.setrecursionlimit(10**6)
if sys.platform in (['ios','darwin','win32']):
	sys.stdin=open('Untitled.txt')
input = sys.stdin.readline
def INT(): return int(input())
def MAP(): return [int(s) for s in input().split()]

S = input().rstrip()
N = len(S)
K = INT()

min_s = min(S)
B = [s for s in S]
B.sort()
# print(B)

cursol = 0
min_s = 'ATCODER'
cand = []
while len(cand) < K:
	# print(cursol)
	if min_s == B[cursol]:
		cursol += 1
		continue
	else:
		min_s = B[cursol]
	for i,s in enumerate(S):
		if s == min_s:
			for j in range(i+1, N+1):
				if not cand.count(S[i:j]): cand.append(S[i:j])
	cursol += 1

cand.sort()
# print(cand)

s = min(S)
cnt = 0
for c in cand:
	cnt += 1
	if cnt == K:
		print(c)
		break

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**6)
if sys.platform in (['ios','darwin','win32']):
	sys.stdin=open('Untitled.txt')
input = sys.stdin.readline
def INT(): return int(input())
def MAP(): return [int(s) for s in input().split()]

S = input().rstrip()
N = len(S)
K = INT()

min_s = min(S)
B = [s for s in S]
B.sort()
# print(B)

cursol = 0
min_s = 'ATCODER'
cand = []
while len(cand) < K:
	# print(cursol)
	if min_s == B[cursol]:
		cursol += 1
		continue
	else:
		min_s = B[cursol]
	for i,s in enumerate(S):
		if s == min_s:
			for j in range(i+1, i+1+K):
				if not cand.count(S[i:j]): cand.append(S[i:j])
	cursol += 1

cand.sort()
# print(cand)

s = min(S)
cnt = 0
for c in cand:
	cnt += 1
	if cnt == K:
		print(c)
		break
### BUGGY CODE ###

n = int(input())
A = list(map(int, input().split()))
ans = 1000
for ii in range(2 ** n):
    tmp = 1000
    kab = 0
    action = 'buy'
    for i in range(n):
        if (ii >> i) & 1:
            if action == 'buy':
                if tmp < A[i]:
                    break
                kab += tmp // A[i]
                tmp = tmp % A[i]
                action = 'sell'

            elif action == 'sell':
                if kab == 0:
                    break
                tmp += kab * A[i]
                kab = 0
                action = 'buy'
    else:
        ans = max(ans, tmp)

print(ans)


### FIXED CODE ###

n = int(input())
A = list(map(int, input().split()))
ans = 1000
for i in range(n - 1):
    if A[i] < A[i + 1]:
        ans += ans // A[i] * (A[i + 1] - A[i])
print(ans)
### BUGGY CODE ###

a, b, k = map(int, input().split())
for i in range(k):
  if a > 0:
    a -= 1
  elif b > 0:
    b -= 1
  else:
    break
    
print(" ".join(map(str, [a,b])))

### FIXED CODE ###

a, b, k = map(int, input().split())
 
if a >= k:
  print(a-k, b)
else:
  if a+b > k:
    print(0, b-(k-a))
  else:
    print(0,0)
### BUGGY CODE ###

n = int(input())
t,a = map(int,input().split())
nowt = t
nowa = a
for i in range(n-1):
    t , a = map(int,input().split())
    kou = 1
    while True:
        if t*kou >= nowt and a*kou >= nowa:
            break
        else:
            kou += 1
    nowt = t*kou
    nowa = a*kou
print(nowt+nowa)

### FIXED CODE ###

n = int(input())
t,a = map(int,input().split())
nowt = t
nowa = a
for i in range(n-1):
    t , a = map(int,input().split())
    kou = max(nowt//t,nowa//a)
    while True:
        if t*kou >= nowt and a*kou >= nowa:
            break
        else:
            kou += 1
    nowt = t*kou
    nowa = a*kou
print(nowt+nowa)
### BUGGY CODE ###

import sys
n,m = map(int,input().split())
ls = [int(input()) for _ in range(m)]
dp = [0]*(n+1)
dp[0] = 1
for i in range(1,n+1):
    if i not in ls:
        dp[i] = (dp[i-1]+dp[i-2])%(10**9+7)
    else:
        if i-1 in ls:
            print(0)
            sys.exit()
print(dp[-1])

### FIXED CODE ###

import sys
n,m = map(int,input().split())
ls = set(int(input()) for _ in range(m))
dp = [0]*(n+1)
dp[0] = 1
for i in range(1,n+1):
    if i not in ls:
        dp[i] = (dp[i-1]+dp[i-2])
        if dp[i] >= 10**9+7:
            dp[i] %= 10**9+7 
    else:
        if i-1 in ls:
            print(0)
            sys.exit()
print(dp[-1])
### BUGGY CODE ###

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

A=[0]*(10**5+1)
for i in range(10**5+1):
  A[i] = a.count(i)

sum_tmp = sum(a)
for i in range(q):
  b = bc[i][0]
  c = bc[i][1]
  A[c] += A[b]
  sum_tmp += (c-b) * A[b]
  A[b] = 0
  
  print(sum_tmp)

### FIXED CODE ###

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

A=[0]*(10**5+1)
for i in range(n):
  A[a[i]] += 1

sum_tmp = sum(a)
for i in range(q):
  b = bc[i][0]
  c = bc[i][1]
  A[c] += A[b]
  sum_tmp += (c-b) * A[b]
  A[b] = 0
  
  print(sum_tmp)
### BUGGY CODE ###

import itertools

N, X, Y = map(int, input().split())

pos = [i for i in range(1,N+1)]
ways = list(itertools.combinations(pos,2))

dist_l = []
for way in ways:
    i, j = way
    dists = [abs(i-j), abs(i - X) + 1 + abs(Y - j), abs(i - Y) + 1 + abs(X - j)]
    dist_l.append(min(dists))

for k in range(1,N):
    print(dist_l.count(k))

### FIXED CODE ###

import itertools
import collections

N, X, Y = map(int, input().split())

pos = [i for i in range(1,N+1)]
ways = list(itertools.combinations(pos,2))

dist_l = [min(abs(i-j), abs(i - X) + 1 + abs(Y - j)) for i,j in ways]

dic = collections.Counter(dist_l)
for i in range(1,N):
    print(dic[i])
### BUGGY CODE ###

n, s = map(int, input().split())
a = list(map(int, input().split()))
mod = 998244353

temp = [1] + [0] * s
for i in range(n):
    temp2 = [0] * (s + 1)
    for j in range(s + 1):
        temp2[j] += temp[j] * 2
        temp2[j] %= mod
    for j in range(s + 1 - a[i]):
        temp2[j + a[i]] += temp[j]
        temp2[j + a[i]] %= mod
    temp = temp2
print(temp[s])

### FIXED CODE ###

n, s = map(int, input().split())
a = list(map(int, input().split()))
mod = 998244353

temp = [1] + [0] * s
for i in range(n):
    temp2 = [0] * (s + 1)
    for j in range(s + 1):
        temp2[j] += temp[j] * 2
        temp2[j] %= mod
    for j in range(s + 1 - a[i]):
        temp2[j + a[i]] += temp[j]
        temp2[j + a[i]] %= mod
    temp = temp2
print(temp[s])
### BUGGY CODE ###

import numpy as np
N = int(input())
A = list(map(int, input().split()))
R = [0] * (N + 1)
P = [1] * (N + 1)
#R = np.zeros(N + 1, dtype=int)
#P = np.ones(N + 1, dtype=int)
mod = 10 ** 9 + 7

def rev(a):
    return pow(a, mod - 2, mod)
    
for n in range(N + 1):
    R[n] = (R[n - 1] + rev(n)) % mod
    if n != 0:
        P[n] = P[n - 1] * n
    
C = [(R[j] + R[N - j + 1] - 1) % mod for j in range(1, N + 1)]

print(sum([a * c for a, c in zip(C, A)]) * P[N] % mod)


### FIXED CODE ###

import numpy as np
N = int(input())
A = list(map(int, input().split()))
R = np.zeros(N + 1, dtype="int64")
P = np.ones(N + 1, dtype="int64")
mod = 10 ** 9 + 7

def rev(a):
    return pow(a, mod - 2, mod)
    
for n in range(N + 1):
    r = rev(n)
    R[n] = (R[n - 1] + r) % mod
    if n != 0:
        P[n] = (P[n - 1] * n) % mod

C = [(R[j] + R[N - j + 1] - 1) % mod for j in range(1, N + 1)]

res = 0
for i in range(N):
    res = (res + (A[i] * C[i]) % mod) % mod

print(res * P[N] % mod)
#print((sum([a * c % mod for a, c in zip(C, A)]) * P[N]) % mod)
### BUGGY CODE ###

k = int(input())

import math
from functools import reduce

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

Sum = 0
for l in range(k):
    for m in range(k):
        for n in range(k):
            Sum += gcd(l+1, m+1, n+1)
            
print(Sum)

### FIXED CODE ###


k = int(input())

import math
from functools import reduce

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

Sum = 0

# 一種類の数字が出てくるパターン
for i in range(k):
    Sum += gcd(i+1, i+1, i+1)

# 二種類の数字が出てくる場合 -> 各パターンは3通りあるはず
for i in range(k-1):
    for j in range(i+1, k):
        Sum += gcd(i+1, j+1, j+1)*3

# 二種類の数字が出てくる場合 
for i in range(k-1):
    for j in range(i+1, k):
        Sum += gcd(i+1, i+1, j+1)*3
        
# 三種類の数字が出てくる場合
for i in range(k-2):
    for j in range(i+1, k-1):
        for m in range(j+1, k):
            Sum += gcd(i+1, j+1, m+1)*6
            
print(Sum)
### BUGGY CODE ###

N = int(input()) + 1
NumberList = list()
for i in range(1,N):
    for j in range(1,N):
        for k in range(1,N):
            NumberList.append([i,j,k])

Answer = 0

def getGCD(abc):
    abc.sort(reverse=True)
    a = int(abc[0])
    b = int(abc[1])
    c = int(abc[2])
    surplus = b % c
    while surplus != 0:
        b = int(c)
        c = int(surplus)
        surplus = b % c
    surplus = a % c
    while surplus != 0:
        a = int(c)
        c = int(surplus)
        surplus = a % c
    return c

for abc in NumberList:
    Answer += getGCD(abc)
print(Answer)


### FIXED CODE ###

N = int(input()) + 1

Answer = 0

def getGCD(a,b,c):
    if a == b and b == c:
        d = 1
    elif a == b or b == c or c == a:
        d = 3
    else:
        d = 6
        
    surplus = a % c
    while surplus != 0:
        a = int(c)
        c = int(surplus)
        surplus = a % c
    surplus = b % c
    while surplus != 0:
        b = int(c)
        c = int(surplus)
        surplus = b % c
    return c * d


for i in range(1,N):
    for j in range(i,N):
        for k in range(j,N):
            Answer += getGCD(k,j,i)
            
print(Answer)
### BUGGY CODE ###

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

s = [0]
for i in range(n):
    s.append(sum(l[:i+1]))

s = [j%m for j in s]
s.sort()

ans = 0
while s:
    cnt = s.count(s[0])
    s = s[cnt:]
    ans += cnt*(cnt-1)//2

print(ans)

### FIXED CODE ###

from collections import Counter

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

s = [0]
for i in range(n):
    s.append((s[-1]+l[i])%m)

c = Counter(s)

ans = 0
for x in c.values():
    ans += x*(x-1)//2

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

def input_int():
    return map(int, input().split())

def one_int():
    return int(input())

def one_str():
    return input()

def many_int():
    return list(map(int, input().split()))

N=one_int()
S=one_str()

bit_count = S.count("1")
S_min = int(S,2) % (bit_count-1) if bit_count-1!=0 else 0
S_plu = int(S,2) % (bit_count+1)
S_num = int(S,2)



# calc_dict = {i:-1 for i in range(100000)}
# res_dict =  {i:-1 for i in range(2*(10**5))}

# for i in range(1, 100000):
#     if calc_dict[i]==-1:
#         calc_dict[i] = bin(i).count("1")

#     res_dict[i] = i%calc_dict[i]+1

def mods(temp, count):
    count+=1
    while temp!=0:

#         if temp in res_dict:
#             print(count, temp, res_dict[temp])
#             print("come")
#             print()
#             return count+res_dict[temp]
        
#         if calc_dict[temp]==-1:
        bits = bin(temp).count("1")
            
        temp = temp%bits
        count+=1

    return count

for i in range(N):
    if S[i]=="0":
        part = (2**(N-i-1))% (bit_count+1)
        num = (S_plu + part ) % (bit_count+1)
        print(mods(num, 0))
    else:
        if S_num == 2**(N-i-1):
            print(0)
            continue
        part = (2**(N-i-1))% (bit_count-1)
        num = (S_min - part)%(bit_count-1)
        print(mods(num, 0))




### FIXED CODE ###

def input_int():
    return map(int, input().split())

def one_int():
    return int(input())

def one_str():
    return input()

def many_int():
    return list(map(int, input().split()))

N=one_int()
S=one_str()

bit_count = S.count("1")
S_num = int(S,2)
S_min = S_num % (bit_count-1) if bit_count-1!=0 else 0
S_plu = S_num % (bit_count+1)




# calc_dict = {i:-1 for i in range(10000)}
# res_dict =  {i:-1 for i in range(10**4)}

# for i in range(1, 10000):
#     if calc_dict[i]==-1:
#         calc_dict[i] = bin(i).count("1")

#     res_dict[i] = i%calc_dict[i]+1

def mods(temp, count):
    count+=1
    if temp!=0:

#         if temp in res_dict:
#             return count+res_dict[temp]
        
#         if temp not in calc_dict:
#             calc_dict[temp]= bin(temp).count("1") 
        count = mods(temp%bin(temp).count("1") , count)

    return count

for i in range(N):
    if S[i]=="0":
        part = pow(2, (N-i-1), bit_count+1)
        num = (S_plu + part ) % (bit_count+1)
        print(mods(num, 0))
    else:
        if S_num == 2**(N-i-1):
            print(0)
            continue
        part = pow(2, (N-i-1), bit_count-1)
        num = (S_min - part)%(bit_count-1)
        print(mods(num, 0))
### BUGGY CODE ###

import numpy as np
# 初期入力
import sys
input = sys.stdin.readline
N,K = (int(i) for i in input().split())
A = list(map(int, input().split()))
#B =np.zeros(N)
A =np.array(A,dtype=np.int64)
#
l =0
r =N
for j in range(K):
    B =np.zeros(N,dtype=np.int64)
    for i in range(N):
        index =A[i]
        if i-index <0:
            l=0
        else:
            l =i -index
        if i +index >N:
            r =N 
        else:
            r =i +index +1
        B[l:r] +=1 
        if np.all(B >=N):
            print(*B)
            sys.exit(0)
    A =B
    
print(*B)
        

### FIXED CODE ###

# imos法
# 長さNの1次元配列において、「ある連続する区間に、ある数vを足す」という操作をK回繰り返した結果を高速で求める
# 
    
# 初期入力
    
import sys
input = sys.stdin.readline
N,K = (int(i) for i in input().split())
A = list(map(int, input().split()))
    
    
l =0
r =N
cumulative_sum =[0]*N
#操作数が電球の数より多いとき
if N <=K:
    A=[N]*N
# imos法
else:
    for j in range(K):
        B =[0]*(N+1)
        for i in range(N):
            index =A[i]
            if i-index <0:
                l=0
            else:
                l =i -index
            if i +index +1 >=N:
                r =N 
            else:
                r =i +index +1
            B[l] +=1 
            B[r] -=1
        #累積和(imos法) 
        from itertools import accumulate
        del B[-1]
        A =list(accumulate(B))
        if sum(A) ==N*N:
            print(*A)
            sys.exit(0)
    
print(*A)
### BUGGY CODE ###

s=input()
n=len(s)
k=int(input())
l=[]
for i in range(n):
  for j in range(i,n):
    a=s[i:j+1]
    l.append(a)
l=set(l)
l=list(l)
l.sort()
print(l[k-1])

### FIXED CODE ###

s=input()
n=len(s)
k=int(input())
l=[]
for i in range(n):
  for j in range(i,i+k+1):
    a=s[i:j+1]
    l.append(a)
l=set(l)
l=list(l)
l.sort()
print(l[k-1])