Once when Gerald studied in the first year at school, his teacher gave the class the following homework. She offered the students a string consisting of *n* small Latin letters; the task was to learn the way the letters that the string contains are written. However, as Gerald is too lazy, he has no desire whatsoever to learn those letters. That's why he decided to lose some part of the string (not necessarily a connected part). The lost part can consist of any number of segments of any length, at any distance from each other. However, Gerald knows that if he loses more than *k* characters, it will be very suspicious. 

Find the least number of distinct characters that can remain in the string after no more than *k* characters are deleted. You also have to find any possible way to delete the characters.
The first input data line contains a string whose length is equal to *n* (1 ≤ *n* ≤ 10<sup class="upper-index">5</sup>). The string consists of lowercase Latin letters. The second line contains the number *k* (0 ≤ *k* ≤ 10<sup class="upper-index">5</sup>).
aaaaa
4
1
aaaaa
abacaba
4
1
aaaa
abcdefgh
10
0
aaaaaaaaaaaaaaaaaaaa
19
1
aaaaaaaaaaaaaaaaaaaa
abcdefghijjihgedcba
0
10
abcdefghijjihgedcba
aababcabcdabcde
9
2
aabababab
xyzuvwxyz
4
3
xyzxyz
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
99
1
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
0
1
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
abcdefghijklmnopqrstuvwxyz
17
9
rstuvwxyz
abcdefghijklmnopqrstuvwxyz
0
26
abcdefghijklmnopqrstuvwxyz
abcdefghijklmnopqrsttsrqponmlkjihgfedcba
0
20
abcdefghijklmnopqrsttsrqponmlkjihgfedcba
aaaaaaaaaaaaaaaaaaaaaeeeeeeeeeeeeeeeeeeee
20
1
aaaaaaaaaaaaaaaaaaaaa
xyxjvqrbehasypiekxwjhurlrnegtkiplbogkgxwubzhlyvjwj
24
8
xyxjrhykxwjhrlrklkxwhlyjwj
clpdaxnimfkubdxtpjwtjkqh
21
2
xxtt
jeliuewohkqtghdneuuhcputwiddnmkbhhnlxxbfjunhcd
50
0
zgwmpjfeiwtfagp
62
0
halasouqgfxfcrwhqgllaqiphaxekljz
87
0
zimxucbrzojfqvizcopkplrpnvihveqpgvzszkubftoozrydxijokjxfhdfjracjonqupmnhadtsotxrxmwgno
51
7
zxrzojvzopprpvvpvzzoozrxjojxjrjopoxrxo
geovcaxzjyhxbpnbkbsxfpkyofopxquzzxeigdflfumisevzsjdywehxconimkkbvjyxbqlnmaphvnngcjqoefqkfzmiruubbcmv
24
16
eovxzjyxbpnbkbxfpkyofopxquzzxeiffumievzjyexonimkkbvjyxbqnmpvnnjqoefqkfzmiuubbmv
jsreqtehsewsiwzqbpniwuhbgcrrkxlgbhuobphjigfuinffvvatrcxnzbcxjazrrxyiwxncuiifzndpvqahwpdfo
67
4
rwiwiwrrxiirxxrrxiwxiiw
uwvkcydkhbmbqyfjuryqnxcxhoanwnjubuvpgfipdeserodhh
65
0
xclfxmeqhfjwurwmazpysafoxepb
26
1
xxx
hlhugwawagrnpojcmzfiqtffrzuqfovcmxnfqukgzxilglfbtsqgtsweblymqrdskcxjtuytodzujgtivkmiktvskvoqpegoiw
27
15
lugwwgomzfiqtffzuqfovmxfqukgzxilglftsqgtswlmqskxtutozugtivkmiktvskvoqgoiw
cky
79
0
oodcvb
16
0
lfbfwdoeggorzdsxqnpophbcjcatphjsewamrgzjszf
20
8
ffwoggozspopjpjswgzjszf
ksnizygvqy
42
0
myenljgyxkwcfyzjcpffsucstschcevbzh
44
0
yumufcicodkpuhvifnvi
36
0
fntrmjfquczybyjllywsqwllsxdmqynmyfcqhakftitvvfbxtqktbfsvvvanjbkqubyxu
63
1
yyyyyy
smiclwubkoobnapkkletsnbbsvihqbvikochzteaewjonkzvsqrbjkywsfcvczwretmhscowapcraof
45
6
scwbkoobkksbbsbkocwoksbkwsccwscowco
lwkjydpagifuvbhifryskegmzuexfksazfurlsnzfrgvuxcazitfchimmvomdnbdirzccstmuvlpghwskinayvucodiwn
16
17
lwkydagifuvifryskgmzufksazfurlsnzfrgvucazifcimmvmdndirzccsmuvlgwskinayvucdiwn
a
0
1
a
bbb
100000
0
aa
2
0
a
1
0
aaaa
4
0
from collections import Counter

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

if k >= len(s):
    print(0)
    print()
    exit()

cnt = Counter(s)

for _ in range(k):
    minimum = min(cnt, key=cnt.get)
    cnt[minimum] -= 1
    if cnt[minimum] == 0:
        del cnt[minimum]

print(len(cnt))
for char in s:
    if char in cnt:
        print(char, end="")
print()
