CF101A Homework

Description

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.

Input Format

N/A

Output Format

N/A

Explanation/Hint

In the first sample the string consists of five identical letters but you are only allowed to delete 4 of them so that there was at least one letter left. Thus, the right answer is 1 and any string consisting of characters "a" from 1 to 5 in length. In the second sample you are allowed to delete 4 characters. You cannot delete all the characters, because the string has length equal to 7. However, you can delete all characters apart from "a" (as they are no more than four), which will result in the "aaaa" string. In the third sample you are given a line whose length is equal to 8, and $ k=10 $ , so that the whole line can be deleted. The correct answer is 0 and an empty string.