#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<bool> v;
  vector<int> ans;
  int n, t, s, f, a, b, c, curs = 1, curr;
  scanf("%d%d%d%d", &n, &t, &s, &f);
  curr = s;
  if (s < f) {
    while (t--) {
      scanf("%d%d%d", &a, &b, &c);
      if (curr == f) continue;
      if (curs < a) {
        if (!v.size() || !v[v.size() - 1]) {
          v.push_back(1);
          ans.push_back(min(a - curs, f - curr));
        } else if (v[v.size() - 1])
          ans[ans.size() - 1] += min(a - curs, f - curr);
        curr += min(a - curs, f - curr);
        curs = a;
      }
      if ((curr + 1 < b || curr > c) && curr < f) {
        if (!v.size() || !v[v.size() - 1]) {
          v.push_back(1);
          ans.push_back(1);
        } else
          ans[ans.size() - 1]++;
        curr++;
      } else if (curr < f) {
        if (!v.size() || v[v.size() - 1]) {
          v.push_back(0);
          ans.push_back(1);
        } else
          ans[ans.size() - 1]++;
      }
      curs++;
    }
  } else {
    while (t--) {
      scanf("%d%d%d", &a, &b, &c);
      if (curr == f) continue;
      if (curs < a) {
        if (!v.size() || !v[v.size() - 1]) {
          v.push_back(1);
          ans.push_back(min(a - curs, curr - f));
        } else if (v[v.size() - 1])
          ans[ans.size() - 1] += min(a - curs, curr - f);
        curr -= min(a - curs, curr - f);
        curs = a;
      }
      if ((curr < b || curr - 1 > c) && curr > f) {
        if (!v.size() || !v[v.size() - 1]) {
          v.push_back(1);
          ans.push_back(1);
        } else
          ans[ans.size() - 1]++;
        curr--;
      } else if (curr > f) {
        if (!v.size() || v[v.size() - 1]) {
          v.push_back(0);
          ans.push_back(1);
        } else
          ans[ans.size() - 1]++;
      }
      curs++;
    }
  }
  for (int i = 0; i < v.size(); i++) {
    if (v[i]) {
      for (int j = 0; j < ans[i] && s < f; j++) printf("R");
      for (int j = 0; j < ans[i] && s > f; j++) printf("L");
    }
    for (int j = 0; j < ans[i] && !v[i]; j++) printf("X");
  }
  for (int i = 0; i < abs(f - curr) && s < f; i++) printf("R");
  for (int i = 0; i < abs(f - curr) && s > f; i++) printf("L");
  return 0;
}
