q="D"
if q=="A":
	S=input()
	print(sum((i=="+")-(i=="-")for i in S))
if q=="B":
	a=int(input())
	b=sum(int(i) for i in str(a))
	print("Yes" if a%b==0 else "No")
if q=="C":
	N,K=map(int,input().split())
	A=[int(i) for i in input().split()]
	minindex=A.index(min(A))
	cl=minindex
	cr=N-minindex-1
	func=lambda a,b:int(a/b) if a%b==0 else int(a/b+1)
	print(func(cl,K-1)+func(cr,K-1))
if q=="D":
	K=int(input())
	S=lambda x:sum(int(i) for i in str(x))
	#for i in range(1,110):
	r=0
	for i in range(1,10**15):
		a=i
		b=int(K/10)*10+9
		if a/S(a)<=b/S(b):
			print(a)
			r+=1
			if r==K:
				break