stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:


#include<iostream>

#include<string.h>

using namespace std;

int a[100010];

int main(){

	string s;

	cin>>s;	

	int l=s.size();

	a[0]=1;

		for(int i=1;i<l;i++){

			a[i]=1;

//			cout<<a[i]<<"&&&&";

			if(s[i]==s[i-1]&&s[i]=='R'){

				a[i]+=a[i-1];

				a[i-1]=0;

//				cout<<"R:"<<a[i]<<" ";

			}	



		}

		for(int i=l-1;i>=0;i--){

			if(s[i-1]==s[i]&&s[i-1]=='L'){

				a[i-1]+=a[i];

				a[i]=0;

			}

			if(s[i]=='L'&&s[i-1]=='R'){



				if((a[i-1]+a[i])%2==0){

					a[i]=a[i-1]=(a[i-1]+a[i])/2;

				}

				else{

					if(a[i-1]%2!=0){

						a[i]=(a[i-1]+a[i])/2;

						a[i-1]=a[i]+1;

					}

					else{

						a[i-1]=(a[i-1]+a[i])/2;

						a[i]=a[i-1]+1;

					}

				}

			}

			

		}

		cout<<a[0];

		for(int i=1;i<l;i++){

			cout<<" "<<a[i];

		}

		cout<<endl;

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.304409784180226x):
#include <stdio.h>

#include <string.h>

#include <string.h>

char a[100005];

int b[100005] = { 0 };

int main()

{

	int len, count = 0, max = 0, i, j, flag,x,y;

	char b = 0;

	scanf("%s", a);

	len = strlen(a);

	for (i = 0; i < len; i++)

	{

		if (a[i] == 'R' && a[i + 1] == 'L')

		{

			j = i - 1;

			flag = 1;

			x = y = 1;

			while (j >= 0 && a[j] == 'R')

			{

				if (flag == 1)

					y++;

				else x++;

				flag = 1 - flag;

				j--;

			}

			flag = 1;

			j = i + 2;

			while (j < len && a[j] == 'L')

			{

				if (flag == 1)

					x++;

				else y++;

				flag = 1 - flag;

				j++;

			}

			printf("%d %d ", x, y);

			i++;

		}

		else printf("0 ");

	}

}
// Slower C++ solution:
#include<bits/stdc++.h>

#include<iostream>

#include<stdio.h>

#include<string>

using namespace std;

typedef long long ll;

string s;

int num[100010];

int L[100010];

int R[100010];

int main()

{

    cin.tie(0);

    ios::sync_with_stdio(false);

    cin>>s;

    int len=s.length();

    int pos=0;

    for(int i=0;i<len;i++)

    {

    	if(s[i]=='R')

    		pos=i;

    	R[i]=pos;

	}

	pos=len;

	for(int i=len-1;i>=0;i--)

	{

        if(s[i]=='L')

			pos=i;

        L[i]=pos;

    }

	int step;

	for(int i=0;i<len;i++)

	{

		if(s[i]=='L')

		{

			step=i-R[i];

			num[R[i]+step%2]++;

		}

		else

		{

			step=L[i]-i;

            num[L[i]-step%2]++;

		}

	}

	for(int i=0;i<len;i++)

		cout<<num[i]<<" ";

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.328752626323678x):
#include <stdio.h>

#include <string.h>

#include <string.h>

char a[100005];

int b[100005] = { 0 };

int main()

