#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m, s, f, t = 1, a = 0;
  cin >> n >> m >> s >> f;
  int arr[m][3];
  for (int i = 0; i < m; i++) cin >> arr[i][0] >> arr[i][1] >> arr[i][2];
  while (s != f) {
    if (s < f) {
      if (t == arr[a][0]) {
        if (s + 1 >= arr[a][1] && s <= arr[a][2] && a < m) {
          cout << "X";
        } else {
          cout << "R";
          s++;
        }
        a++;
        t++;
      } else {
        cout << "R";
        s++;
        t++;
      }
    }
    if (s > f) {
      if (t == arr[a][0]) {
        if (s >= arr[a][1] && s - 1 <= arr[a][2] && a < m) {
          cout << "X";
        } else {
          cout << "L";
          s--;
        }
        a++;
        t++;
      } else {
        cout << "L";
        s--;
        t++;
      }
    }
  }
}
