Problem:
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

Solution in C++14 (GCC 5.4.1) (judge verdict: Accepted)

// This amazing code is by Eric Sunli Chen.
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <utility>
#include <vector>
using namespace std;
template<typename T> void get_int(T &x)
{
	char t=getchar();
	bool neg=false;
	x=0;
	for(; (t>'9'||t<'0')&&t!='-'; t=getchar());
	if(t=='-')neg=true,t=getchar();
	for(; t<='9'&&t>='0'; t=getchar())x=x*10+t-'0';
	if(neg)x=-x;
}
template<typename T> void print_int(T x)
{
	if(x<0)putchar('-'),x=-x;
	short a[20]= {},sz=0;
	while(x>0)a[sz++]=x%10,x/=10;
	if(sz==0)putchar('0');
	for(int i=sz-1; i>=0; i--)putchar('0'+a[i]);
}
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define get1(a) get_int(a)
#define get2(a,b) get1(a),get1(b)
#define get3(a,b,c) get1(a),get2(b,c)
#define printendl(a) print_int(a),puts("")
typedef long long LL;
typedef unsigned long long uLL;
typedef pair<int,int> pii;
const int inf=0x3f3f3f3f;
const LL Linf=1ll<<61;
const double pi=acos(-1.0);

int a,b,c;
string now,dp[55][55][55];
bool ok[55][55][55];
void update(int i,int j,int k,const string&s)
{
	if(s+now>=now+now.substr(0,s.size()))
	{
		if(!ok[i][j][k])
		{
			ok[i][j][k]=1;
			dp[i][j][k]=s;
		}
		else if(dp[i][j][k]<s)dp[i][j][k]=s;
	}
}
bool check()
{
	memset(ok,0,sizeof(ok));
	ok[0][0][0]=1;dp[0][0][0]="";
	for(int i=0;i<=a;i++)for(int j=0;j<=b;j++)for(int k=0;k<=c;k++)
	{
		if(!ok[i][j][k])continue;
		if(i<a)update(i+1,j,k,'a'+dp[i][j][k]);
		if(j<b)update(i,j+1,k,'b'+dp[i][j][k]);
		if(k<c)update(i,j,k+1,'c'+dp[i][j][k]);
	}
	return ok[a][b][c];
}
int main()
{
	cin>>a>>b>>c;
	for(int i=0;i<a+b+c;i++)now+='a';
	for(int i=0,j;i<a+b+c;i++)
	{
		for(j='b';j<='c';j++)
		{
			now[i]=j;
			if(!check())break;
		}
		now[i]=j-1;
	}
	cout<<now<<endl;
	return 0;
}