#include <bits/stdc++.h>
using namespace std;
typedef struct {
  int t, l, r;
} item;
int n, m, s, f;
item a[100005];
int Right() {
  int cur = s;
  for (int j = 1; j < a[1].t; j++) {
    ++cur;
    cout << "R";
    if (cur == f) return 0;
  }
  for (int i = 1; i <= m; i++) {
    if (a[i].l <= cur && cur <= a[i].r) {
      cout << "X";
    } else {
      if (a[i].l <= cur + 1 && cur + 1 <= a[i].r) {
        cout << "X";
      } else if (cur + 1 < a[i].l || cur + 1 > a[i].r) {
        ++cur;
        cout << "R";
      }
    }
    if (cur == f) {
      return 0;
    }
    for (int j = a[i].t + 1; j < a[i + 1].t; j++) {
      cout << "R";
      ++cur;
      if (cur == f) return 0;
    }
  }
  for (int j = a[m].t + 1;; j++) {
    cout << "R";
    ++cur;
    if (cur == f) return 0;
  }
}
int Left() {
  int cur = s;
  for (int j = 1; j < a[1].t; j++) {
    --cur;
    cout << "L";
    if (cur == f) return 0;
  }
  for (int i = 1; i <= m; i++) {
    if (a[i].l <= cur && cur <= a[i].r) {
      cout << "X";
    } else {
      if (a[i].l <= cur - 1 && cur - 1 <= a[i].r) {
        cout << "X";
      } else if (cur - 1 < a[i].l || cur - 1 > a[i].r) {
        --cur;
        cout << "L";
      }
    }
    if (cur == f) {
      return 0;
    }
    for (int j = a[i].t + 1; j < a[i + 1].t; j++) {
      cout << "L";
      --cur;
      if (cur == f) return 0;
    }
  }
  for (int j = a[m].t + 1;; j++) {
    cout << "L";
    --cur;
    if (cur == f) return 0;
  }
}
int main() {
  ios ::sync_with_stdio(false);
  cin >> n >> m >> s >> f;
  for (int i = int(1); i <= int(m); ++i) {
    cin >> a[i].t >> a[i].l >> a[i].r;
  }
  if (s < f)
    Right();
  else
    Left();
  return 0;
}
