#include <iostream>
#include <sstream>
#include <vector>
#include <cctype>
using namespace std;

int main(){
    string s;
    getline(cin, s);
    
    if (s.find('-') != string::npos){
        cout << "Invalid input";
        return 0;
    }
    stringstream ss(s);
    string W;
    vector<string> arr(10, "");
    
    while (ss >> W){
        for (int i = 0; i < W.length(); i++) {
            if (isdigit(W[i])) {
                int pos = W[i] - 'o';
                W.erase(i, 1);
                arr[pos] =W;
                break;
            }
        }
    }
    for (int i = 0; i != maxpos; i++)
{
    cout << arr[i];
    if (i != maxpos)
    cout << " ";
}
    return 0;
}