#include <bits/stdc++.h>
using namespace std;
int n, m, s, f, l[100014], r[100014], ti[100014], cp, cm, t, d;
string res;
int main(int argc, char* argv[]) {
  cin >> n >> m >> s >> f;
  for (int i = 0; i < (m); i++) cin >> ti[i] >> l[i] >> r[i];
  cp = s;
  cm = 0;
  t = 1;
  while (cp != f) {
    ++t;
    d = (cp > f ? -1 : 1);
    if (ti[cm] == t - 1) {
      ++cm;
      if ((cp >= l[cm - 1] && cp <= r[cm - 1]) ||
          (cp + d >= l[cm - 1] && cp + d <= r[cm - 1])) {
        res += "X";
        continue;
      }
    }
    res += (d > 0 ? "R" : "L");
    cp += d;
  }
  cout << res << endl;
  return 0;
}
