stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

const int MAX=2e5+10;

int Ar[MAX],LeftR[MAX],RightL[MAX];

int main ()

{

    ios_base::sync_with_stdio(false);

    cin.tie(0);



    string A;cin >> A;

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

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

            LeftR[i]=i;

        }

        else LeftR[i]=LeftR[i-1];

    }

    for(int i=A.size()-1;i>=0;i--){

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

            RightL[i]=i;

        }

        else RightL[i]=RightL[i+1];

    }

    /*for(int i=0;i<A.size();i++)

        cout<<LeftR[i]<<" ";

    cout<<endl;

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

        cout<<RightL[i]<<" ";

    cout<<endl;

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

        cout<<"curr = "<<i<<endl;

        int next=i;

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

            next--;

        }

        else{

            next++;

        }

        cout<<"next after 1 turn "<<next<<endl;

        if(A[next]=='L'){

            next--;

        }

        else{

            next++;

        }

        Ar[next]++;



        cout<<"next after 2 turn "<<next<<endl;





    }*/

    //A.push_back('X');

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

        /*if(A[i]=='R'&&A[i+1]=='L'){

                Ar[i]++;

                Ar[i+1]++;

                i++;

                continue;

        }*/

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

                int len =i-LeftR[i];

                if(len&1)Ar[LeftR[i]+1]++;

                else Ar[LeftR[i]]++;



        }

        else{

                int len =RightL[i]-i;

                if(len&1)Ar[RightL[i]-1]++;

                else Ar[RightL[i]]++;

        }

    }

    for(int i=0;i<A.size();i++)cout<<Ar[i]<<" ";

    return 0;

}


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

#include<string.h>





int main()

{

	char s[100005];

	int a[100005] = {0}, i=0, bsr,bsl, len;

	scanf("%s", s);

	len = strlen(s);

	while (i < len-1)

	{

		for (bsr=0; (bsr+i) < len-1; bsr++)/*寻找RL字符串*/

		{

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

			{

				if (bsr % 2 == 0)

				{

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

				}

				else

				{

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

				}

				for (bsl = 1; (i + bsr + bsl) < len; bsl++)

				{

					if (s[i + bsr + bsl] == 'R')

					{

						bsl--;

						break;

					}

					if ((i + bsr + bsl) == (len - 1))

						break;

				}

				if (bsl % 2 == 1)

				{

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

				}

				else

				{

					a[i + bsr] += bsl / 2; a[i + bsr + 1] += bsl / 2;

				}

				i = i + bsr + bsl + 1;

				break;

			}

		}

	}

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

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

	printf("%d\n", a[i]);

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

#include <map>

#include <cmath>

#include <cstring>

#include <cstdio>

using namespace std;

const int maxx=1e6+7;

char ss[maxx];

map<int,int> mp;

int main()

{

    std::ios::sync_with_stdio(false);

    cin >>ss;

    int len=strlen(ss);

    int a,b;

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

    {

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

        {

            a=0,b=0;

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

            {

                if(ss[j]=='R') a++;

                else break;

            }

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

            {

                if(ss[j]=='L') b++;

                else break;

            }

            if((a+b)%2==0) mp[i]=mp[i-1]=(a+b)/2;

            else if(a>b&&(a-b)%2==1)

            {

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

                else mp[i-1]=(a+b)/2,mp[i]=mp[i-1]+1;

            }

            else

            {

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

                else mp[i]=(a+b)/2,mp[i-1]=mp[i]+1;

            }

        }

    }

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

    {

        if(mp[i]) cout <<mp[i]<<" ";

        else cout <<0<<" ";

    }

    cout <<endl;

    return 0;

}


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

#include<string.h>





int main()

{

	char s[100005];

	int a[100005] = {0}, i=0, bsr,bsl, len;

	scanf("%s", s);

	len = strlen(s);

	while (i < len-1)

	{

		for (bsr=0; (bsr+i) < len-1; bsr++)/*寻找RL字符串*/

		{

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

			{

				if (bsr % 2 == 0)

				{

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

				}

				else

				{

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

				}

				for (bsl = 1; (i + bsr + bsl) < len; bsl++)

				{

					if (s[i + bsr + bsl] == 'R')

					{

						bsl--;

						break;

					}

					if ((i + bsr + bsl) == (len - 1))

						break;

				}

				if (bsl % 2 == 1)

				{

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

				}

				else

				{

					a[i + bsr] += bsl / 2; a[i + bsr + 1] += bsl / 2;

				}

				i = i + bsr + bsl + 1;

				break;

			}

		}

	}

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

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

	printf("%d\n", a[i]);

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

using namespace std;

string s;

int step[300000];

int a[300000];

int main(){

	cin>>s;

	int lx=-1,rx=-1;

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

	{

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

		{

			step[i]=lx;

		}

		else lx=i;

	}

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

	{

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

		{

			step[i]=rx;

		}

		else rx=i;

	}

	

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

	{

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

		{

			if((step[i]-i)%2==1)

			{

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

			}

			else a[step[i]]++;

		}

		else {

			if((i-step[i])%2==1)

			{

				a[step[i]+1]++;

			}

			else a[step[i]]++;

		}

	}

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

	{

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

	}

}

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

#include<string.h>





int main()

{

	char s[100005];

	int a[100005] = {0}, i=0, bsr,bsl, len;

	scanf("%s", s);

	len = strlen(s);

	while (i < len-1)

	{

		for (bsr=0; (bsr+i) < len-1; bsr++)/*寻找RL字符串*/

		{

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

			{

				if (bsr % 2 == 0)

				{

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

				}

				else

				{

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

				}

				for (bsl = 1; (i + bsr + bsl) < len; bsl++)

				{

					if (s[i + bsr + bsl] == 'R')

					{

						bsl--;

						break;

					}

					if ((i + bsr + bsl) == (len - 1))

						break;

				}

				if (bsl % 2 == 1)

				{

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

				}

				else

				{

					a[i + bsr] += bsl / 2; a[i + bsr + 1] += bsl / 2;

				}

				i = i + bsr + bsl + 1;

				break;

			}

		}

	}

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

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

	printf("%d\n", a[i]);

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

#include<algorithm>

#include<cstring>

#include<vector>

#include<queue>

#define LL long long

using namespace std;

const int N=1e5+7;

char s[N];

int R[N];

int L[N];

int ans[N];



int main()

{

	scanf("%s",s);

	int n=strlen(s);

	int pos;

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

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

		R[i]=pos;

	}

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

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

		L[i]=pos;

	}

	int k;

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

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

			k=L[i]-i;

			ans[L[i]-k%2]++;

		}

		else {

			k=i-R[i];

			ans[R[i]+k%2]++;

		}

	}

	cout<<ans[0];

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

		cout<<' '<<ans[i];

	}

	cout<<endl;

	return 0;

 } 


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

