

Time Limit: 2 sec / Memory Limit: 256 MiB
配点 : 点
問題文
文字列 に対し、 を の巡回シフトのうち辞書順最小のものとします。
たとえば、 babca
のとき、 の巡回シフト (babca
, abcab
, bcaba
, cabab
, ababc
) のうち最小の ababc
が となります。
あなたは、三個の整数 , が与えられます。
あなたは、 a
をちょうど 個、b
をちょうど 個、c
をちょうど 個含む文字列 を構成したいです。
そのような文字列が複数存在する場合は、 を辞書順で最大化したいです。
の辞書順での最大値を求めてください。
制約
- は非負整数である。
入力
入力は以下の形式で標準入力から与えられる。
出力
答えを出力せよ。
入力例 1Copy
2 2 0
出力例 1Copy
abab
は a
二個と b
二個からならなければなりません。
aabb
のときaabb
.abab
のときabab
.abba
のときaabb
.baab
のときaabb
.baba
のときabab
.bbaa
のときaabb
.
となるので、 の最大値は abab
です。
入力例 2Copy
1 1 1
出力例 2Copy
acb
Score : points
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 1Copy
2 2 0
Sample Output 1Copy
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 2Copy
1 1 1
Sample Output 2Copy
acb