{

	int len, count = 0, max = 0, i, j, flag,x,y;

	char b = 0;

	scanf("%s", a);

	len = strlen(a);

	for (i = 0; i < len; i++)

	{

		if (a[i] == 'R' && a[i + 1] == 'L')

		{

			j = i - 1;

			flag = 1;

			x = y = 1;

			while (j >= 0 && a[j] == 'R')

			{

				if (flag == 1)

					y++;

				else x++;

				flag = 1 - flag;

				j--;

			}

			flag = 1;

			j = i + 2;

			while (j < len && a[j] == 'L')

			{

				if (flag == 1)

					x++;

				else y++;

				flag = 1 - flag;

				j++;

			}

			printf("%d %d ", x, y);

			i++;

		}

		else printf("0 ");

	}

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int main()

{

    int g,nt,re[100007]={0};

    string q;

    cin>>q;

    for(g=nt=0;q[g];g++){

        if(q[g]=='R')nt++;

        else if(nt)re[g-1]=(nt+1)/2,re[g]=nt/2,nt=0;

    }

    for(g=q.length()-1,nt=0;g>=0;g--){

        if(q[g]=='L')nt++;

        else if(nt)re[g+1]+=(nt+1)/2,re[g]+=nt/2,nt=0;

    }

    for(g=0;g<q.length()-1;g++)

        printf("%d ",re[g]);

    printf("%d\n",re[g]);

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 7.361358475419184x):
#include <stdio.h>

#include <string.h>

#include <string.h>

char a[100005];

int b[100005] = { 0 };

int main()

{

	int len, count = 0, max = 0, i, j, flag,x,y;

	char b = 0;

	scanf("%s", a);

	len = strlen(a);

	for (i = 0; i < len; i++)

	{

		if (a[i] == 'R' && a[i + 1] == 'L')

		{

			j = i - 1;

			flag = 1;

			x = y = 1;

			while (j >= 0 && a[j] == 'R')

			{

				if (flag == 1)

					y++;

				else x++;

				flag = 1 - flag;

				j--;

			}

			flag = 1;

			j = i + 2;

			while (j < len && a[j] == 'L')

			{

				if (flag == 1)

					x++;

				else y++;

				flag = 1 - flag;

				j++;

			}

			printf("%d %d ", x, y);

			i++;

		}

		else printf("0 ");

	}

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;



int a[100005];



int main()

{

	string s;

	cin>>s;

	int cnt=0;

	for(int i=0; i<s.length(); i++)

	{

		if(s[i]=='R') cnt++;

		else a[i]=cnt, cnt=0;

	}

	for(int i=s.length()-1; i>=0; i--)

	{

		if(s[i]=='L') cnt++;

		else a[i]=cnt, cnt=0;

	}

	for(int i=0; i<s.length(); i++)

	{

		if(a[i]!=0 && s[i]=='R')

		{

			int temp=a[i]+a[i+1];

			if(temp%2==0) a[i]=temp/2, a[i+1]=a[i];

			else

			{

				temp/=2;

				if(a[i]%2==1) a[i]=temp, a[i+1]=temp+1;

				else a[i]=temp+1, a[i+1]=temp;

			}

		}

		cout<<a[i] <<" ";

	}

}

// Faster C++ solution for the same problem (measured speedup: 5.254500365932823x):
#include <stdio.h>

#include <string.h>

#include <string.h>

char a[100005];

int b[100005] = { 0 };

int main()

{

	int len, count = 0, max = 0, i, j, flag,x,y;

	char b = 0;

	scanf("%s", a);

	len = strlen(a);

	for (i = 0; i < len; i++)

	{

		if (a[i] == 'R' && a[i + 1] == 'L')

		{

			j = i - 1;

			flag = 1;

			x = y = 1;

			while (j >= 0 && a[j] == 'R')

			{

				if (flag == 1)

					y++;

				else x++;

				flag = 1 - flag;

				j--;

			}

			flag = 1;

			j = i + 2;

			while (j < len && a[j] == 'L')

			{

				if (flag == 1)

					x++;

				else y++;

				flag = 1 - flag;

				j++;

			}

			printf("%d %d ", x, y);

			i++;

		}

		else printf("0 ");

	}

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

#define all(v) ((v).begin()),((v).end())

#define ll long long

#define fastIO cout << fixed << setprecision(12), ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr)

double const EPS = 1e-12, PI = acos(-1);

const int N = 1e6 + 9, M = 1e3 + 9, OO = 1e9 + 7, MOD = 1e9 + 7;

const ll inf = 1e18;



int ans[N];



int main() {

  fastIO;

#ifdef LOCAL

  freopen("input.in", "rt", stdin);

#endif

  string str;

  cin >> str;

  vector<pair<char, int>> vv;

  char last = '?';

  int cnt = 0;

  for (int i = 0; i < (int)str.size(); ++i) {

    if(last == str[i]) {

      ++cnt;

    } else {

      if(last != '?')

        vv.push_back({last, cnt});

      last = str[i];

      cnt = 1;

    }

  }

  if(cnt > 0)

    vv.push_back({last, cnt});

  for (int i = 1; i < (int)vv.size(); ++i) {

    if(vv[i].first == 'L' && vv[i-1].first == 'R') {

      string str(vv[i-1].second - 1, '0');

      for(auto it: str)

        cout << it << ' ';

      cout << ((vv[i-1].second+1) / 2) + ((vv[i].second) / 2) << ' ';

      cout << ( (vv[i].second + 1) / 2) + (vv[i-1].second / 2) << ' ';

      str =  string(vv[i].second - 1, '0');

      for(auto it: str)

        cout << it << ' ';

      ++i;

    } else {

      string str(vv[i-1].second, '0');

      for(auto it: str)

        cout << it << ' ';

    }

  }

  return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.386807739237705x):
#include <stdio.h>

#include <string.h>

#include <string.h>

char a[100005];

int b[100005] = { 0 };

int main()

{

	int len, count = 0, max = 0, i, j, flag,x,y;

	char b = 0;

	scanf("%s", a);

	len = strlen(a);

	for (i = 0; i < len; i++)

	{

		if (a[i] == 'R' && a[i + 1] == 'L')

		{

			j = i - 1;

			flag = 1;

			x = y = 1;

			while (j >= 0 && a[j] == 'R')

			{

				if (flag == 1)

					y++;

				else x++;

				flag = 1 - flag;

				j--;

			}

			flag = 1;

			j = i + 2;

			while (j < len && a[j] == 'L')

			{

				if (flag == 1)

					x++;

				else y++;

				flag = 1 - flag;

				j++;

			}

			printf("%d %d ", x, y);

			i++;

		}

		else printf("0 ");

	}

}
// Slower C++ solution:
#include <iostream>

#include <bits/stdc++.h>



using namespace std;

char str[100005];

int cnt[100005];



int main()

{

    scanf("%s",str);int len = strlen(str);

    for(int i=0;i<len;)

    {

        if(str[i]=='R'){

            int j=0;

            while(str[i+j]!='L')++j;

            cnt[i+j-1] += j-j/2;

            cnt[i+j] +=j/2;

            i+=j;

        }else ++i;

    }



    for(int i=len-1;i>=0;){

        if(str[i]=='L'){

            int j=0;

            while(str[i-j]!='R') ++j;

            cnt[i-j+1] += j-j/2;

            cnt[i-j]+= j/2;

            i-=j;

        }else --i;

    }



    for(int i=0;i<len;++i){

        printf("%d ",cnt[i]);

    }

    printf("\n");

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.189549295901365x):
#include <stdio.h>

#include <string.h>

#include <string.h>

char a[100005];

int b[100005] = { 0 };

int main()

{

	int len, count = 0, max = 0, i, j, flag,x,y;

	char b = 0;

	scanf("%s", a);

	len = strlen(a);

	for (i = 0; i < len; i++)

	{

		if (a[i] == 'R' && a[i + 1] == 'L')

		{

			j = i - 1;

			flag = 1;

			x = y = 1;

			while (j >= 0 && a[j] == 'R')

			{

				if (flag == 1)

					y++;

				else x++;

				flag = 1 - flag;

				j--;

			}

			flag = 1;

			j = i + 2;

			while (j < len && a[j] == 'L')

			{

				if (flag == 1)

					x++;

				else y++;

				flag = 1 - flag;

				j++;

			}

			printf("%d %d ", x, y);

			i++;

		}

		else printf("0 ");

	}

}
// Slower C++ solution:
#include <bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>

#include <ext/pb_ds/tree_policy.hpp>

using namespace std;

using namespace __gnu_pbds;



#define watch(x) cout<<(#x)<<"="<<(x)<<'\n'

#define mset(d,val) memset(d,val,sizeof(d))

#define setp(x) cout<<fixed<<setprecision(x)

#define forn(i,a,b) for(int i=(a);i<(b);i++)

#define fore(i,a,b) for(int i=(a);i<=(b);i++)

#define pb push_back

#define F first

#define S second

#define pqueue priority_queue

#define fbo find_by_order

#define ook order_of_key

typedef long long ll;

typedef pair<ll,ll> ii;

typedef vector<ll> vi;

typedef vector<ii> vii;

typedef long double ld;

typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> pbds;

void amin(ll &a, ll b){ a=min(a,b); }

void amax(ll &a, ll b){ a=max(a,b); }

void YES(){cout<<"YES\n";} void NO(){cout<<"NO\n";}

void SD(int t=0){ cout<<"PASSED "<<t<<endl; }

const ll INF = ll(1e18);

const int MOD = 998244353;



bool DEBUG=0;

const int MAXN = 100005;

const int LG = 21;



int prt[MAXN][LG];



int main()

{

	ios_base::sync_with_stdio(0); cin.tie(0);

	

	string s; cin>>s;

	int n=s.length();

	

	forn(i,0,n){

		if(s[i]=='L') prt[i][0]=i-1;

		else prt[i][0]=i+1;

	}

	

	forn(j,1,LG){

		forn(i,0,n){

			prt[i][j]=prt[prt[i][j-1]][j-1];

		}

	}

	

	int ans[n]{};

	forn(i,0,n){

		ans[prt[i][20]]++;

	}

	forn(i,0,n) cout<<ans[i]<<" ";

	

	return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.377520749319637x):
#include <stdio.h>

#include <string.h>

#include <string.h>

char a[100005];

int b[100005] = { 0 };

int main()

{

	int len, count = 0, max = 0, i, j, flag,x,y;

	char b = 0;

	scanf("%s", a);

	len = strlen(a);

	for (i = 0; i < len; i++)

	{

		if (a[i] == 'R' && a[i + 1] == 'L')

		{

			j = i - 1;

			flag = 1;

			x = y = 1;

			while (j >= 0 && a[j] == 'R')

			{

				if (flag == 1)

					y++;

				else x++;

				flag = 1 - flag;

				j--;

			}

			flag = 1;

			j = i + 2;

			while (j < len && a[j] == 'L')

			{

				if (flag == 1)

					x++;

				else y++;

				flag = 1 - flag;

				j++;

			}

			printf("%d %d ", x, y);

			i++;

		}

		else printf("0 ");

	}

}
// Slower C++ solution:
#include<bits/stdc++.h>

//#include<cstdio>



using namespace std;

typedef long long ll;

#define rep(i, n) for(int i = 0; i < (n); i++)

#define rep1(i, n) for(int i = 1; i <= (n); i++)

#define co(x) cout << (x) << "\n"

#define cosp(x) cout << (x) << " "

#define ce(x) cerr << (x) << "\n"

#define cesp(x) cerr << (x) << " "

#define pb push_back

#define mp make_pair

#define Would

#define you

#define please





int main() {

	cin.tie(0);

	ios::sync_with_stdio(false);





	string S;

	cin >> S;



	int kotae[100000] = {};

	int N = S.size();

	

	int k = 0;

	rep(i, N) {

		if (S[i] == 'R') {

			k++;

		}

		else {

			kotae[i - 1] += (k + 1) / 2;

			kotae[i] += k / 2;

			k = 0;

		}

	}

	k = 0;

	for (int i = N - 1; i >= 0; i--) {

		if (S[i] == 'L') {

			k++;

		}

		else {

			kotae[i + 1] += (k + 1) / 2;

			kotae[i] += k / 2;

			k = 0;

		}

	}



	rep(i, N) cosp(kotae[i]);



	Would you please return 0;

}

// Faster C++ solution for the same problem (measured speedup: 2.389523793906785x):
//#include<bits/stdc++.h>

#include<cstdio>



using namespace std;

typedef long long ll;

#define rep(i, n) for(int i = 0; i < (n); i++)

#define rep1(i, n) for(int i = 1; i <= (n); i++)

#define co(x) cout << (x) << "\n"

#define cosp(x) cout << (x) << " "

#define ce(x) cerr << (x) << "\n"

#define cesp(x) cerr << (x) << " "

#define pb push_back

#define mp make_pair

#define Would

#define you

#define please



const int dm = 1 << 19;

char dn[dm], * di = dn;

inline void putint(int X) {

	if (X == 0) {

		*di++ = '0';

		*di++ = ' ';

		return;

	}

	int keta = 0;

	char C[20];

	while (X) {

		*(C + keta) = '0' + X % 10;

		X /= 10;

		keta++;

	}

	for (int i = keta - 1; i >= 0; i--)* di++ = (*(C + i));

	*di++ = ' ';

}



int main() {

	//cin.tie(0);

	//ios::sync_with_stdio(false);





	char S[100001];

	int N = fread_unlocked(S, 1, 100001, stdin);

	if (S[N - 1] == '\n') N--;

	int kotae[100000] = {};

	

	int k = 0;

	rep(i, N) {

		if (S[i] == 'R') {

			k++;

		}

		else {

			kotae[i - 1] += (k + 1) / 2;

			kotae[i] += k / 2;

			k = 0;

		}

	}

	k = 0;

	for (int i = N - 1; i >= 0; i--) {

		if (S[i] == 'L') {

			k++;

		}

		else {

			kotae[i + 1] += (k + 1) / 2;

			kotae[i] += k / 2;

			k = 0;

		}

	}



	rep(i, N) putint(kotae[i]);

	fwrite_unlocked(dn, di - dn - 1, 1, stdout);



	Would you please return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

const int N=1e5+7;

struct stu{

	int start,end;

}arr[N];

int ans[N];

int main(){

	memset(ans,0,sizeof(ans));

	string s;

	cin>>s;

	int n=s.length();

	bool flag=false ;

	int pos=0;

	for(int i=0;i<n ;i++){

		if(s[i]=='R'){

			if(!flag){

				arr[++pos].start=i;

				arr[pos].end=i;

				flag=true;

			}

			else arr[pos].end=i;

		}

		else	flag=false ;

	}

	arr[pos+1].start=n;

	for(int i=1;i<=pos;i++){

		int disr=arr[i].end-arr[i].start+1;//r的长度

		int disl=arr[i+1].start-arr[i].end-1;

		if(disr&1){

			ans[arr[i].end]+=disr/2 +1;

			ans[arr[i].end+1]+=disr/2;

		}

		else {

			ans[arr[i].end]+=disr/2;

			ans[arr[i].end+1]+=disr/2;			

		}

		if(disl&1){

			ans[arr[i].end]+=disl/2;

			ans[arr[i].end+1]+=disl/2+1;			

		}

		else {

			ans[arr[i].end]+=disl/2;

			ans[arr[i].end+1]+=disl/2;

		}

	}

	for(int i=0;i<n;i++) cout<<ans[i]<<" ";

	

	return 0;

} 

// Faster C++ solution for the same problem (measured speedup: 1.411585360898451x):
#include <algorithm>

#include <iostream>

#include <cstring>

#include <cstdio>

using namespace std;



int a[100010]={0};



int main()

{

    char t;

    int n=-1;

    while(n++,~scanf("%c",&t)&&t!='\n')if(t=='L')a[n]=-1;



    int cnt=0;

    for(int i=0;i<n-1;i++)

    {

        if(a[i]==0&&a[i+1]==0)

            cnt++;

        else if(a[i]==0&&a[i+1]==-1)

            a[i]=cnt+1,cnt=0;

    }

    cnt=0;

    for(int i=n-1;i>0;i--)

    {

        if(a[i]==-1&&a[i-1]==-1)

            cnt++;

        else if(a[i]==-1&&a[i-1]>0)

            a[i]=cnt+1,cnt=0;

    }

    for(int i=0;i<n;i++)

    {

        if(a[i]<=0)printf("0 ");

        else if(i<n-1&&a[i+1]>0)

        {

            int num = a[i]+a[i+1];

            if((num&1)==0)printf("%d %d ",num>>1,num>>1);

            else if((a[i]&1)==0)

                printf("%d %d ",num>>1,(num>>1)+1);

            else printf("%d %d ",(num>>1)+1,num>>1);

            i++;

        }

    }

    printf("\n");

    return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

const int N=1e5+7;

struct stu{

	int start,end;

}arr[N];

int ans[N];

int main(){

	memset(ans,0,sizeof(ans));

	string s;

	cin>>s;

	int n=s.length();

	bool flag=false ;

	int pos=0;

	for(int i=0;i<n ;i++){

		if(s[i]=='R'){

			if(!flag){

				arr[++pos].start=i;

				arr[pos].end=i;

				flag=true;

			}

			else arr[pos].end=i;

		}

		else	flag=false ;

	}

	arr[pos+1].start=n;

	for(int i=1;i<=pos;i++){

		int disr=arr[i].end-arr[i].start+1;//r的长度

		int disl=arr[i+1].start-arr[i].end-1;

		if(disr&1){

			ans[arr[i].end]+=disr/2 +1;

			ans[arr[i].end+1]+=disr/2;

		}

		else {

			ans[arr[i].end]+=disr/2;

			ans[arr[i].end+1]+=disr/2;			

		}

		if(disl&1){

			ans[arr[i].end]+=disl/2;

			ans[arr[i].end+1]+=disl/2+1;			

		}

		else {

			ans[arr[i].end]+=disl/2;

			ans[arr[i].end+1]+=disl/2;

		}

	}

	for(int i=0;i<n;i++) cout<<ans[i]<<" ";

	

	return 0;

} 

// Faster C++ solution for the same problem (measured speedup: 1.4065114568314099x):
/// However long the night,

///     The dawn will break

/// ICPC next year



#include<bits/stdc++.h>

using namespace std ;

const int N = 1e5+5 ;



string str ;

int ans[N] ;

int main(){

    cin >> str ;

    int s=0 ,e = str.size()-1 ;

    while(s<str.size() && str[s]=='L'){

        ++ans[0] ;

        ++s ;

    }

    while(e>=0 && str[e]=='R'){

        ++ans[str.size()-1] ;

        --e ;

    }

    while(s<=e){

        int cntR=0 ,cntL=0 ;

        int to = s ,a=-1 ,b=-1 ;

        while(to<=e && str[to]=='R') ++cntR ,a = to++ ;

        b = a+1 ;

        while(to<=e && str[to]=='L') ++cntL ,to++ ;



        if(cntR>=cntL) ans[a] = (cntR+cntL+1)/2 ,ans[b] = cntR + cntL - ans[a] ;

        else ans[a] = (cntR+cntL)/2 ,ans[b] = cntR + cntL - ans[a] ;



        int stps = max(cntR ,cntL)-1 ;

        if(stps%2) swap(ans[a],ans[b]);



        s = to ;

    }

    for(int i=0;i<str.size();++i)printf("%d ",ans[i]);

    return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

const int N=1e5+7;

struct stu{

	int start,end;

}arr[N];

int ans[N];

int main(){

	memset(ans,0,sizeof(ans));

	string s;

	cin>>s;

	int n=s.length();

	bool flag=false ;

	int pos=0;

	for(int i=0;i<n ;i++){

		if(s[i]=='R'){

			if(!flag){

				arr[++pos].start=i;

				arr[pos].end=i;

				flag=true;

			}

			else arr[pos].end=i;

		}

		else	flag=false ;

	}

	arr[pos+1].start=n;

	for(int i=1;i<=pos;i++){

		int disr=arr[i].end-arr[i].start+1;//r的长度

		int disl=arr[i+1].start-arr[i].end-1;

		if(disr&1){

			ans[arr[i].end]+=disr/2 +1;

			ans[arr[i].end+1]+=disr/2;

		}

		else {

			ans[arr[i].end]+=disr/2;

			ans[arr[i].end+1]+=disr/2;			

		}

		if(disl&1){

			ans[arr[i].end]+=disl/2;

			ans[arr[i].end+1]+=disl/2+1;			

		}

		else {

			ans[arr[i].end]+=disl/2;

			ans[arr[i].end+1]+=disl/2;

		}

	}

	for(int i=0;i<n;i++) cout<<ans[i]<<" ";

	

	return 0;

} 

// Faster C++ solution for the same problem (measured speedup: 1.3732338040275602x):
#include <bits/stdc++.h>



using namespace std;

#define ll long long

const int N=2e5+5;

int ans[N];

int main()

{

    ios_base::sync_with_stdio(0);

    cin.tie(0);cout.tie(0);

    string s;

    cin>>s;

    int n=(int)s.size();

    for(int i=0;i<n;)

    {

        int e=0,o=0;

        while(s[i]=='R')

        {

            if(i%2==0) e++;

            else o++;

            i++;

        }

        int x=i-1;

        while(s[i]=='L')

        {

            if(i%2==0) e++;

            else o++;

            i++;

        }

        if(x%2==0)

        {

            ans[x]=e;

            ans[x+1]=o;

        }

        else

        {

            ans[x]=o;

            ans[x+1]=e;

        }

    }

    for(int i=0;i<n;i++)

    {

        if(i) cout<<" ";

        cout<<ans[i];

    }

    return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

const int N=1e5+7;

struct stu{

	int start,end;

}arr[N];

int ans[N];

int main(){

	memset(ans,0,sizeof(ans));

	string s;

	cin>>s;

	int n=s.length();

	bool flag=false ;

	int pos=0;

	for(int i=0;i<n ;i++){

		if(s[i]=='R'){

			if(!flag){

				arr[++pos].start=i;

				arr[pos].end=i;

				flag=true;

			}

			else arr[pos].end=i;

		}

		else	flag=false ;

	}

	arr[pos+1].start=n;

	for(int i=1;i<=pos;i++){

		int disr=arr[i].end-arr[i].start+1;//r的长度

		int disl=arr[i+1].start-arr[i].end-1;

		if(disr&1){

			ans[arr[i].end]+=disr/2 +1;

			ans[arr[i].end+1]+=disr/2;

		}

		else {

			ans[arr[i].end]+=disr/2;

			ans[arr[i].end+1]+=disr/2;			

		}

		if(disl&1){

			ans[arr[i].end]+=disl/2;

			ans[arr[i].end+1]+=disl/2+1;			

		}

		else {

			ans[arr[i].end]+=disl/2;

			ans[arr[i].end+1]+=disl/2;

		}

	}

	for(int i=0;i<n;i++) cout<<ans[i]<<" ";

	

	return 0;

} 

// Faster C++ solution for the same problem (measured speedup: 1.4031672509102477x):
#include <iostream>

#include<algorithm>

#include<string>

using namespace std;

string s;

int a[100000];

int ans[100000];

int main()

{

    cin>>s;

    int N=s.length();

    int count_r=0,count_l=0;

    int pos_r;

    for(int i=0;i<N;){

        while(s.at(i)=='R'){

            ++count_r;++i;

        }

        pos_r=i-1;

        while(i<N&&s.at(i)=='L'){

            ++count_l;++i;

        }

        ans[pos_r]=(count_r+count_l)/2;

        ans[pos_r+1]=count_r+count_l-ans[pos_r];

        if(count_r%2!=0)swap(ans[pos_r],ans[pos_r+1]);

        count_r=0;count_l=0;

    }

    for(int i=0;i<N;++i)cout<<ans[i]<<' ';

    return 0;

}