#include<string.h>





int main()

{

	char s[100005];

	int a[100005] = {0}, i=0, bsr,bsl, len;

	scanf("%s", s);

	len = strlen(s);

	while (i < len-1)

	{

		for (bsr=0; (bsr+i) < len-1; bsr++)/*寻找RL字符串*/

		{

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

			{

				if (bsr % 2 == 0)

				{

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

				}

				else

				{

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

				}

				for (bsl = 1; (i + bsr + bsl) < len; bsl++)

				{

					if (s[i + bsr + bsl] == 'R')

					{

						bsl--;

						break;

					}

					if ((i + bsr + bsl) == (len - 1))

						break;

				}

				if (bsl % 2 == 1)

				{

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

				}

				else

				{

					a[i + bsr] += bsl / 2; a[i + bsr + 1] += bsl / 2;

				}

				i = i + bsr + bsl + 1;

				break;

			}

		}

	}

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

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

	printf("%d\n", a[i]);

}
// 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: 2.330346648450787x):
#include<stdio.h>

#include<string.h>





int main()

{

	char s[100005];

	int a[100005] = {0}, i=0, bsr,bsl, len;

	scanf("%s", s);

	len = strlen(s);

	while (i < len-1)

	{

		for (bsr=0; (bsr+i) < len-1; bsr++)/*寻找RL字符串*/

		{

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

			{

				if (bsr % 2 == 0)

				{

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

				}

				else

				{

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

				}

				for (bsl = 1; (i + bsr + bsl) < len; bsl++)

				{

					if (s[i + bsr + bsl] == 'R')

					{

						bsl--;

						break;

					}

					if ((i + bsr + bsl) == (len - 1))

						break;

				}

				if (bsl % 2 == 1)

				{

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

				}

				else

				{

					a[i + bsr] += bsl / 2; a[i + bsr + 1] += bsl / 2;

				}

				i = i + bsr + bsl + 1;

				break;

			}

		}

	}

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

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

	printf("%d\n", a[i]);

}
// Slower C++ solution:
#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;

}


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

#include<string.h>





int main()

