#include<iostream>
#include<bits/stdc++.h>
#include<string>
#include<map>
#include <unordered_map>
using namespace std;
typedef long long ll;
constexpr ll M = 1000000007;
constexpr ll P = (1 << 18);
constexpr int INF = 1e9;
//unordered_map<string, string> m;
char arr[101010];
vector<char> solve(vector<char> s) {
for (int i=0; i<(int)s.size(); i++) {
char ch = s[i];
int digit = ch - '0';
if (digit > 0 && digit <= 9) {
//string before = s.substr(0, i);
//string expanded = s.substr(i+1, digit);
//string after = s.substr(i+1);
vector<char> before(s.begin(), s.begin()+i);
vector<char> expanded(&s[i+1], &s[i+1]+digit);
vector<char> after(&s[i+1], &s.back());
for (auto a : before) cout << a << " ";
cout << endl;
for (auto a : expanded) cout << a << " ";
cout << endl;
for (auto a : after) cout << a << " ";
cout << endl;
// cout << i << " " << digit << " " << before << " " << expanded << " " << after << endl;
// cout << "key:" << digit << expanded <<endl;
//store expanded + after in a hashmap
auto v = before.insert(before.end(), expanded.begin(), expanded.end());
//return solve(**v);
return after;
//m[digit + expanded] =;
}
}
return s;
}
int main() {
string input;
cin >> input;
//vector<char> arr(input.begin(), input.end());
vector<char> ans = solve(0);
for (auto ch : ans) cout << ch << " ";
cout << endl;
}