stablegradients/pie-gem5-bysrc huggingface dataset:
// Original C++ solution (slower):
#include <algorithm>

#include <iostream>

#include <cstring>

#include <cstdio>

using namespace std;



int a[100010]={0};



int main()

{

    char t;

    int n=-1;

    while(n++,(t=getchar())!='\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(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;

}


// Optimized solution to the same problem (faster):
#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 ");

	}

}

// Fastest known solution for this problem:
// Original C++ solution (slower):


#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;

}

// Optimized solution to the same problem (faster):
#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 ");

	}

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
#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 ");

	}

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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] <<" ";

	}

}

// Optimized solution to the same problem (faster):
#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 ");

	}

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}


// Optimized solution to the same problem (faster):
#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 ");

	}

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}


// Optimized solution to the same problem (faster):
#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 ");

	}

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}


// Optimized solution to the same problem (faster):
#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 ");

	}

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
//#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

} 

// Optimized solution to the same problem (faster):
#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]);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}


// Optimized solution to the same problem (faster):
#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]);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}


// Optimized solution to the same problem (faster):
#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]);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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]<<" ";

	}

}

// Optimized solution to the same problem (faster):
#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]);

}

// Fastest known solution for this problem: