#include <bits/stdc++.h>
using namespace std;
int main() {
  int spies, moments, from, to;
  scanf("%d %d", &spies, &moments);
  scanf("%d %d", &from, &to);
  int sec = 0, current = from, time, left, right;
  for (int i = 0; i < (int)(moments); i++) {
    sec++;
    scanf("%d %d %d", &time, &left, &right);
    if (current != to) {
      while (time > sec) {
        if (current < to) {
          printf("R");
          current++;
        } else if (current > to) {
          printf("L");
          current--;
        }
        sec++;
      }
      if (current != to) {
        if (current < left && current < right) {
          if (current < to) {
            if (current + 1 < left && current + 1 < right) {
              printf("R");
              current++;
            } else
              printf("X");
          } else if (current > to) {
            if (current - 1 < left && current - 1 < right) {
              printf("L");
              current--;
            } else
              printf("X");
          }
        } else if (left < current && right < current) {
          if (current < to) {
            if (current + 1 > left && current + 1 > right) {
              printf("R");
              current++;
            } else
              printf("X");
          } else {
            if (current - 1 > left && current - 1 > right) {
              printf("L");
              current--;
            } else
              printf("X");
          }
        } else
          printf("X");
      }
    }
  }
  if (current != to) {
    while (current != to) {
      if (current < to) {
        current++;
        printf("R");
      } else if (current > to) {
        current--;
        printf("L");
      }
    }
  }
}
