#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using lli = long long int;
using ld = long double;
const int N = 2e5 + 5, inf = 1e18;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m, s, f;
  cin >> n >> m >> s >> f;
  map<int, pair<int, int>> mp;
  int cnt = 1;
  for (int i = 0; i < m; i++) {
    int t, l, r;
    cin >> t >> l >> r;
    mp[t] = {l, r};
  }
  if (s < f) {
    while (s != f) {
      if ((s >= mp[cnt].first && s <= mp[cnt].second) ||
          (s + 1 >= mp[cnt].first && s + 1 <= mp[cnt].second))
        cout << 'X';
      else
        cout << 'R', s++;
      cnt++;
    }
  } else {
    while (s != f) {
      if ((s >= mp[cnt].first && s <= mp[cnt].second) ||
          (s - 1 >= mp[cnt].first && s - 1 <= mp[cnt].second))
        cout << 'X';
      else
        cout << 'L', s--;
      cnt++;
    }
  }
  cout << "\n";
  return 0;
}
