#D. ABC202D - aab aba baa

    Type: Default 1000ms 256MiB

ABC202D - aab aba baa

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

Score : 400 points

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.

Constraints

  • 1A,B30
  • 1KS, 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.

Input

Input is given from Standard Input in the following format:

A B K

Output

Print the answer.


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.

ABC202

Not Attended
Status
Done
Rule
IOI
Problem
7
Start at
2023-6-28 14:15
End at
2023-6-28 16:39
Duration
2.4 hour(s)
Host
Partic.
13