#include <bits/stdc++.h>
using namespace std;
vector<long long int> prm(1000010, 1);
long long int P = 1e9 + 7;
long long int M = 998244353;
char adjlist[1001][1001];
bool visited[1000001] = {false};
long double pi = 3.14159265358979323846264338327950;
map<int, int> visit;
map<int, set<int>> g;
int cc = 0;
vector<pair<int, int>> moves = {{1, 0}, {-1, 0}, {0, 1}, {0, -1}};
int lps[1000000];
vector<pair<int, int>> final_set;
bool comp(const pair<long long int, long long int> &a,
          const pair<long long int, long long int> &b) {
  if (a.first == b.first) return a.second > b.second;
  return a.first < b.first;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n, m, s, f;
  cin >> n >> m >> s >> f;
  bool flag = true;
  long long int curr = s;
  if (s > f) flag = false;
  long long int i, j;
  long long int t, x, y;
  bool mflag = false;
  long long int back = 0;
  string str = "";
  for (i = 0; i < m; i++) {
    if (i == 0)
      back = 0;
    else
      back = t;
    cin >> t >> x >> y;
    if (curr == f) continue;
    if (t - 1 != back) {
      while (back + 1 < t) {
        if (flag == false) {
          str.push_back('L');
          curr--;
        } else {
          str.push_back('R');
          curr++;
        }
        if (curr == f) break;
        back++;
      }
    }
    if (curr == f) continue;
    if (flag == false) {
      if (curr < x || curr - 1 > y) {
        str.push_back('L');
        curr--;
        continue;
      } else {
        str.push_back('X');
        continue;
      }
    } else {
      if (curr > y || curr + 1 < x) {
        str.push_back('R');
        curr++;
        continue;
      } else {
        str.push_back('X');
        continue;
      }
    }
  }
  if (curr != f) {
    if (flag == false) {
      for (i = curr; i > f; i--) str.push_back('L');
    } else {
      for (i = curr; i < f; i++) str.push_back('R');
    }
  }
  cout << str << "\n";
}
