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