#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m, s, f, t, l, r;
  cin >> n >> m >> s >> f;
  map<long long, long long> L, R;
  for (int i = 1; i <= m; ++i) {
    cin >> t >> l >> r;
    L[t] = l;
    R[t] = r;
  }
  string res = "";
  for (int i = 1;; ++i) {
    l = L[i];
    r = R[i];
    if (s == f) break;
    if (s < f) {
      if (s + 1 >= l && s <= r)
        res += "X";
      else
        s++, res += "R";
    } else if (s > f) {
      if (s >= l && s - 1 <= r)
        res += "X";
      else
        s--, res += "L";
    }
  }
  cout << res << endl;
  return 0;
}
