#include <bits/stdc++.h>
using namespace std;
struct look {
  int t, l, r;
};
look a[100000];
int n, m, s, f;
int main() {
  cin >> n >> m >> s >> f;
  for (int i = 0; i < m; ++i) cin >> a[i].t >> a[i].l >> a[i].r;
  int curLook = 0;
  for (int t = 1; s != f; ++t) {
    if (curLook < m && a[curLook].t == t) {
      int l = a[curLook].l, r = a[curLook].r;
      int next = (s < f) ? s + 1 : s - 1;
      ++curLook;
      if ((l <= s && s <= r) || (l <= next && next <= r)) {
        cout << 'X';
        continue;
      }
    }
    if (s < f) {
      cout << 'R';
      ++s;
    } else {
      cout << 'L';
      --s;
    }
  }
  return 0;
}
