#include <bits/stdc++.h>
using namespace std;
const int N = 1000010;
const int INF = 0x3f3f3f3f;
const int MOD = 100000, STA = 8000010;
const long long LNF = 1LL << 60;
const double EPS = 1e-8;
const double OO = 1e15;
const int dx[4] = {-1, 0, 1, 0};
const int dy[4] = {0, 1, 0, -1};
const int day[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
inline int sign(double x) { return (x > EPS) - (x < -EPS); }
template <class T>
T gcd(T a, T b) {
  return b ? gcd(b, a % b) : a;
}
template <class T>
T lcm(T a, T b) {
  return a / gcd(a, b) * b;
}
template <class T>
inline T lcm(T a, T b, T d) {
  return a / d * b;
}
template <class T>
inline T Min(T a, T b) {
  return a < b ? a : b;
}
template <class T>
inline T Max(T a, T b) {
  return a > b ? a : b;
}
template <class T>
inline T Min(T a, T b, T c) {
  return min(min(a, b), c);
}
template <class T>
inline T Max(T a, T b, T c) {
  return max(max(a, b), c);
}
template <class T>
inline T Min(T a, T b, T c, T d) {
  return min(min(a, b), min(c, d));
}
template <class T>
inline T Max(T a, T b, T c, T d) {
  return max(max(a, b), max(c, d));
}
int a[N];
struct pa {
  int l, r;
} nod[N];
int main() {
  int i, n, m, s, f, b;
  scanf("%d%d%d%d", &n, &m, &s, &f);
  bool flag = true;
  if (s < f)
    b = 1;
  else
    b = -1;
  for (i = 0; i < N; i++) {
    nod[i].l = -1;
    nod[i].r = -1;
  }
  for (i = 0; i < m; i++) {
    int t, l, r;
    scanf("%d%d%d", &t, &l, &r);
    if (t >= N) continue;
    nod[t].l = l;
    nod[t].r = r;
  }
  for (i = 1;; i++) {
    if (s == f) break;
    if (nod[i].l == -1 && nod[i].r == -1) {
      if (s + b >= 1 && s + b <= n) {
        printf("%s", b == 1 ? "R" : "L");
        b == 1 ? s++ : s--;
      }
    } else {
      if (s >= nod[i].l && s <= nod[i].r) {
        printf("X");
      } else if (s + b >= 1 && s + b <= n) {
        if (s + b >= nod[i].l && s + b <= nod[i].r) {
          printf("X");
        } else {
          printf("%s", b == 1 ? "R" : "L");
          b == 1 ? s++ : s--;
        }
      }
    }
  }
  return 0;
}
