#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m, s, f;
  cin >> n >> m >> s >> f;
  long long t[m + 5], l[m + 5], r[m + 5];
  memset(t, 0, sizeof(t));
  long long pos = 0;
  for (int i = 1; i <= m; i++) cin >> t[i] >> l[i] >> r[i];
  int current = s;
  if (f > s) {
    for (int i = 1; i <= m; i++) {
      if (current == f) return 0;
      long long dif = t[i] - pos;
      pos = t[i];
      long long mn = min(dif - 1, f - current);
      for (int j = 1; j <= mn; j++) cout << "R";
      current += mn;
      if (current == f) return 0;
      if (current >= l[i] && current <= r[i]) {
        cout << "X";
      } else if ((current + 1) >= l[i] && (current + 1) <= r[i]) {
        cout << "X";
      } else {
        cout << "R";
        current++;
      }
    }
    if (current != f) {
      for (int i = current; i < f; i++) cout << "R";
    }
  }
  if (f < s) {
    for (int i = 1; i <= m; i++) {
      if (current == f) return 0;
      long long dif = t[i] - pos;
      pos = t[i];
      long long mn = min(dif - 1, current - f);
      for (int j = 1; j <= mn; j++) cout << "L";
      current -= mn;
      if (current == f) return 0;
      if (current >= l[i] && current <= r[i]) {
        cout << "X";
      } else if ((current - 1) >= l[i] && (current - 1) <= r[i]) {
        cout << "X";
      } else {
        cout << "L";
        current--;
      }
    }
    if (current != f) {
      for (int i = f; i < current; i++) cout << "L";
    }
  }
}
