#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j, n, m, s, f, l, r, t, c = 0, d;
  char g;
  cin >> n >> m >> s >> f;
  if (s < f) {
    d = 1;
    g = 'R';
  } else if (s > f)
    d = -1, g = 'L';
  for (i = 1; i <= m; i++) {
    if (s == f || s > n || s < 1 || f > n || f < 1) break;
    c++;
    cin >> t >> l >> r;
    while (c < t && s != f) {
      s += d;
      putchar(g);
      c++;
    }
    if (s != f)
      if ((s < l || r < s) && (s + d < l || r < s + d))
        s += d, putchar(g);
      else
        putchar('X');
    if (s == f) break;
  }
  while (s != f) {
    s += d;
    putchar(g);
  }
  cout << endl;
  return 0;
}
