#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, s, f, l, r, mi;
  int curr, prev = 1;
  scanf("%d %d %d %d", &n, &m, &s, &f), curr = s;
  for (int i = 1; i <= m && curr != f; i++) {
    scanf("%d %d %d", &mi, &l, &r);
    for (int j = 0; j < mi - prev && curr != f; j++)
      if (s < f)
        curr++, putchar('R');
      else
        curr--, putchar('L');
    if (curr == f) break;
    prev = mi + 1;
    if (s < f)
      if ((l <= curr && r >= curr) || (l <= curr + 1 && r >= curr + 1))
        putchar('X');
      else
        curr++, putchar('R');
    else {
      if ((l <= curr && r >= curr) || (l <= curr - 1 && r >= curr - 1))
        putchar('X');
      else
        curr--, putchar('L');
    }
  }
  for (int j = 0; curr != f; j++)
    if (s < f)
      curr++, putchar('R');
    else
      curr--, putchar('L');
  while (scanf("%d", &mi) != EOF) {
  }
  return 0;
}
