#codefestival2017qualbf. [code_festival_2017_qualb_f]Largest Smallest Cyclic Shift
[code_festival_2017_qualb_f]Largest Smallest Cyclic Shift
Problem Statement
For a string , let be the lexicographically smallest cyclic shift of . For example, if babca
, ababc
because this is the smallest among all cyclic shifts (babca
, abcab
, bcaba
, cabab
, ababc
).
You are given three integers , and . You want to construct a string that consists of exactly a
s, exactly b
s, and exactly c
s. If there are multiple such strings, you want to choose one that maximizes lexicographically.
Compute the lexicographically largest possible value of .
Constraints
- are non-negative integers.
Input
Input is given from Standard Input in the following format:
Output
Print the answer.
Sample Input 1
2 2 0
Sample Output 1
abab
must consist of two a
s and two b
s.
- If
aabb
,aabb
. - If
abab
,abab
. - If
abba
,aabb
. - If
baab
,aabb
. - If
baba
,abab
. - If
bbaa
,aabb
.
Thus, the largest possible is abab
.
Sample Input 2
1 1 1
Sample Output 2
acb