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