#define _USE_MATH_DEFINES
#include<iostream>
#include<fstream>
#include<string>
#include<vector>
#include<utility>
#include<algorithm>
#include<climits>
#include<set>
#include<map>
#include<cmath>
#include<iomanip>
#include<iterator>
#include<queue>
#include<stack>
#include<cctype>
#include<deque>
#include<time.h>
#include<bitset>
#include<random>
#include <functional>
#include<unordered_set>
#include<unordered_map>
#include<random>
#include<numeric>
#include <chrono>
#include<sstream>
#include <valarray> 
#include<list>
#include<complex>
#include<cassert>

//by Skeef79

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;

#pragma warning(disable : 4996)
#pragma comment(linker, "/STACK:16777216")
#define pb push_back
#define en '\n'
#define forn(i,n) for(int i = 0;i<n;i++)
#define for0(i,n) for(int i = 0;i<n;i++)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define vec vector
#define pii pair<int,int>
#define pll pair<ll,ll>
#define szof(x) int(x.size())
#define vi vector<int>
#define vll vector<ll>
#define vvi vector<vector<int>>
#define vvll vector<vector<ll>>

using namespace std;

const int INF = 1000000000 + 1e8;
const ll LINF = 2000000000000000000;

template<typename T> void print(vector<T>& a)
{
	for (int i = 0; i < a.size(); i++)
		cout << a[i] << ' ';
	cout << en;
}

template<typename T> void print(vector<vector<T>>& a)
{
	for (int i = 0; i < a.size(); i++)
	{
		for (int j = 0; j < a[i].size(); j++)
			cout << a[i][j] << ' ';
		cout << en;
	}
}

template <typename T> void input(vector<T>& a)
{
	for (int i = 0; i < a.size(); i++)
		cin >> a[i];
}

template<typename T> void input(vector<vector<T>>& a)
{
	for (int i = 0; i < a.size(); i++)
		for (int j = 0; j < a[i].size(); j++)
			cin >> a[i][j];
}

//1 - #, 0 - _
vector <pii>a;
int n;
void build(string s)
{
	int cnt1 = 0, cnt2 = 0;
	for (int i = 0; i < n; i++)
	{
		if (s[i] == '#')
		{
			if (cnt2 != 0)
				a.pb({ cnt2,0 });
			cnt2 = 0;
			cnt1++;
		}
		else
		{
			if (cnt1 != 0)
				a.pb({ cnt1,1 });
			cnt1 = 0;
			cnt2++;
		}
	}
	if (cnt1 != 0)
		a.pb({ cnt1,1 });
	else
		a.pb({ cnt2,0 });
}

