#include <stdio.h>
#include <stdlib.h>
#include <math.h>

int i=0, ap = -1, bp = -1, cp = -1, g=0, p,q;

void count(int n, int *j);
void tomb(int n, int j, int *t[]);
void compare(int a[], int b[], int c[]);
void fuggveny1(int x[], int y[], int p, int q);
void fuggveny3(int x[], int y[], int p, int q);

int main() {
	int A, B, C, aj, bj, cj, a[11], b[11], c[11];
	scanf_s("%d%d%d", &A,&B,&C);
	count(A, &aj);
	count(B, &bj);
	count(C, &cj);
	for (i = 0; i < 10; i++) {
		a[i] = -1; b[i] = -1; c[i] = -1;
	} 
	tomb(A, aj, &a);
	tomb(B, bj, &b);
	tomb(C, cj, &c);
	i = 0;
	compare(a,b,c);
	if (ap == 1) {
		if (bp == 2) printf("\n%d%d%d", A, B, C);
		else printf("\n%d%d%d", A, C, B);
	}
	else if (bp == 1) {
		if(ap==2) printf("\n%d%d%d", B, A, C);
		else printf("\n%d%d%d", B, C, A);
	}
	else {
		if (ap == 2) printf("%d%d%d", C, A, B);
		else printf("%d%d%d", C, B, A);
	}
	getch();
}

void count(int n, int *j) {
	int k = 10;
	*j = 1;
	for (i = 2; i < 11; i++) {
		if (n / k >= 1) {
			k = k * 10;
			*j = i;
		}
		else break;
	}
}

void tomb(int n, int j, int *t[]) {
	int k, tx = 0, t1;
	k = 10;
	for (i = j; i > 0;i--) {
		t[i] = (n % k - tx)/(k/10);
		t1 = t[i];
		tx = t1;
		k = k * 10;
	}
}

void compare(int a[], int b[], int c[]) {
	g++;
	if (ap == -1) {
		if (bp == -1) {
			if (cp == -1) {
				if (a[g] == -1) {
					if (b[g] == -1) {
						ap = 2; bp = 3; cp = 1;
					}
					else {
						if (c[g] == -1) {
							bp = 1; ap = 2; cp = 3;
						}
						else {
							ap = 3;
							p = 2, q = 3;
							fuggveny3(b, c, p,q);
						}
					}
				}
				else if (b[g] == -1) {
					if (c[g] == -1) {
						ap = 1; bp = 2; cp = 3;
					}
					else {
						bp = 3;
						p = 1;
						q = 3;
						fuggveny3(a, c, p, q);
					}
				}
				else if (c[g] == -1) {
					cp = 3;
					p = 1;
					q = 2;
					fuggveny3(a, b, p, q);
				}
				else { 
					if (a[g] > b[g] && ap == -1) {
						if (a[g] > c[g]) {
							ap = 1;
							p = 2;
							q = 3;
							fuggveny1(b, c, p, q);
						}
						else if (a[g] < c[g]) {
							cp = 1; ap = 2; bp = 3;
						}
						else {
							bp = 3;
							p = 1;
							q = 3;
							fuggveny3(a, c, p, q);
						}
					}
					else if (a[g] < b[g]) {
						if (a[g] > c[g]) {
							bp = 1; ap = 2; cp = 3;
						}
						else if (a[g] < c[g]) {
							ap = 3;
							p = 2;
							q = 3;
							fuggveny3(b, c, p, q);
						}
						else {
							bp = 1;
							p = 1;
							q = 3;
							fuggveny1(a, c, p, q);
						}
					}
					else {
						if (a[g] < c[g]) {
							cp = 1;
							p = 1;
							q = 2;
							fuggveny1(a, b, p, q);
						}
						else if (a[g] < c[g]) {
							cp = 3;
							p = 1;
							q = 2;
							fuggveny3(a, b, p, q);
						}
						else compare(a, b, c);
					}
				}
			}
			else if(bp==1){
				if (cp == -1) {
					p = 1;
					q = 2;
					fuggveny1(a, b, p, q);
				}
				else ap = 2;
			}
			else {
				if (cp == -1) {
					p = 1;
					q = 3;
					fuggveny3(a, c, p, q);
				}
				else ap = 2;
			}
		}
	}
	else if (bp == -1) {
		if (ap == 1) {
			if (cp == -1) {
				p = 2;
				q = 3;
				fuggveny1(b, c, p, q);
			}
			else bp = 2;
		}
		else {
			if (cp == -1) {
				p = 2;
				q = 3;
				fuggveny3(b, c, p, q);
			}
			else bp = 2;
		}
	}
	else c = 2;
	g++;
}

void fuggveny1(int x[], int y[], int p, int q) {
	if (p == 1) {
		if (q == 2) {
			if (x[g] > y[g]) {
				ap = 2; bp =3;
			}
			else if (x[g] < y[g]) {
				ap = 3; bp = 2;
			}
			else {
				g++; fuggveny1(x, y, p, q);
			}
		}
		else {
			if (x[g] > y[g]) {
				ap = 2; cp = 3;
			}
			else if (x[g] < y[g]) {
				ap = 3; cp = 2;
			}
			else {
				g++; fuggveny1(x, y, p, q);
			}
		}
	}
	else if (p == 2) {
		if (x[g] > y[g]) {
			bp = 2; cp = 3;
		}
		else if (x[g] < y[g]) {
			bp = 3; cp = 2;
		}
		else {
			g++; fuggveny1(x, y, p, q);
		}
	}
}

void fuggveny3(int x[], int y[], int p, int q) {
	g++;
	if (p == 1) {
		if (q == 2) {
			if (x[g] > y[g]) {
				ap = 1; bp = 1;
			}
			else if (x[g] < y[g]) {
				ap = 2; bp = 1;
			}
			else {
				g++; fuggveny1(x, y, p, q);
			}
		}
		else {
			if (x[g] > y[g]) {
				ap = 1; cp = 2;
			}
			else if (x[g] < y[g]) {
				ap = 2; cp = 1;
			}
			else {
				g++; fuggveny1(x, y, p, q);
			}
		}
	}
	else if (p == 2) {
		if (x[g] > y[g]) {
			bp =1; cp = 2;
		}
		else if (x[g] < y[g]) {
			bp =2; cp = 1;
		}
		else {
			g++; fuggveny1(x, y, p, q);
		}
	}
}