#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
int i = 0, j = 0, k = 0;
char str1[100],t;
fgets(str1, 100, stdin);
int n = strlen(str1); //noj输入好像不会保留\n,正常时要-1
if (n % 2 == 0)
{
for (i = 0; i < n / 2 - 1; i++)
{
for (j = 0; j < n / 2 - i - 1; j++)
{
if (str1[j] < str1[j + 1])
t = str1[j + 1], str1[j + 1] = str1[j], str1[j] = t;
}
}
for (i = n / 2; i < n - 1; i++)
{
for (j = n / 2; j < n - (i -n / 2) - 1; j++)
{
if(str1[j]>str1[j+1])
t = str1[j + 1], str1[j + 1] = str1[j], str1[j] = t;
}
}
for (i = 0; i < n / 2 ; i++) t = str1[i], str1[i] = str1[i + n / 2], str1[i + n / 2] = t;
}
else
{
for (i = 0; i < n / 2 - 1; i++)
{
for (j = 0; j < n / 2 - i - 1; j++)
{
if (str1[j] < str1[j + 1])
t = str1[j + 1], str1[j + 1] = str1[j], str1[j] = t;
}
}
for (i = n / 2 + 1; i < n - 1; i++)
{
for (j = n / 2 + 1; j < n - ( i - n / 2 - 1 ) - 1; j++)
{
if (str1[j] > str1[j + 1])
t = str1[j + 1], str1[j + 1] = str1[j], str1[j] = t;
}
}
for (i = 0; i < n / 2; i++) t = str1[i], str1[i] = str1[i + n / 2 + 1], str1[i + n / 2 + 1] = t;
}
for (i = 0; i < n; i++) printf("%c", str1[i]);
return 0;
}