#include <bits/stdc++.h>
const int MAX_SIZE = 100100;
int f[MAX_SIZE], l[MAX_SIZE], r[MAX_SIZE];
int n, m;
int from, to;
int main() {
  scanf("%d%d%d%d", &n, &m, &from, &to);
  for (int i = 1; i <= m; i++) scanf("%d%d%d", f + i, l + i, r + i);
  int dir = to - from;
  int step = 1;
  int x = 0;
  f[0] = 0;
  l[0] = r[0] = -1;
  for (int cur = from; cur != to;) {
    if (step == f[x + 1]) ++x;
    if (f[x] == step && l[x] <= cur && r[x] >= cur) {
      printf("X");
    } else if (f[x] == step && dir > 0 && l[x] <= cur + 1 && r[x] >= cur + 1)
      printf("X");
    else if (f[x] == step && dir < 0 && l[x] <= cur - 1 && r[x] >= cur - 1)
      printf("X");
    else if (dir > 0) {
      printf("R");
      ++cur;
    } else {
      printf("L");
      --cur;
    }
    ++step;
  }
  printf("\n");
  return 0;
}
