#include <bits/stdc++.h>
struct node {
  int id, l, r;
} a[100005];
int main() {
  int n, m, s, f;
  while (scanf("%d %d %d %d", &n, &m, &s, &f) != EOF) {
    memset(a, 0, sizeof a);
    for (int i = 0; i < m; i++) scanf("%d %d %d", &a[i].id, &a[i].l, &a[i].r);
    int t = 1, note = s;
    for (int i = 0; i < m; i++) {
      if (note == f) break;
      if (a[i].id != t) {
        if (s < f) {
          printf("R");
          note++;
        } else if (s >= f) {
          printf("L");
          note--;
        }
        i--;
      } else if (s < f && (a[i].l > note + 1 || a[i].r < note)) {
        printf("R");
        note++;
      } else if (s >= f && (a[i].l > note || a[i].r < note - 1)) {
        printf("L");
        note--;
      } else
        printf("X");
      t++;
    }
    while (note != f) {
      if (s < f) {
        printf("R");
        note++;
      } else if (s >= f) {
        printf("L");
        note--;
      }
    }
    puts("");
  }
  return 0;
}
