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

n = int(input())

def f(a, b):
    x = max(a, b)
    return len(str(x))

results = []

for i in range(1, n + 1):
    if n % i == 0:
        a = i
        b = n / i
    result = f(a, b)
    results.append(result)

print(min(results))

### FIXED CODE ###

n = int(input())

def f(a, b):
    x = int(max(a, b))
    return len(str(x))

results = []

for i in range(1, int(n ** (1/2)) + 1):
    if n % i == 0:
        a = i
        b = n / i
    result = f(a, b)
    results.append(result)

print(min(results))
### BUGGY CODE ###

from collections import Counter 
def anagram(input1, input2): 
    return Counter(input1) == Counter(input2) 
n=int(input())
val=0
l=[]
for i in range(n):
    s=input()
    l.append(s)
for j in range(len(l)):
    for k in range(j+1,len(l)):
        if anagram(l[j],l[k]):
            val+=1
print(val)      
        

### FIXED CODE ###

from collections import Counter  
n=int(input())
val=0
l=[]
for i in range(n):
    s=input()
    s=sorted(s)
    l.append("".join(s))
for i in Counter(l).values():
    val+=(i*(i-1))//2
print(val)
### BUGGY CODE ###

[n,k] = [int(i) for i in input().split()]
p = [int(i) for i in input().split()]
ls = [0]
ex = [0]
mx = 1001
for i in range(1,mx):
    ls.append(i + ls[i-1])
for i in range(1,mx):
    ex.append(ls[i]/i)
a = []
for i in range(n):
    a.append(ex[p[i]])
#print(a)
ans = -1
for i in range(n-k+1):
    ans = max(ans,sum(a[i:i+k]))
print(ans)


### FIXED CODE ###

[n,k] = [int(i) for i in input().split()]
p = [(int(i)+1)/2 for i in input().split()]
sm_l = [0]
#sm_r = [0]
for i in range(n):
	sm_l.append(sm_l[-1] + p[i])
	#sm_r.append(sm_r[-1] + p[-i-1])
ans = 0
for i in range(n-k+1):
	ans = max(ans,sm_l[i+k]-sm_l[i])
print(ans)
### BUGGY CODE ###

S=input()
Q=int(input())
for q in range(Q):
    Query=list(input().split())
    T=Query[0]
    if T=="1":
        S=S[::-1]
    if T=="2":
        F,C=Query[1],Query[2]
        if F=="1":
            S=C+S
        if F=="2":
            S=S+C
print(S)

### FIXED CODE ###

from collections import deque
S=deque(input())
Q=int(input())
reverse=0
for q in range(Q):
    Query=list(input().split())
    T=Query[0]
    if T=="1":
        reverse+=1
    if T=="2":
        F,C=Query[1],Query[2]
        if F=="1" and reverse%2==0 or F=="2" and reverse%2==1:
            S.appendleft(C)
        else:
            S.append(C)
S="".join(S)
print(S if reverse%2==0 else S[::-1])
### BUGGY CODE ###

A, B = map(int,input().split())
D = 2
ans = 1
A_l = []
B_l = []
while True:
    if A % D == 0:
        while True:
            if A % D != 0:
                break
            A //= D
        A_l.append(D)
    if B % D == 0:
        while True:
            if B % D != 0:
                break
            B //= D
        B_l.append(D)
    if A == B == 1:
        break
    D += 1
for a in A_l:
    if a in B_l:
        ans += 1
print(ans)


### FIXED CODE ###

A, B = map(int,input().split())
D = 2
ans = 1
A_l = []
B_l = []
MAX = max(A, B)
q_MAX = int(MAX ** (1/2))
for i in range(2, q_MAX+1):
    if A % D == 0:
        while True:
            if A % D != 0:
                break
            A //= D
        A_l.append(D)
    if B % D == 0:
        while True:
            if B % D != 0:
                break
            B //= D
        B_l.append(D)
    if i == q_MAX:
        A_l.append(A)
        B_l.append(B)
    if A == B == 1:
        break
    D += 1
for a in A_l:
    if a in B_l:
        ans += 1
print(ans)
### BUGGY CODE ###

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

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

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

