#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, s, f;
  cin >> n >> m >> s >> f;
  int *t = new int[m], *l = new int[m], *r = new int[m];
  for (int i = 0; i < m; i++) cin >> t[i] >> l[i] >> r[i];
  char move = 'R';
  if (s > f) move = 'L';
  string ans = "";
  int time = 1, pos = s;
  for (int i = 0; i < m; i++) {
    if (t[i] > time) {
      if (t[i] - time <= abs(pos - f)) {
        for (int j = 0; j < t[i] - time; j++) ans.push_back(move);
        if (s > f)
          pos -= t[i] - time;
        else
          pos += t[i] - time;
      } else {
        for (int j = 0; j < abs(pos - f); j++) ans.push_back(move);
        if (s > f)
          pos -= abs(pos - f);
        else
          pos += abs(pos - f);
      }
      time = t[i];
    }
    if (pos == f) break;
    if (s > f)
      if (pos <= r[i] + 1 && pos >= l[i]) {
        ans.push_back('X');
      } else {
        ans.push_back(move);
        pos--;
      }
    else {
      if (pos <= r[i] && pos >= l[i] - 1) {
        ans.push_back('X');
      } else {
        ans.push_back(move);
        pos++;
      }
    }
    time++;
    if (pos == f) break;
  }
  if (pos != f)
    for (int i = 0; i < abs(pos - f); i++) ans.push_back(move);
  cout << ans << endl;
}
