Score : 1600 points
For a string S, let f(S) be the lexicographically smallest cyclic shift of S.
For example, if S = babca
, f(S) = ababc
because this is the smallest among all cyclic shifts (babca
, abcab
, bcaba
, cabab
, ababc
).
You are given three integers X, Y, and Z.
You want to construct a string T that consists of exactly X a
s, exactly Y b
s, and exactly Z c
s.
If there are multiple such strings, you want to choose one that maximizes f(T) lexicographically.
Compute the lexicographically largest possible value of f(T).
Input is given from Standard Input in the following format:
X Y Z
Print the answer.
2 2 0
abab
T must consist of two a
s and two b
s.
aabb
, f(T) = aabb
.abab
, f(T) = abab
.abba
, f(T) = aabb
.baab
, f(T) = aabb
.baba
, f(T) = abab
.bbaa
, f(T) = aabb
.Thus, the largest possible f(T) is abab
.
1 1 1
acb