#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int SIZE = 2e5 + 10;
bool res[2][SIZE * 10];
long long a[SIZE], b[SIZE], x[SIZE], y[SIZE], t[SIZE];
int n, l;
char an[SIZE * 10];
pair<int, int> tmp[SIZE];
bool get(bool ha[], long long d[]) {
  for (int i = 0; i < (n); ++i) {
    if ((t[i] + d[i]) % 2) return 0;
    d[i] = (t[i] + d[i]) / 2;
    if (d[i] > t[i] || d[i] < 0) return 0;
  }
  static bool first_come = 1;
  if (first_come) {
    for (int i = 0; i < (n); ++i) tmp[i] = make_pair(t[i] % l, i);
    sort(tmp, tmp + n);
    first_come = 0;
  }
  int mi = l + 1, id = -1;
  tmp[n] = tmp[0];
  tmp[n].first += l;
  vector<int> check;
  int base = 0;
  for (int i = (1); i < (n + 1); ++i) {
    if (t[tmp[i].second] / l != t[tmp[i - 1].second] / l + (i == n)) {
      check.push_back(i);
      if (tmp[i].first - tmp[i - 1].first < mi) {
        id = i;
        mi = tmp[i].first - tmp[i - 1].first;
      }
    } else {
      int one = d[tmp[i].second] - d[tmp[i - 1].second];
      if (one > tmp[i].first - tmp[i - 1].first) return 0;
      for (int j = 0; j < (one); ++j) ha[(tmp[i - 1].first + j) % l] = 1;
    }
  }
  for (int one = 0; one < (mi + 1); ++one) {
    int x = tmp[id - 1].second;
    int y = tmp[id].second;
    long long all = (d[y] - (d[x] + one)) / ((t[y] / l - (t[x] + mi) / l));
    if (all > l) continue;
    bool err = 0;
    int check_sum = 0;
    for (int i = 0; i < (((int)(check).size())); ++i) {
      int nx = tmp[check[i] - 1].second;
      int ny = tmp[check[i]].second;
      long long dd = (tmp[check[i]].first - tmp[check[i] - 1].first + l) % l;
      check_sum += dd;
      int nxt_one = d[ny] - d[nx] - all * ((t[ny] / l - (t[nx] + dd) / l));
      if (nxt_one > dd || nxt_one < 0) {
        err = 1;
        break;
      }
    }
    if (!err) {
      for (int i = 0; i < (((int)(check).size())); ++i) {
        int nx = tmp[check[i] - 1].second;
        int ny = tmp[check[i]].second;
        long long dd = (tmp[check[i]].first - tmp[check[i] - 1].first + l) % l;
        int nxt_one = d[ny] - d[nx] - all * ((t[ny] / l - (t[nx] + dd) / l));
        for (int j = 0; j < (nxt_one); ++j)
          ha[(tmp[check[i] - 1].first + j) % l] = 1;
      }
      if (!check_sum) {
        for (int j = 0; j < (all); ++j) ha[j] = 1;
      }
      return 1;
    }
  }
  return 0;
}
int main() {
  scanf("%d%d", &(n), &(l));
  n++;
  for (int i = (1); i < (n); ++i) scanf("%I64d%I64d%I64d", &t[i], &x[i], &y[i]);
  for (int i = 0; i < (n); ++i) {
    a[i] = x[i] + y[i];
    b[i] = x[i] - y[i];
  }
  if (!get(res[0], a) || !get(res[1], b))
    puts("NO");
  else {
    for (int i = 0; i < (l); ++i) {
      if (res[0][i] && res[1][i])
        an[i] = 'R';
      else if (res[0][i])
        an[i] = 'U';
      else if (res[1][i])
        an[i] = 'D';
      else
        an[i] = 'L';
    }
    puts(an);
  }
  return 0;
}
