#include <iostream>
#include<string.h>
#include<stdio.h>
#include<stdlib.h>
#include <string>
using namespace std;

char* uporedi(char x1[], char x2[])
{
	for(int i=0;x1[i];i++)
	{
		if(x1[i]!=x2[i])
		{
			if(x1[i]>x2[i])
				return x1;
			else
				return x2;
		}
	}
	return x2;
}



int main()
{
    char a[30], b[30], c[30];
    scanf("%s%s%s", a, b, c);
    char x1[90], x2[90], x3[90], x4[90], x5[90], x6[9870];
    char* max;
    strcpy(x1, a);
    strcat(x1, b);
    strcat(x1, c);

    strcpy(x2, a);
    strcat(x2, c);
    strcat(x2, b);

    strcpy(x3, b);
    strcat(x3, c);
    strcat(x3, a);

    strcpy(x4, b);
    strcat(x4, a);
    strcat(x4, c);

    strcpy(x5, c);
    strcat(x5, a);
    strcat(x5, b);

    strcpy(x6, c);
    strcat(x6, b);
    strcat(x6, a);
    
    max=uporedi(x1, x2);
    max=uporedi(max, x3);
	max=uporedi(max, x4);
	max=uporedi(max, x5);
	max=uporedi(max, x6);
	puts(max);
    return 0;
}