P25667 [AtCoder] aab aba baa
普及
题目描述

Problem Statement

Among the strings of length A + B containing A occurrences of a and B occurrences of b, find the string that comes K-th in the lexicographical order.

Input

Input is given from Standard Input in the following format:
A B K

Output

Print the answer.

Constraints

  • $1 \leq A, B \leq 30$
  • $1 \leq K \leq S$, where S is the number of strings of length A + B containing A occurrences of a and B occurrences of b.
  • All values in input are integers.

Sample Input 1

2 2 4

Sample Output 1

baab

Here are the strings containing two as and two bs in the lexicographical order: aabb, abab, abba, baab, baba, and bbaa.
The fourth string, baab, should be printed.

Sample Input 2

30 30 118264581564861424

Sample Output 2

bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

K may not fit into a 32-bit integer type.

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
2 2 4
样例输出
baab