#include <bits/stdc++.h>
using namespace std;
inline bool bad(int s, int l, int r) { return s <= r && s >= l; }
int main() {
  int n, m, s, f, inc, pascr;
  string str;
  char lorr;
  cin >> n >> m >> s >> f;
  if (s > f) {
    inc = -1;
    lorr = 'L';
  } else {
    inc = 1;
    lorr = 'R';
  }
  int t, l, r, q;
  bool stop = 0;
  pascr = 1;
  if (f == s) stop = 1;
  for (int i = 1; i <= m && (!stop); i++) {
    cin >> t >> l >> r;
    if (t == pascr) {
      if (bad(s, l, r) || bad(s + inc, l, r))
        str += 'X';
      else {
        str += lorr;
        s += inc;
      }
    } else {
      q = min(t - pascr, (f - s) * inc);
      str += string(q, lorr);
      s += q * inc;
      if (!(s == f))
        if (bad(s, l, r) || bad(s + inc, l, r))
          str += 'X';
        else {
          str += lorr;
          s += inc;
        }
    }
    if (s == f) stop = 1;
    pascr = t + 1;
  }
  if (s != f) {
    q = (f - s) * inc;
    str += string(q, lorr);
  }
  cout << str;
  return 0;
}