vector<int> check(vector<pii>a, int len)
{
	if (len == 1)
	{
		int ost = len % 2;
		if (a[0].first < len || a[0].first % 2 != ost)
			return { -1 };
		if (a.back().first < len || a.back().first % 2 != ost)
			return { -1 };

		int n = a.size();
		vector<int>ans;
		for (int j = 0; j < a[0].first / 2; j++)
			ans.pb(1);

		for (int i = 1; i < n - 1; i++)
			if (a[i].second == 0)
			{
				if (a[i].first <= len || a[i].first % 2 != 0)
					return { -1 };
				ans.pb(a[i - 1].first + len);
				for (int j = 0; j < (a[i].first - 1) / 2; j++)
					ans.pb(1);
			}
		ans.pb(a[n - 2].first + len);
		for (int j = 0; j < a.back().first / 2; j++)
			ans.pb(1);
		return ans;
	}
	else
		if (len == 2)
		{
			if (a[0].first < 2 || a[0].first == 3)
				return { -1 };
			if (a.back().first < 2 || a.back().first == 3)
				return { -1 };

			int n = a.size();
			vector<int>ans;
			int t1 = a[0].first - 3;
			while (t1 > 0)
			{
				if (t1 == 2)
				{
					ans.pb(2);
					t1 = 0;
				}
				else
					if (t1 == 1)
					{
						ans.pb(1);
						t1 = 0;
					}
					else
					{
						ans.pb(1);
						t1 -= 2;
					}
			}

			for (int i = 1; i < n - 1; i++)
				if (a[i].second == 0)
				{
					if (a[i].first <= len)
						return { -1 };
					if (a[i].first == len + 2)
						return { -1 };

					ans.pb(a[i - 1].first + len);
					int t = a[i].first - 4;
					while (t > 0)
					{
						if (t == 2)
						{
							ans.pb(2);
							t = 0;
						}
						else
							if (t == 1)
							{
								ans.pb(1);
								t = 0;
							}
							else
							{
								ans.pb(1);
								t -= 2;
							}
					}
				}

			ans.pb(a[n - 2].first + len);

			t1 = a.back().first - 3;
			while (t1 > 0)
			{

				if (t1 == 2)
				{
					ans.pb(2);
					t1 = 0;
				}
				else
					if (t1 == 1)
					{
						ans.pb(1);
						t1 = 0;
					}
					else
					{
						ans.pb(1);
						t1 -= 2;
					}
			}

			return ans;

		}
		else
		{
			if (a[0].first < 3 || a[0].first == 4)
				return { -1 };
			if (a.back().first < 3 || a.back().first == 4)
				return { -1 };

			int n = a.size();
			vector<int>ans;
			int t1 = a[0].first - 4;
			while (t1 > 0)
			{
				if (t1 == 2)
				{
					ans.pb(2);
					t1 = 0;
				}
				else
					if (t1 == 1)
					{
						ans.pb(1);
						t1 = 0;
					}
					else
					{
						ans.pb(1);
						t1 -= 2;
					}
			}

			for (int i = 1; i < n - 1; i++)
				if (a[i].second == 0)
				{
					if (a[i].first <= len)
						return { -1 };
					if (a[i].first == len + 2)
						return { -1 };

					ans.pb(a[i - 1].first + len);
					int t = a[i].first - 5;
					while (t > 0)
					{
						if (t == 2)
						{
							ans.pb(2);
							t = 0;
						}
						else
							if (t == 1)
							{
								ans.pb(1);
								t = 0;
							}
							else
							{
								ans.pb(1);
								t -= 2;
							}
					}
				}

			ans.pb(a[n - 2].first + len);

			t1 = a.back().first - 4;
			while (t1 > 0)
			{

				if (t1 == 2)
				{
					ans.pb(2);
					t1 = 0;
				}
				else
					if (t1 == 1)
					{
						ans.pb(1);
						t1 = 0;
					}
					else
					{
						ans.pb(1);
						t1 -= 2;
					}
			}

			return ans;
		}
}

void solve()
{
	string s;
	cin >> s;
	n = s.length();
	build(s);

	if (a[0].second == 1 || a.back().second == 1)
	{
		if (a[0].second == 1 && a.back().second == 1)
		{
			for (int i = 1; i < n; i++)
				if (s[i] == '_' && s[i - 1] == '_')
				{
					cout << -1;
					return;
				}

			vector<int>ans;
			for (auto to : a)
				if (to.second == 1)
					ans.pb(to.first);
			cout << ans.size() << en;
			print(ans);
		}
		else
			cout << -1;
		return;
	}

	if (a.size() == 1)
	{
		cout << 0 << en;
		return;
	}

	auto ans1 = check(a, 1);
	auto ans2 = check(a, 2);
	auto ans3 = check(a, 3);

	if (ans1[0] != -1)
	{
		cout << ans1.size() << en;
		print(ans1);
		return;
	}
	if (ans2[0] != -1)
	{
		cout << ans2.size() << en;
		print(ans2);
		return;
	}
	if (ans3[0] != -1)
	{
		cout << ans3.size() << en;
		print(ans3);
		return;
	}

	cout << -1;
}

int main()
{
	srand(time(0));
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);

#ifdef _DEBUG	
	freopen("input.txt", "r", stdin);
#endif


	//freopen("igoreha.in", "r", stdin);
	//freopen("igoreha.out", "w", stdout);

	int tst = 1;
	//cin >> tst;

	while (tst--)
		solve();

}