{

	char s[100005];

	int a[100005] = {0}, i=0, bsr,bsl, len;

	scanf("%s", s);

	len = strlen(s);

	while (i < len-1)

	{

		for (bsr=0; (bsr+i) < len-1; bsr++)/*寻找RL字符串*/

		{

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

			{

				if (bsr % 2 == 0)

				{

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

				}

				else

				{

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

				}

				for (bsl = 1; (i + bsr + bsl) < len; bsl++)

				{

					if (s[i + bsr + bsl] == 'R')

					{

						bsl--;

						break;

					}

					if ((i + bsr + bsl) == (len - 1))

						break;

				}

				if (bsl % 2 == 1)

				{

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

				}

				else

				{

					a[i + bsr] += bsl / 2; a[i + bsr + 1] += bsl / 2;

				}

				i = i + bsr + bsl + 1;

				break;

			}

		}

	}

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

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

	printf("%d\n", a[i]);

}
// Slower C++ solution:
/// 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;

}


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

#include<string.h>





int main()

{

	char s[100005];

	int a[100005] = {0}, i=0, bsr,bsl, len;

	scanf("%s", s);

	len = strlen(s);

	while (i < len-1)

	{

		for (bsr=0; (bsr+i) < len-1; bsr++)/*寻找RL字符串*/

		{

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

			{

				if (bsr % 2 == 0)

				{

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

				}

				else

				{

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

				}

				for (bsl = 1; (i + bsr + bsl) < len; bsl++)

				{

					if (s[i + bsr + bsl] == 'R')

					{

						bsl--;

						break;

					}

					if ((i + bsr + bsl) == (len - 1))

						break;

				}

				if (bsl % 2 == 1)

				{

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

				}

				else

				{

					a[i + bsr] += bsl / 2; a[i + bsr + 1] += bsl / 2;

				}

				i = i + bsr + bsl + 1;

				break;

			}

		}

	}

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

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

	printf("%d\n", a[i]);

}
// Slower C++ solution:
#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;

}


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

#include<string.h>





int main()

{

	char s[100005];

	int a[100005] = {0}, i=0, bsr,bsl, len;

	scanf("%s", s);

	len = strlen(s);

	while (i < len-1)

	{

		for (bsr=0; (bsr+i) < len-1; bsr++)/*寻找RL字符串*/

		{

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

			{

				if (bsr % 2 == 0)

				{

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

				}

				else

				{

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

				}

				for (bsl = 1; (i + bsr + bsl) < len; bsl++)

				{

					if (s[i + bsr + bsl] == 'R')

					{

						bsl--;

						break;

					}

					if ((i + bsr + bsl) == (len - 1))

						break;

				}

				if (bsl % 2 == 1)

				{

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

				}

				else

				{

					a[i + bsr] += bsl / 2; a[i + bsr + 1] += bsl / 2;

				}

				i = i + bsr + bsl + 1;

				break;

			}

		}

	}

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

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

	printf("%d\n", a[i]);

}
// Slower C++ solution:
#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;

}

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

#include<string.h>





int main()

{

	char s[100005];

	int a[100005] = {0}, i=0, bsr,bsl, len;

	scanf("%s", s);

	len = strlen(s);

	while (i < len-1)

	{

		for (bsr=0; (bsr+i) < len-1; bsr++)/*寻找RL字符串*/

		{

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

			{

				if (bsr % 2 == 0)

				{

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

				}

				else

				{

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

				}

				for (bsl = 1; (i + bsr + bsl) < len; bsl++)

				{

					if (s[i + bsr + bsl] == 'R')

					{

						bsl--;

						break;

					}

					if ((i + bsr + bsl) == (len - 1))

						break;

				}

				if (bsl % 2 == 1)

				{

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

				}

				else

				{

					a[i + bsr] += bsl / 2; a[i + bsr + 1] += bsl / 2;

				}

				i = i + bsr + bsl + 1;

				break;

			}

		}

	}

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

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

	printf("%d\n", a[i]);

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

using namespace std;

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

using ll = long long;

using P = pair<int, int>;

using namespace std;



int dist[101010];

vector<int> G[101010];



int solve(int v) {

    int u = G[v][0];

    if (G[u][0] == v) {

        // 戻ってきたら

        dist[u] = dist[v] = 0;

        return 0;

    }

    dist[v] = solve(u) + 1;

    return dist[v];

}



int main() {

    string s;

    cin >> s;



    rep(i, s.size()) {

        if (s[i] == 'L') G[i].push_back(i-1);

        else G[i].push_back(i+1);

    }



    rep(i, s.size()) dist[i] = -1;



    rep(i, s.size()) {

        if (dist[i] == -1) {

            if (s[i] == 'L' and i+1<s.size() and s[i+1] == 'L') continue;

            solve(i);

        }

    }



    vector<int> ans(s.size(), 0);



    rep(i, s.size()) {

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

            if (dist[i]%2 == 0) ans[i + dist[i]]++;

            else ans[i + dist[i] + 1]++;

        }

        else {

            if (dist[i]%2 == 0) ans[i - dist[i]]++;

            else ans[i - dist[i] - 1]++;

        }

    }



    rep(i, s.size()) {

        if (i) cout << " ";

        cout << ans[i];

    }

    cout << endl;





}


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

