F - Largest Smallest Cyclic Shift Editorial /

Time Limit: 2 sec / Memory Limit: 256 MB

配点 : 1600

問題文

文字列 S に対し、 f(S)S の巡回シフトのうち辞書順最小のものとします。 たとえば、 S = babca のとき、 S の巡回シフト (babca, abcab, bcaba, cabab, ababc) のうち最小の ababcf(S) となります。

あなたは、三個の整数 X, Y, Z が与えられます。 あなたは、 a をちょうど X 個、b をちょうど Y 個、c をちょうど Z 個含む文字列 T を構成したいです。 そのような文字列が複数存在する場合は、 f(T) を辞書順で最大化したいです。

f(T) の辞書順での最大値を求めてください。

制約

  • 1 \leq X + Y + Z \leq 50
  • X, Y, Z は非負整数である。

入力

入力は以下の形式で標準入力から与えられる。

X Y Z

出力

答えを出力せよ。


入力例 1

2 2 0

出力例 1

abab

Ta 二個と b 二個からならなければなりません。

  • T = aabb のとき f(T) = aabb.
  • T = abab のとき f(T) = abab.
  • T = abba のとき f(T) = aabb.
  • T = baab のとき f(T) = aabb.
  • T = baba のとき f(T) = abab.
  • T = bbaa のとき f(T) = aabb.

となるので、 f(T) の最大値は abab です。


入力例 2

1 1 1

出力例 2

acb

Score : 1600 points

Problem Statement

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 as, exactly Y bs, and exactly Z cs. 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).

Constraints

  • 1 \leq X + Y + Z \leq 50
  • X, Y, Z are non-negative integers.

Input

Input is given from Standard Input in the following format:

X Y Z

Output

Print the answer.


Sample Input 1

2 2 0

Sample Output 1

abab

T must consist of two as and two bs.

  • If T = aabb, f(T) = aabb.
  • If T = abab, f(T) = abab.
  • If T = abba, f(T) = aabb.
  • If T = baab, f(T) = aabb.
  • If T = baba, f(T) = abab.
  • If T = bbaa, f(T) = aabb.

Thus, the largest possible f(T) is abab.


Sample Input 2

1 1 1

Sample Output 2

acb