#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  long long n, m, s, f, t, l, r;
  cin >> n >> m >> s >> f;
  long long t2 = 0;
  for (long long i = 1; i <= m; i++) {
    if (s == f) return 0;
    cin >> t >> l >> r;
    if (t2 + 1 < t) {
      for (long long i = t2 + 1; i < t; i++) {
        if (s == f) return 0;
        if (s < f) {
          cout << "R";
          s++;
        } else {
          cout << "L";
          s--;
        }
      }
    }
    t2 = t;
    if (s == f) return 0;
    if (s >= l && s <= r) {
      cout << "X";
      continue;
    } else {
      if (s < f) {
        if (s + 1 == l) {
          cout << "X";
          continue;
        }
        cout << "R";
        s++;
      } else {
        if (s - 1 == r) {
          cout << "X";
          continue;
        }
        s--;
        cout << "L";
      }
    }
  }
  if (s < f) {
    while (s < f) {
      cout << "R";
      s++;
    }
  } else {
    while (s > f) {
      cout << "L";
      s--;
    }
  }
  return 0;
}
