#include <bits/stdc++.h>
#define ll long long
using namespace std;
const int maxn=100000;
int n;
int p[maxn+1],a[maxn+1];

int main(){
	cin>>n;
	iota(p,p+n+1,0);
	for (int i=2;;++i){
		int j=i*i;
		if (j>n) break;
		if (p[i]!=i) continue;
		while (j<=n) {
			p[j]=i;
			j+=i;
		}
	}
	a[1]=1;
	cout<<1;
	for  (int i=2;i<=n;++i){
		if (p[i]!=i) a[i]=a[i/p[i]]+1;
		else a[i]=2;
		cout<<' '<<a[i];
	}
	cout<<'\n';
	return 0;
}
#include <iostream>
#include <cstdio>
#include <string>
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <numeric>
#include <functional>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef pair<ll, ll> P;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define exrep(i, a, b) for(ll i = a; i <= b; i++)
#define out(x) cout << x << endl
#define exout(x) printf("%.10f\n", x)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define pb push_back
#define re0 return 0
const ll mod = 1000000007;
const ll INF = 1e16;
const ll MAX_N = 10010;
  
int main() {
    string s;
    cin >> s;
    ll n = s.size();
    
    deque<char> dQ;

    ll flip = 0;  // sが反転してたら1
    rep(i, n) {
        if(s[i] == 'R') {
            flip = 1 - flip;
        }
        else {
            if(flip) {
                dQ.push_front(s[i]);
            }
            else {
                dQ.pb(s[i]);
            }
        }
    }
    
    if(flip) {
        reverse(all(dQ));
    }

    string t = "";
    for(auto c : dQ) {
        t.push_back(c);
        ll m = t.size();
        if(m >= 2 && t[m-2] == t[m-1]) {
            rep(i, 2) {
                t.pop_back();
            }
        }
    }
    
    out(t);
    re0;
}