#include <iostream>
#include <vector>
#include <string>
using namespace std;
int main() {
vector<string> matrix;
string line;
while (getline(cin, line) && !line.empty()) {
matrix.push_back(line);
}
if (matrix.empty()) {
cout << 0 << endl;
return 0;
}
char current = matrix[0][0];
int count = 0;
vector<int> result;
for (const string& row : matrix) {
for (char c : row) {
if (c == current) {
count++;
} else {
result.push_back(count);
current = c;
count = 1;
}
}
}
result.push_back(count);
if (matrix[0][0] == '1') {
result.insert(result.begin(), 0);
}
for (int i = result.size()-1; i >= 0; i--) {
if (i > 0) {
cout << " ";
}
cout << result[i];
}
cout << endl;
return 0;
}
AWA求助QAQ