#include <bits/stdc++.h>
#pragma GCC optimise("Ofast")
using namespace std;
const int mod = 1e+9 + 7;
long long binomialCoeff(long long n, long long k) {
  long long res = 1;
  if (n < k) return 0;
  if (k > n - k) k = n - k;
  for (long long i = 0; i < k; ++i) {
    res *= (n - i);
    res /= (i + 1);
  }
  return res;
}
bool tracked(int ptr, pair<int, int> p) {
  if (ptr >= p.first && ptr <= p.second)
    return true;
  else
    return false;
}
void solve() {
  int n, m, second, first, t, l, r, step = 1, ptr, chg;
  cin >> n >> m >> second >> first;
  ptr = second;
  pair<int, int> p;
  string ans = "", def;
  map<int, pair<int, int> > mp;
  for (long long i = 0; i < m; i++) {
    cin >> t >> l >> r;
    mp[t] = {l, r};
  }
  chg = (first > second ? 1 : -1);
  if (chg == 1) {
    def = "R";
  } else
    def = "L";
  while (ptr != first) {
    if (mp.find(step) != mp.end()) {
      p = mp[step];
      if (!tracked(ptr, p) && !tracked(ptr + chg, p)) {
        ptr = ptr + chg;
        cout << def;
      } else
        cout << "X";
    } else {
      ptr = ptr + chg;
      cout << def;
    }
    step++;
  }
  cout << ans << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t = 1;
  while (t--) solve();
}
