#include <bits/stdc++.h>
using namespace std;
int mod = 1000000007;
int powmod(int a, int b, int p) {
  int res = 1;
  while (b)
    if (b & 1)
      res = int(res * 1ll * a % p), --b;
    else
      a = int(a * 1ll * a % p), b >>= 1;
  return res;
}
int generator(int p) {
  vector<int> fact;
  int phi = p - 1, n = phi;
  for (int i = 2; i * i <= n; ++i)
    if (n % i == 0) {
      fact.push_back(i);
      while (n % i == 0) n /= i;
    }
  if (n > 1) fact.push_back(n);
  for (int res = 2; res <= p; ++res) {
    bool ok = true;
    for (size_t i = 0; i < fact.size() && ok; ++i)
      ok &= powmod(res, phi / fact[i], p) != 1;
    if (ok) return res;
  }
  return -1;
}
int binpow(int a, int n) {
  if (n == 0) return 1;
  if (n % 2 == 1)
    return binpow(a, n - 1) * a;
  else {
    int b = binpow(a, n / 2);
    return b * b;
  }
}
bool is_prime(int p) {
  if (p == 1) return false;
  for (int i = 2; i * i <= p; i++)
    if (p % i == 0) return false;
  return true;
}
int main() {
  int n, m, s, f;
  cin >> n >> m >> s >> f;
  int z = s;
  bool ri;
  if (s < f)
    ri = true;
  else
    ri = false;
  vector<int> l(m);
  vector<int> r(m);
  vector<int> t(m);
  for (int i = 0; i < m; i++) scanf("%d%d%d", &t[i], &l[i], &r[i]);
  int k = 1, ind = 0;
  if (ri) {
    while (z != f) {
      if (ind < m && k == t[ind] && (l[ind] - 1 <= z && z <= r[ind])) {
        printf("X");
      } else {
        printf("R");
        z++;
      }
      if (ind < m && k == t[ind]) ind++;
      k++;
    }
  } else {
    while (z != f) {
      if (ind < m && k == t[ind] && (l[ind] <= z && z <= r[ind] + 1)) {
        printf("X");
      } else {
        printf("L");
        z--;
      }
      if (ind < m && k == t[ind]) ind++;
      k++;
    }
  }
  printf("\n");
}
