#include<bits/stdc++.h>
// #include<atcoder/all>
// #include<boost/multiprecision/cpp_int.hpp>

using namespace std;
// using namespace atcoder;
// using bint = boost::multiprecision::cpp_int;
using ll = long long;
using ull = unsigned long long;
using P = pair<int,int>;
#define rep(i,n) for(ll i = 0;i < (ll)n;i++)
#define ALL(x) (x).begin(),(x).end()
#define MOD 1000000007


int main(){
  
  int n;
  cin >> n;
  cout << 3*5*7*11 << " ";
  n--;
  if(n){
    cout << 2*3 << " ";
    n--;
  }
  if(n){
    cout << 2*5 << " ";
    n--;
  }
  if(n){
    cout << 2*7 << " ";
    n--;
  }
  if(n){
    cout << 2*11 << " ";
    n--;
  }
  if(n){
    cout << 2*6 << " ";
    n--;
  }
  if(n){
    cout << 2*9 << " ";
    n--;
  }
  for(int i = 12;i <= 5000;i++){
    if(n == 0)break;
    if(i%3 == 0 || i%5 == 0 || i%7 == 0 || i%11 == 0){
      n--;
      cout << 2*i << " \n"[n == 0];
    }
  }
  

  return 0;
}
#include <bits/stdc++.h>
using namespace std;

int main() {

  ios::sync_with_stdio(false);
  cin.tie(0);
  string s;
  cin >> s;
  int n = s.size();
  vector<char> cs(n*2+1,'0');
  int l = n-1;
  int r = n;
  int nl = 0;
  for (int i=0;i<n;i++) {
    if (s[i] == 'R') {
      nl = 1-nl;
      continue;
    }
    if (nl == 1) {
      cs[l] = s[i];
      if (cs[l] == cs[l+1] && cs[l] != '0') {
        cs[l] = '0';
        cs[l+1] = '0';
        l++;
      }
      else l--;
    }
    if (nl == 0) {
      cs[r] = s[i];
      if (cs[r] == cs[r-1] && cs[r] != '0') {
        cs[r] = '0';
        cs[r-1] = '0';
        r--;
      }
      else r++;
    }
  }
  string ans = "";
  for (int i=0;i<=2*n;i++) {
    if (cs[i] != '0') {
      ans += cs[i];
    }
  }
  if (nl == 1) reverse(ans.begin(),ans.end());
  cout << ans << endl;
}
