public void solve() throws IOException {
    int n = nextInt();
    int m = nextInt();
    int s = nextInt();
    int f = nextInt();

    ArrayList<int[]> watch = new ArrayList<int[]>();
    for (int x = 0; x < m; x++) {
      int[] temp = new int[3];
      temp[0] = nextInt();
      temp[1] = nextInt();
      temp[2] = nextInt();
      watch.add(temp);
    }

    int cur = s;
    char dir = (s > f) ? 'L' : 'R';
    char[] ans = new char[n + m];
    int[] nextwatch = watch.remove(0);
    int time = 1;
    while (cur != f) {
      if (nextwatch[0] == time) {
        if (dir == 'L')
          nextwatch[2]++;
        else
          nextwatch[1]--;
        if (cur >= nextwatch[1] && cur <= nextwatch[2])
          ans[time - 1] = 'X';
        else
          ans[time - 1] = dir;
        nextwatch = watch.remove(0);
      } else
        ans[time - 1] = dir;

      if (ans[time - 1] == 'L')
        cur--;
      else if (ans[time - 1] == 'R')
        cur++;

      time++;
    }
    System.out.println(new String(ans).trim());
  }