#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
signed main(){
string a[8];
for(int i = 0; i < 8; i++){
cin >> a[i];
}
sort(a,a+8);
cout << a[i] << " ";
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
signed main(){
string a[8];
for(int i = 0; i < 8; i++){
cin >> a[i];
}
sort(a,a+8);
for(int i = 0; i < 8; i++){
cout << a[i] << " ";
}
}