using namespace std;

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

using ll = long long;

using P = pair<int, int>;

using namespace std;



int main() {

    string s;

    vector<pair<int, int>> d;

    cin >> s;

    char ch = s[0];

    int cnt = 1;

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

        if (ch == s[i]) {

            cnt++;

        }

        else {

            d.emplace_back(cnt, ch);

            cnt = 1;

            ch = s[i];

        }

    }

    d.emplace_back(cnt, ch);



    vector<int> ans(s.size(), 0);

    int cur = 0;

    rep(i, d.size()) {

        int cnt = d[i].first;

        char ch = d[i].second;

        rep(x, cnt) {

            if (ch == 'R') {

                if (x%2 == 0) ans[cur + cnt - 1]++;

                else ans[cur + cnt]++;

            }

            else {

                if (x%2 == 0) ans[cur]++;

                else ans[cur-1]++;

            }

        }

        cur += cnt;

    }



    rep(i, s.size()) cout << ans[i] << " ";

    cout << endl;

}
// Slower C++ solution:
/*

author：cmathpo8&&yuanchen&&qiyujun

date:2019/8/17 10:11 

*/

#include<bits/stdc++.h>

#define re register

using namespace std;

int h[100010],t,cnt;

char a[100010];

struct node{

    int fro;

    int to;

}el[100010];

int main(){

       scanf("%s",a+1);

       int cntl=0;

       int sst=strlen(a+1);

       memset(h,0,sizeof(h));

       t=-1;

    for(re int i=1;i<=sst;i++){

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

            if(t==-1){

                el[++cnt].fro=i;

                el[cnt].to=i;

                t=0;

            }else el[cnt].to=i;

        }else t=-1;

    } 

    el[0].to=0;

    for(re int i=1;i<=cnt;i++){

        int dis=(el[i].fro-el[i-1].to-1);

        int disl=(el[i].to-el[i].fro+1);

        if(dis%2==1){

            h[el[i].fro]+=(dis/2);

            h[el[i].fro-1]+=(dis/2)+1;

        }else{

            h[el[i].fro]+=(dis/2);

            h[el[i].fro-1]+=(dis/2);

        }

        if(disl%2==1){

            h[el[i].fro-1]+=(disl/2);

            h[el[i].fro]+=(disl/2)+1;

        }else{

            h[el[i].fro-1]+=(disl/2);

            h[el[i].fro]+=(disl/2);

        }

    }

    for(re int i=1;i<=sst;i++){

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

    } 

    /*for(re int i=1;i<=cnt;i++){

        cout<<el[i].fro<<" "<<el[i].to<<" ";

    }*/

    return 0;

}

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

using namespace std;



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

#define rloop(i,n) for(int i = int(n);i >= 0;i--)

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

#define SZ(c) int(c.size())

#define ALL(c) c.begin(), c.end()

#define RALL(c) c.rbegin(), c.rend()

#define PI acos(-1)

#define pb push_back

#define mp make_pair

#define fr first

#define sc second

#define sfi1(v) scanf("%d",&v)

#define sfi2(v1,v2) scanf("%d %d",&v1,&v2)

#define sfi3(v1,v2,v3) scanf("%d %d %d",&v1,&v2,&v3)

#define sfll1(v) scanf("%I64d",&v);

#define sfll2(v1,v2) scanf("%I64d %I64d",&v1,&v2)

#define sfll3(v1,v2,v3) scanf("%I64d %I64d %I64d",&v1,&v2,&v3)

#define endl '\n'



typedef vector<int> vi;

typedef vector<pair<int,int> > vii;

typedef long long ll;

typedef pair<int, int> pii;







int main()

{



#ifndef ONLINE_JUDGE

	//freopen("in.in", "r", stdin);

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

#endif

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



    string str;

    cin >> str;

    vi ans(SZ(str));

    set<int> s;

    loop(i,SZ(str)-1){

        if(str[i] == 'R' && str[i+1] == 'L')s.insert(i);

    }



    loop(i,SZ(str)){

        if(str[i] == 'L')continue;

        auto it = s.lower_bound(i);

        if(abs(*it - i) % 2 == 0){

            ans[*it]++;

        }else{

            ans[*it + 1]++;

        }

    }



    loop(i,SZ(str)){

        if(str[i] == 'R')continue;

        auto it = s.lower_bound(i);

        it--;

        if(abs(*it - i) % 2 == 1){

            ans[*it + 1]++;

        }else{

            ans[*it]++;

        }

    }



    loop(i,SZ(str))cout << ans[i] << " ";

    cout << endl;







    return 0;

}