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


unsigned long long int prvaCifra(unsigned long long int x)
{
    unsigned long long int n = 0;
    while (x > 0)
    {
        n = x % 10;
        x = x / 10;
    }
    return n;
}

void broj(unsigned long long int *m, unsigned long long int *n)
{
    unsigned long long int s = 1, k, c = 0, br1, br2, p, q;
    p = *m;
    q = *n;
    k = q;
    for (; k > 0; c++) k = k / 10;
    for (; c > 0; c--) s = s * 10;
    br1 = p * s + q;
    k = p;
    c = 0;
    for (; k > 0; c++) k = k / 10;
    s = 1;
    for (; c > 0; c--) s = s * 10;
    br2 = q * s + p;
    if (br1 > br2)
    {
      *m = p;
      *n = q;
    }
    else
    {
        *m = q;
        *n = p;
    }
}

int main()
{
    int i, j, n=3;
    unsigned long long int niz[3], pom, a, b;
    for(i = 0; i < n; i++)
        scanf("%llu", &niz[i]);
    for(i = 0; i < n - 1; i++)
    {
        for(j = 0; j < n - 1; j++)
        {
            if (prvaCifra(niz[j]) < prvaCifra(niz[j + 1]))
            {
                pom = niz[j];
                niz[j] = niz[j + 1];
                niz[j + 1] = pom;
            }
            else if (prvaCifra(niz[j]) == prvaCifra(niz[j + 1]))
            {
                a = niz[j];
                b = niz[j + 1];
                broj( &a, &b);
                niz[j] = a;
                niz[j + 1] = b;
            }
        }
    }
    for(i = 0; i < n; i++)
        printf("%llu", niz[i]);
}