#include <bits/stdc++.h>
using namespace std;
const long long inf = 1000000000;
double Time() { return double(clock()) / double(CLOCKS_PER_SEC); }
const int N = 1000001;
int n, s, f, m;
int main() {
  cin >> n >> m >> f >> s;
  int j = 1;
  for (int i = (int)1; i <= (int)m; i++) {
    int t, l, r;
    cin >> t >> l >> r;
    if (f == s) break;
    if (t == j) {
      if (f < s) {
        if (f >= l && f <= r || f + 1 >= l && f + 1 <= r)
          cout << "X";
        else
          cout << "R", f++;
      } else {
        if (f >= l && f <= r || f - 1 >= l && f - 1 <= r)
          cout << "X";
        else
          cout << "L", f--;
      }
    } else {
      while (j < t) {
        if (f == s) break;
        if (f < s)
          cout << "R", f++;
        else
          cout << "L", f--;
        j++;
      }
      if (f == s) break;
      if (f < s) {
        if (f >= l && f <= r || f + 1 >= l && f + 1 <= r)
          cout << "X";
        else
          cout << "R", f++;
      } else {
        if (f >= l && f <= r || f - 1 >= l && f - 1 <= r)
          cout << "X";
        else
          cout << "L", f--;
      }
    }
    j = t + 1;
  }
  while (s != f) {
    if (f == s) break;
    if (f < s)
      cout << "R", f++;
    else
      cout << "L", f--;
  }
  return 0;
}
