#include <bits/stdc++.h>
using namespace std;
const int Max = 1e5 + 100;
int n, m, s, f, l, r, st = 0, dir;
map<int, pair<int, int> > watch;
string ans = "";
bool isBlocked(int idx, int pos) {
  if (watch.find(idx) != watch.end()) {
    l = watch[idx].first;
    r = watch[idx].second;
    if (pos >= l && pos <= r) return true;
    return false;
  }
  return false;
}
void init() {
  int idx;
  cin >> n >> m >> s >> f;
  for (int i = int(1); i <= int(m); i++) {
    cin >> idx >> l >> r;
    watch[idx] = make_pair(l, r);
    st = max(st, idx);
  }
  if (f > s)
    dir = 1;
  else
    dir = -1;
}
void solve() {
  int m = s;
  for (int i = int(1); i <= int(st); i++) {
    if (m == f) return;
    if (isBlocked(i, m))
      ans.push_back('X');
    else if (isBlocked(i, m + dir))
      ans.push_back('X');
    else if (dir == 1) {
      ans.push_back('R');
      m += 1;
    } else {
      ans.push_back('L');
      m -= 1;
    }
  }
  while (m != f) {
    if (dir == 1) {
      ans.push_back('R');
      m += 1;
    } else {
      ans.push_back('L');
      m -= 1;
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  init();
  solve();
  cout << ans << endl;
  return 0;
}
