#include <iostream>
#include <sstream>
#include <vector>
#include <algorithm>
using namespace std;

int main(){
    string s;
    getline(cin, s);
    
    if (s.find('-') != string::npoos){
        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 < 10; i++) {
        if(arr[i] !="")
        cout << arr[i] << " ";
    }
    return 0;
}