atcoder#ABC202D. [ABC202D] aab aba baa

[ABC202D] aab aba baa

Score : 400400 points

Problem Statement

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

Constraints

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

Input

Input is given from Standard Input in the following format:

AA BB KK

Output

Print the answer.

2 2 4
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.

30 30 118264581564861424
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

KK may not fit into a 3232-bit integer type.