#include <bits/stdc++.h>
using namespace std;
const long long INF = 1ll << 32;
int n, m, s, e;
string ans = "";
bool ch(int l, int r, int idx, bool b) {
  bool re = 1;
  if (l <= idx && idx <= r) re = 0;
  if (b) {
    if (l <= idx + 1 && idx + 1 <= r) re = 0;
  } else if (l <= idx - 1 && idx - 1 <= r)
    re = 0;
  return re;
}
int main() {
  scanf("%d %d %d %d", &n, &m, &s, &e);
  map<int, pair<int, int>> mp;
  for (int i = 0; i < m; i++) {
    int a;
    scanf("%d", &a);
    scanf("%d %d", &mp[a].first, &mp[a].second);
  }
  int j = 1;
  if (s < e) {
    for (int i = s; i < e; i++) {
      if (mp[j].first) {
        if (ch(mp[j].first, mp[j].second, i, 1))
          ans += "R";
        else {
          ans += "X";
          i--;
        }
        j++;
      } else {
        while (!mp[j].first && i < e) {
          ans += "R";
          i++;
          j++;
        }
        i--;
      }
    }
  } else {
    for (int i = s; i > e; i--) {
      if (mp[j].first) {
        if (ch(mp[j].first, mp[j].second, i, 0))
          ans += "L";
        else {
          ans += "X";
          i++;
        }
        j++;
      } else {
        while (!mp[j].first && i > e) {
          ans += "L";
          i--;
          j++;
        }
        i++;
      }
    }
  }
  cout << ans << endl;
  return 0;
}
