#include <bits/stdc++.h>
struct tn {
  int t, l, r;
};
tn lk[111111];
bool in(int loc, int l, int r) {
  if (loc >= l && loc <= r) return true;
  return false;
}
int absv(int i1) { return i1 < 0 ? -i1 : i1; }
int main() {
  int n, m, s, f;
  scanf("%d%d%d%d", &n, &m, &s, &f);
  int now = s;
  int to;
  char toc;
  if (s < f)
    to = 1, toc = 'R';
  else
    to = -1, toc = 'L';
  int lastt = 0;
  for (int i = 0; i != m; i++) {
    int t, l, r;
    scanf("%d%d%d", &t, &l, &r);
    if (now == f) continue;
    int mid = t - lastt - 1;
    int go = absv(f - now);
    if (mid < go) {
      for (int j = 0; j != mid; j++) putchar(toc), now += to;
    } else {
      for (int j = 0; j != go; j++) putchar(toc), now += to;
    }
    if (now == f) continue;
    if (in(now + to, l, r) || in(now, l, r))
      putchar('X');
    else
      putchar(toc), now += to;
    lastt = t;
  }
  if (now != f) {
    int st = absv(now - f);
    for (int i = 0; i != st; i++) putchar(toc);
  }
  puts("");
  return 0;
}
