CF1328B K-th Beautiful String
Description
For the given integer $ n $ ( $ n > 2 $ ) let's write down all the strings of length $ n $ which contain $ n-2 $ letters 'a' and two letters 'b' in lexicographical (alphabetical) order.
Recall that the string $ s $ of length $ n $ is lexicographically less than string $ t $ of length $ n $ , if there exists such $ i $ ( $ 1 \le i \le n $ ), that $ s_i < t_i $ , and for any $ j $ ( $ 1 \le j < i $ ) $ s_j = t_j $ . The lexicographic comparison of strings is implemented by the operator < in modern programming languages.
For example, if $ n=5 $ the strings are (the order does matter):
1. aaabb
2. aabab
3. aabba
4. abaab
5. ababa
6. abbaa
7. baaab
8. baaba
9. babaa
10. bbaaa
It is easy to show that such a list of strings will contain exactly $ \frac{n \cdot (n-1)}{2} $ strings.
You are given $ n $ ( $ n > 2 $ ) and $ k $ ( $ 1 \le k \le \frac{n \cdot (n-1)}{2} $ ). Print the $ k $ -th string from the list.
Input Format
N/A
Output Format
N/A