cSum = sum(cList)
p = dict()
c = dict()

for i in range(n):
    p[i] = pList[i]
    c[i] = cList[i]

highScore = min(cList)
for i in range(n):
    count = 0
    zahyou = i
    score = 0
    zumi =set()
    loop = False
    while count < k:
        if not(loop):
            if zahyou in zumi:
                loop = True
                if score > 0:
                    score += score * ((k // count) - 2)
                    count += ((k // count) - 2) * count
                else:
                    break
        zumi.add(zahyou)
        zahyou = p[zahyou] - 1
        score += c[zahyou]
        count += 1
        if highScore < score:
            highScore = score

print(highScore)

### FIXED CODE ###

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

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

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

cSum = sum(cList)
p = dict()
c = dict()

for i in range(n):
    p[i] = pList[i]
    c[i] = cList[i]

highScore = min(cList)
for i in range(n):
    count = 0
    zahyou = i
    score = 0
    zumi =zahyou
    loop = False
    while count < k:
        if not(loop):
            if zahyou == zumi and count != 0:
                loop = True
                if score > 0:
                    score += score * ((k // count) - 2)
                    count += ((k // count) - 2) * count
                else:
                    break
        zahyou = p[zahyou] - 1
        score += c[zahyou]
        count += 1
        if highScore < score:
            highScore = score

print(highScore)
### BUGGY CODE ###

import numpy as np
n = int(input())
a = np.array(range(1,n+1))
b = np.array([a[(i+1)%n] for i in range(n)])
print(sum(a%b))

### FIXED CODE ###

import numpy as np
n = int(input())
print(n*(n-1)//2)
### BUGGY CODE ###

N, u, v = map(int, input().split())
u, v = u-1, v-1
adjL = [set() for _ in range(N)]
for _ in range(N-1):
    A, B = map(int, input().split())
    A, B = A-1, B-1
    adjL[A].add(B)
    adjL[B].add(A)

ans = 0
v1s = set([u])
v2s = set([v])
useds = [False] * N
useds[v] = True
while True:
    vs = set()
    for v1 in v1s:
        vs |= adjL[v1]
    v1s = vs
    v1s -= v2s
    if not v1s: break

    ans += 1
    vs = set()
    for v2 in v2s:
        vs |= adjL[v2]
    v2s = set([v for v in vs if not useds[v]])
    for v2 in v2s:
        useds[v2] = True
    v1s -= v2s
    if not v1s: break

print(ans)


### FIXED CODE ###

INF = float('inf')

N, u, v = map(int, input().split())
u, v = u-1, v-1
adjL = [[] for _ in range(N)]
for _ in range(N-1):
    A, B = map(int, input().split())
    A, B = A-1, B-1
    adjL[A].append(B)
    adjL[B].append(A)

def bfsMinCosts(adjList, vSt, INF):
    numV = len(adjList)
    costs = [INF] * numV
    costs[vSt] = cost = 0
    vs = [vSt]
    while vs:
        cost += 1
        v2s = []
        for v in vs:
            for v2 in adjList[v]:
                if costs[v2] == INF:
                    costs[v2] = cost
                    v2s.append(v2)
        vs = v2s
    return costs

costUs = bfsMinCosts(adjL, u, INF)
costVs = bfsMinCosts(adjL, v, INF)

maxC = -1
vMaxC = -1
for v, (costU, costV) in enumerate(zip(costUs, costVs)):
    if costU >= costV: continue
    if costV > maxC:
        maxC = costV
        vMaxC = v

print(maxC-1)
### BUGGY CODE ###

n=int(input())
a=list(map(int,input().split()))
b=[0]*(max(a)-min(a)+1)
for i in range(n):
  b[a[i]-min(a)]+=1

def cc(x):
  return x*(x-1)//2

l=len(b)
sum=0

for i in range(l):
  sum+=cc(b[i])
  
for i in range(n):
  k=b[a[i]-min(a)]
  if k<=1:
    print(sum)
  else:
    print(sum-cc(k)+cc(k-1))

### FIXED CODE ###

N = int(input())
K = list(map(int, input().split()))
C = [0]*(N+1)
for k in K:
    C[k] += 1
Sc = 0
for c in C:
    Sc += c*(c-1)//2
for k in K:
    print(Sc-(C[k]-1))
### BUGGY CODE ###

import sys
input = sys.stdin.readline

N = int(input())
edge = [[] for _ in range(N)]
sum_w = 0
for i in range(N-1):
    u, v, w = map(int, input().split())
    edge[u-1].append([v-1,w])
    edge[v-1].append([u-1,w])
    sum_w += w

dist = [sum_w]*N
rest = [i for i in range(N)]

is_finish = False
dist[0] = 0
while len(rest) > 0:
    min_dist = sum_w+1
    min_ptr = -1
    for i in rest:
        if dist[i] < min_dist:
            min_dist = dist[i]
            min_ptr = i
    rest.remove(min_ptr)
    for i in edge[min_ptr]:
        if i[0] in rest:
            if i[0] < min_ptr:
                dist[i[0]] = dist[min_ptr] + i[1]
            elif i[0] > min_ptr:
                dist[i[0]] = dist[min_ptr] + i[1]
for item in dist:
    print(item%2)

### FIXED CODE ###

import sys
input = sys.stdin.readline

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

dist = [None]*N
dist[0] = 0
comp = [0]*N
next_ptr = [0]
for ptr in next_ptr:
    comp[ptr] = 1
    edges = tree[ptr]
    for edge in edges:
        if comp[edge[0]] == 0:
            dist[edge[0]] = dist[ptr] + edge[1]
            next_ptr.append(edge[0])

for item in dist:
    print(item%2)
### BUGGY CODE ###

N, Q = map(int,input().split())
S = input()
field = {s:[] for s in S}
golem = [1 for i in range(N)]
for i in range(N):
    field[S[i]].append(i)
del_num = 0
for i in range(Q):
    t, d = input().split()
    div = 1 if d == "R" else -1
    if not t in field:
        continue
    for f in field[t]:

        if golem[f] >0:
            if f + div >= 0 and f + div < N:
                golem[f+div] += golem[f]
            golem[f] = 0
print(sum(golem))

### FIXED CODE ###

def sim(i):
    for t, d in qs:
        if S[i] == t:
            div = 1 if d == "R" else -1
            i += div
            if i == 0:
                return 0
            elif i == N+1:
                return N+1
    return i

def bin_search_left():
    ok = 0
    ng = N+1

    while abs(ok-ng)>1:
        mid = (ok+ng) //2
        res = sim(mid)
        #print(ok,ng,mid,res)
        if res == 0:
            ok = mid
        if res >0:
            ng = mid
    return ok


def bin_search_right():
    ng = 0
    ok = N+1

    while abs(ok-ng)>1:
        mid = (ok+ng) //2
        res = sim(mid)
        #print(ok,ng,mid,res)
        if res < N+1:
            ng = mid
        if res >= N+1:
            ok = mid
    return ok


N, Q = map(int,input().split())
S = "0"+input()+"0"
qs = []
for _ in range(Q):
    t, d = input().split()
    qs.append((t,d))

L = bin_search_left()
R = bin_search_right()
print(N-L-(N+1-R))
### BUGGY CODE ###

def D():
    nxy=list(map(int,input().split()))
    len_list=[]
    len_count=0
    
    for i in range(1,nxy[0]+1):
        for j in range(1,nxy[0]+1):
            if i<j: len_list.append(min(abs(j-i),abs(nxy[1]-i)+1+abs(j-nxy[2])))
                
    
    for k in range(1,nxy[0]):
        for i in len_list:
             if k==i: len_count+=1
                
        print(len_count)
        len_count=0
        
    
if __name__=='__main__':
    D()

### FIXED CODE ###

def D():
    nxy=list(map(int,input().split()))
    count_list=[0]*nxy[0]
    
    for i in range(1,nxy[0]):
        for j in range(i+1,nxy[0]+1):
            mins=min(abs(j-i),abs(nxy[1]-i)+1+abs(j-nxy[2]))
            count_list[mins]+=1
            
    for i in range(1,nxy[0]):
        print(count_list[i])
            
        
if __name__=='__main__':
    D()
### BUGGY CODE ###

import math
def parent(i):
    return math.floor(i / 2)

def get_largest(i):
    global SIZE
    l = i << 1
    r = l + 1
    largest = None
    if l <= SIZE and A[i] < A[l]:
        largest = l
    else:
        largest = i
    if r <= SIZE and A[largest] < A[r]:
        largest = r
    return largest


def max_heapify(i):
    largest = get_largest(i)
    x = i
    while largest is not x:
        tmp = A[x]
        A[x] = A[largest]
        A[largest] = tmp
        x = largest
        largest = get_largest(x)

def extract():
    global SIZE
    m = A[1]
    A[1] = A[SIZE]
    SIZE -= 1
    max_heapify(1)
    return m

def increase_key(i, key):
    if key < A[i]:
        raise NameError('key is less than A[i]')
    A[i] = key
    while 1 < i and A[parent(i)] < A[i]:
        tmp = A[i]
        A[i] = A[parent(i)]
        A[parent(i)] = tmp
        i = parent(i)

def insert_key(key):
    global SIZE
    SIZE += 1
    A.append(None)
    A[SIZE] = -1
    increase_key(SIZE, key)

inp = input()
A = [None]
SIZE = 0

loop =  inp[0:2] is not 'en'

while loop:
    if inp == 'end':
        break
    elif inp[0] == 'e':
        print(extract())
    elif inp[0] == 'i':
        insert_key(int(inp[7:]))
    inp = input()

### FIXED CODE ###

import math
import heapq

A = []
inp = input()
while True:
    if inp == 'end':
        break
    elif inp[0] == 'e':
        print(-heapq.heappop(A))
    elif inp[0] == 'i':
        heapq.heappush(A, -int(inp[7:]))
    inp = input()
### BUGGY CODE ###

N, M, K = map(int, input().split())
mod = 998244353

facs = [1]        
nfac = 1
for i in range(1, N):
    nfac = nfac * i %mod
    facs.append(nfac)

s = 0
for i in range(0, K+1):
    patterns = facs[N-1] * pow(facs[i], mod-2, mod) * pow(facs[N-1-i], mod-2, mod) % mod
    d = patterns * M * pow(M-1, N-1-i, mod) % mod
    s = (s + d) % mod

print(s % mod)

### FIXED CODE ###

N, M, K = map(int, input().split())
mod = 998244353

facs = [1] * N
invs = [1] * N
nfac = 1
for i in range(1, N):
    nfac = nfac * i % mod
    facs[i] = nfac
    invs[i] = pow(facs[i], mod-2, mod)

s = 0
for i in range(K+1):
    d = facs[N-1] * invs[i] * invs[N-1-i] \
        * M * pow(M-1, N-1-i, mod) % mod
    s = (s + d) % mod

print(s)
### BUGGY CODE ###

def main():
    s = []
    for i in reversed(input()):
        if i == "?":
            s.append(None)
        else:
            s.append(int(i))
    mod = 10**9+7
    memo = [0 for _ in [0]*13]
    m13 = [(10**i) % 13 for i in range(12)]
    memo[0] = 1
    for k, i in enumerate(s):
        memo2 = [0 for _ in [0]*13]
        a = m13[k % 12]
        if i == None:
            for l in [(a*j) % 13 for j in range(10)]:
                for j in range(13):
                    memo2[(l+j) % 13] += memo[j]
        else:
            l = a*i
            memo2 = memo[(-l) % 13:]+memo[:(-l) % 13]
        memo = [j % mod for j in memo2]
    print(memo[5])


main()


### FIXED CODE ###

s=list(reversed(input()))
mod=10**9+7
memo=[0 for _ in [0]*13]
m13=[(10**i)%13 for i in range(12)]
memo[0]=1
for i in range(len(s)):
    memo2=[0 for _ in [0]*13]
    a=m13[i%12]
    if s[i]=="?":
        list_=[0,1,2,3,4,5,6,7,8,9]
    else:
        list_=[int(s[i])]
    list_=[(a*j)%13 for j in list_]
    for l in list_:
        for j in range(13):
            memo2[(l+j)%13]+=memo[j]
    memo=[j%mod for j in memo2]
print(memo[5])
### BUGGY CODE ###

N = int(input())
L = list(map(int, input().split()))
L.sort()
ans = 0

for i in range(N):
    a = L[i]
    for j in range(i+1, N-1):
        b = L[j]
        l = L[j+1:]
        ans += sum(c < (a+b) for c in l)

print(ans)

### FIXED CODE ###

N = int(input())
L = list(map(int, input().split()))
L.sort()
ans = 0

from bisect import bisect_left
for i in range(N):
    for j in range(i+1, N):
        ab = L[i] + L[j]
        index = bisect_left(L, ab)
        num = index - j - 1
        ans += max(0, num)

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


ans = 1
n = int(input())
arr = list(map(int , input().split()))
for i in range(n):
	ans*=arr[i]
if ans > 10**18:
	print(-1)
else:
	print(ans)



### FIXED CODE ###

ans = 1
n = int(input())
arr = sorted(list(map(int , input().split())))
f  = 1
for i in range(n):
	ans*=arr[i]
	#print(ans)
	if ans > 10**18:
		f = 0
		break
#print(ans)
if f: print(ans)
else: print(-1)
### BUGGY CODE ###

from collections import defaultdict
N = int(input())
A = list(map(int, input().split()))
D = defaultdict(int)
for a in A:
  D[a] += 1
Q = int(input())
B = []
C = []
for _ in range(Q):
  l = list(map(int, input().split()))
  B.append(l[0])
  C.append(l[1])

for i in range(Q):
  k = D[B[i]]
  D[B[i]] = 0
  D[C[i]] += k
  ans = 0
  for k, v in D.items():
    ans += k * v
  print(ans)

### FIXED CODE ###

from collections import defaultdict
N = int(input())
A = list(map(int, input().split()))
D = defaultdict(int)
for a in A:
  D[a] += 1
Q = int(input())
B = []
C = []
for _ in range(Q):
  l = list(map(int, input().split()))
  B.append(l[0])
  C.append(l[1])

ans = sum(A)
for i in range(Q):
  k = D[B[i]]
  D[B[i]] = 0
  D[C[i]] += k
  ans = ans - (B[i]*k) + (C[i]*k)
  print(ans)
### BUGGY CODE ###

n, m = map(int, input().split())
ans = []
if m == 1:
    l, r = map(int, input().split())
    print(r-l+1)
else:
    for i in range(m):
        l, r = map(int, input().split())
        ans += [x for x in range(l, r+1)]

    ans = [x for x in set(ans) if ans.count(x) >= m]
    print(len(ans))


### FIXED CODE ###

n, m = map(int, input().split())
l, r = map(int, input().split())
ans = -1
if m > 1:
    for i in range(m-1):
        _l, _r = map(int, input().split())
        if (l < _l <= r):
            l = _l
        if (l <= _r < r):
            r = _r
        if _r < l or r < _l:
            ans = 0
            print(ans)
            break

if ans == -1:
    print(r-l+1)
### BUGGY CODE ###

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

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

tel_list = []

next_city = 0

city_have_been_to = set([0])

way = [0]

while k > 0:
    k -= 1
    temp = city_have_been_to.copy()

    next_city = a[next_city] - 1
    city_have_been_to.add(next_city)
    way.append(next_city)

    if temp == city_have_been_to:
        break

if k == 0:
    print(way[-1] + 1)
else:
    temp_index = way.index(next_city)
    print(way[temp_index:-1][k % len(way[temp_index:-1])] + 1)


### FIXED CODE ###

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

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

tel_list = []

next_city = 0

city_have_been_to = set([0])

way = [0]

while k > 0:
    k -= 1
    temp = len(city_have_been_to)

    next_city = a[next_city] - 1
    city_have_been_to.add(next_city)
    way.append(next_city)

    if temp == len(city_have_been_to):
        break

if k == 0:
    print(way[-1] + 1)
else:
    temp_index = way.index(next_city)
    print(way[temp_index:-1][k % len(way[temp_index:-1])] + 1)
### BUGGY CODE ###

import sys
sys.setrecursionlimit(10**6)
n,q = map(int,input().split())
graph = [[] for _ in range(n)]
cnt = [0] * n

for i in range(n-1):
    a,b = map(int,input().split())
    a -= 1
    b -= 1
    graph[a].append(b)
    graph[b].append(a)
    
for i in range(q):
    p,x = map(int,input().split())
    cnt[p-1] += x

def bfs(parent,current):
    if not graph[parent]:
        return
    if not (parent == 0 and current == 0):
        cnt[current] += cnt[parent]

    for child in graph[current]:
        bfs(current,child)

bfs(0,0)
print(*cnt)



### FIXED CODE ###

from collections import deque
n,q = map(int,input().split())
graph = [[] for _ in range(n)]
cnt = [0] * n
already = [False] * n

for i in range(n-1):
    a,b = map(int,input().split())
    a -= 1
    b -= 1
    graph[a].append(b)
    graph[b].append(a)
    
for i in range(q):
    p,x = map(int,input().split())
    cnt[p-1] += x
wait_q = deque()
wait_q.append(0)

while len(wait_q) > 0:
    parent = wait_q.popleft()
    for child in graph[parent]:
        if child == 0:continue
        if already[child] == True:continue
        already[child] = True
        cnt[child] += cnt[parent]
        wait_q.append(child)
print(*cnt)
### BUGGY CODE ###

import numpy as np
import sys
input = sys.stdin.readline
h, w, d = map(int, input().split())
num = h * w
mass = np.array([[0, 0] for _ in range(num + 1)])
mp = np.zeros(num+1, dtype=int)
for i in range(h):
    for j, a in enumerate(map(int, input().split())):
        mass[a] = [i, j]
for i in range(d+1, num+1):
    mp[i] = mp[i-d] + np.sum(abs(mass[i]-mass[i-d]))
q = int(input())
for _ in range(q):
    l, r = map(int, input().split())
    print(mp[r]-mp[l])


### FIXED CODE ###

import sys
input = sys.stdin.readline
h, w, d = map(int, input().split())
num = h * w
x = [0] * (num + 1)
y = [0] * (num + 1)
mp = [0] * (num + 1)
for i in range(h):
    for j, a in enumerate(map(int, input().split())):
        x[a], y[a] = [i+1, j+1]
for i in range(d+1, num+1):
    mp[i] = mp[i-d] + abs(x[i] - x[i-d]) + abs(y[i] - y[i-d])
q = int(input())
for _ in range(q):
    l, r = map(int, input().split())
    print(mp[r]-mp[l])
### BUGGY CODE ###

def primes(n):
    sieve = [True] * n
    for i in range(3, int(n ** 0.5) + 1, 2):
        if sieve[i]:
            sieve[i * i::2 * i] = [False] * (int((n - i * i - 1) / (2 * i)) + 1)
    return [2] + [i for i in range(3, n, 2) if sieve[i]]


q = int(input())
array = [[int(x) for x in input().split()] for z in range(q)]

primes_array = primes(10000)

for l, r in array:
    res = 0
    for num in range(l, r + 1):
        if num % 2 == 0:
            continue
        if num in primes_array and (num + 1) // 2 in primes_array:
            res += 1
    print(res)

### FIXED CODE ###

import math
import bisect


def is_prime(x):
    if x < 2: return False # 2未満に素数はない
    if x == 2 or x == 3 or x == 5: return True # 2,3,5は素数
    if x % 2 == 0 or x % 3 == 0 or x % 5 == 0: return False # 2,3,5の倍数は合成数

    # ためし割り: 疑似素数(2でも3でも5でも割り切れない数字)で次々に割っていく
    prime = 7
    step = 4
    while prime <= math.sqrt(x):
        if x % prime == 0: return False

        prime += step
        step = 6 - step

    return True


if __name__ == '__main__':
    q = int(input())
    array = [[int(x) for x in input().split()] for x in range(q)]
    nearby_2017 = [x for x in range(1, 100000, 2) if is_prime(x) and is_prime((x+1)/2)]
    for i, j in array:
        print(bisect.bisect_right(nearby_2017, j) - bisect.bisect_left(nearby_2017, i))
### BUGGY CODE ###

MOD = 998244353
k, n = map(int, input().split())

list_size = 5000

f_list = [1] * list_size
f_r_list = [1] * list_size

for i in range(list_size - 1):
	f_list[i + 1] = int((f_list[i] * (i + 2)) % MOD)

def power(n, x):
	if x == 1:
		return n
	elif x % 2 == 0:
		return power(int((n * n) % MOD), int(x / 2))
	else:
		return int((n * power(n, x - 1)) % MOD)

f_r_list[-1] = power(f_list[-1], MOD - 2)

for i in range(2, list_size + 1):
	f_r_list[-i] = int((f_r_list[-i + 1] * (list_size + 2 - i)) % MOD)

def comb(n, r):
	if n < r or r < 0:
		return 0
	elif n == 0 or r == 0 or n == r:
		return 1
	else:
		return (((f_list[n - 1] * f_r_list[n - r - 1]) % MOD) * f_r_list[r - 1]) % MOD 

ans = []
for i in range(2, k+2):
	num = 0
	if i%2 == 1:
		for j in range(0, i//2+1):
			#num += comb(i//2, j) * comb(n-1, j-1) * pow(2, j, MOD) * comb(n+k-i-j, k-i)
			num += comb(i//2, j) * pow(2, j, MOD) * comb(n+k-i, k-i+j)
			num %= MOD
	else:
		for j in range(0, i//2):
			#num += comb(i//2-1, j) * comb(n-1, j-1) * pow(2, j, MOD) * comb(n+k-i-j, k-i)
			num += comb(i//2-1, j) * pow(2, j, MOD) * comb(n+k-i, k-i+j)
			#num += comb(i//2-1, j) * comb(n-2, j-1) * pow(2, j, MOD) * comb(n+k-i-j-1, k-i)
			num += comb(i//2-1, j) * pow(2, j, MOD) * comb(n+k-i-1, k-i+j)
			num %= MOD
	ans.append(num)

print(*ans, sep="\n")
ans = reversed(ans[:k-1])
print(*ans, sep="\n")

### FIXED CODE ###

MOD = 998244353
k, n = map(int, input().split())

list_size = 5000

f_list = [1] * list_size
f_r_list = [1] * list_size

for i in range(list_size - 1):
	f_list[i + 1] = int((f_list[i] * (i + 2)) % MOD)

def power(n, x):
	if x == 1:
		return n
	elif x % 2 == 0:
		return power(int((n * n) % MOD), int(x / 2))
	else:
		return int((n * power(n, x - 1)) % MOD)

f_r_list[-1] = power(f_list[-1], MOD - 2)

for i in range(2, list_size + 1):
	f_r_list[-i] = int((f_r_list[-i + 1] * (list_size + 2 - i)) % MOD)

def comb(n, r):
	if n < r or r < 0:
		return 0
	elif n == 0 or r == 0 or n == r:
		return 1
	else:
		return (((f_list[n - 1] * f_r_list[n - r - 1]) % MOD) * f_r_list[r - 1]) % MOD 

ans = []
for i in range(2, k+2):
	num = 0
	if i%2 == 1:
		for j in range(0, i//2+1):
			#num += comb(i//2, j) * comb(n-1, j-1) * pow(2, j, MOD) * comb(n+k-i-j, k-i)
			num += comb(i//2, j) * pow(2, j, MOD) * comb(n+k-i, k-i+j)
			num %= MOD
	else:
		for j in range(0, i//2):
			#num += comb(i//2-1, j) * comb(n-1, j-1) * pow(2, j, MOD) * comb(n+k-i-j, k-i)
			num += comb(i//2-1, j) * pow(2, j, MOD) * comb(n+k-i, k-i+j)
			#num += comb(i//2-1, j) * comb(n-2, j-1) * pow(2, j, MOD) * comb(n+k-i-j-1, k-i)
			num += comb(i//2-1, j) * pow(2, j, MOD) * comb(n+k-i-1, k-i+j)
			num %= MOD
	ans.append(num)

print(*ans, sep="\n")
ans = reversed(ans[:k-1])
print(*ans, sep="\n")