#include <iostream>
#include <algorithm>
using namespace std;
const int MAXN = 1005;
int a[MAXN];
char b[MAXN];
int main()
{
while (cin.getline(b, MAXN))
{
a[0] = atoi(strtok(b, "5"));
int n = 1;
char* p;
while (p = strtok(NULL, "5"))
{
a[n++] = atoi(p);
}
sort(a, a + n);
cout << a[0];
for (int i = 1; i < n; i++)
cout << " " << a[i];
cout << endl;
}
return 0;
}