#include <bits/stdc++.h>
using namespace std;
struct inter {
  int l, r, t;
};
int n, m, s, f;
vector<inter> V;
bool pro(inter a, inter b) { return a.t < b.t; }
int main() {
  scanf("%d %d %d %d", &n, &m, &s, &f);
  for (int i = 0; i < m; i++) {
    inter p;
    scanf("%d %d %d", &p.t, &p.l, &p.r);
    V.push_back(p);
  }
  sort(V.begin(), V.end(), pro);
  int currT = 1;
  int currI = 0;
  int smjer = 1;
  char c = 'R';
  if (s > f) {
    smjer *= -1;
    c = 'L';
  }
  while (s != f) {
    while (currI < m && currT > V[currI].t) currI++;
    if (currI < m && currT == V[currI].t &&
        ((V[currI].l <= s && V[currI].r >= s) ||
         (V[currI].l <= s + smjer && V[currI].r >= s + smjer))) {
      printf("X");
      currI++;
      currT++;
    } else {
      printf("%c", c);
      s += smjer;
      currT++;
      if (s == f) break;
    }
  }
  printf("\n");
  return 0;
}
