#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline T sqr(T n) {
  return (n * n);
}
int main() {
  int n, m, s, f;
  cin >> n >> m >> s >> f;
  int add = 1;
  char c = 'R';
  if (s > f) {
    add = -1;
    c = 'L';
  }
  int t, l, r;
  int tim = 1;
  string res;
  bool found = false;
  for (int i = 0; i < m && !found; i++) {
    cin >> t >> l >> r;
    while (tim < t && !found) {
      res += c;
      s += add;
      tim++;
      if (s == f) found = true;
    }
    if (!found) {
      if (((s >= l && s <= r) || (s + add >= l && s + add <= r)))
        res += 'X';
      else {
        res += c;
        s += add;
        if (s == f) found = true;
      }
    }
    tim++;
  }
  if (!found) {
    while (s != f) {
      s += add;
      res += c;
    }
  }
  cout << res;
  return 0;
}
