#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, m, st, f, i, j;
  long long a, b, c;
  set<long long> s;
  map<long long, pair<long long, long long> > mp;
  cin >> n >> m >> st >> f;
  for (i = 0; i < m; i++) {
    cin >> a;
    cin >> b;
    cin >> c;
    mp[a].first = b;
    mp[a].second = c;
    s.insert(a);
  }
  long long cur = st;
  i = 1;
  if (st < f) {
    while (cur < f) {
      if (s.find(i) == s.end()) {
        cout << "R";
        cur = cur + 1;
      } else {
        if ((cur >= mp[i].first && cur <= mp[i].second) ||
            (cur + 1 >= mp[i].first && cur + 1 <= mp[i].second)) {
          cout << "X";
        } else {
          cout << "R";
          cur = cur + 1;
        }
      }
      i++;
    }
  } else {
    while (cur > f) {
      if (s.find(i) == s.end()) {
        cout << "L";
        cur = cur - 1;
      } else {
        if ((cur >= mp[i].first && cur <= mp[i].second) ||
            (cur - 1 >= mp[i].first && cur - 1 <= mp[i].second)) {
          cout << "X";
        } else {
          cout << "L";
          cur = cur - 1;
        }
      }
      i++;
    }
  }
}
