#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  long long f = 1, ans = 0;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    ans = ans * 10 + c - '0';
    c = getchar();
  }
  return f * ans;
}
const long long MAXN = 2e5 + 11;
const long long MAXL = 2e6 + 11;
long long N, Len, X[MAXN], Y[MAXN], T[MAXN];
struct node {
  long long id, X, Y, tim, cnt, ps;
} tr[MAXN];
long long Ans1[MAXL], Ans2[MAXL];
bool cmp(node x1, node x2) { return x1.ps < x2.ps; }
void print() {
  printf("NO\n");
  exit(0);
}
long long Min(long long a, long long b) { return a <= b ? a : b; }
long long Max(long long a, long long b) { return a >= b ? a : b; }
void solveX(long long U) {
  for (long long i = 1; i <= N; i++) {
    if (tr[i].ps == tr[i - 1].ps) continue;
    long long now = tr[i].X - tr[i].cnt * U;
    long long las = tr[i - 1].X - tr[i - 1].cnt * U;
    long long l = tr[i - 1].ps + 1, r = tr[i].ps;
    long long cnt1 = (now - las + r - l + 1) / 2;
    for (long long j = l; j <= Min(r, l + cnt1 - 1); j++) Ans1[j] = 1;
  }
  if (tr[N].ps != Len) {
    long long l = tr[N].ps + 1, r = Len;
    long long cnt1 = (U - (tr[N].X - tr[N].cnt * U) + r - l + 1) / 2;
    for (long long j = l; j <= Min(Len, l + cnt1 - 1); j++) Ans1[j] = 1;
  }
}
void solveY(long long U) {
  for (long long i = 1; i <= N; i++) {
    if (tr[i].ps == tr[i - 1].ps) continue;
    long long now = tr[i].Y - tr[i].cnt * U;
    long long las = tr[i - 1].Y - tr[i - 1].cnt * U;
    long long l = tr[i - 1].ps + 1, r = tr[i].ps;
    long long cnt1 = (now - las + r - l + 1) / 2;
    for (long long j = l; j <= Min(r, l + cnt1 - 1); j++) Ans2[j] = 1;
  }
  if (tr[N].ps != Len) {
    long long l = tr[N].ps + 1, r = Len;
    long long cnt1 = (U - (tr[N].Y - tr[N].cnt * U) + r - l + 1) / 2;
    for (long long j = l; j <= Min(Len, l + cnt1 - 1); j++) Ans2[j] = 1;
  }
}
long long Sx[MAXL], Sy[MAXL], Lx, Rx, Ly, Ry;
signed main() {
  N = read(), Len = read();
  for (long long i = 1; i <= N; i++) {
    T[i] = read(), X[i] = read(), Y[i] = read();
    long long t = T[i] - T[i - 1], dis = X[i] + Y[i] - X[i - 1] - Y[i - 1];
    if (dis < 0) dis = -dis;
    if ((t & 1ll) != (dis & 1ll)) print();
  }
  for (long long i = 1; i <= N; i++)
    tr[i].id = i, tr[i].X = (X[i] + Y[i]), tr[i].Y = (X[i] - Y[i]),
    tr[i].tim = T[i], tr[i].ps = ((T[i] % Len) ? T[i] % Len : Len),
    tr[i].cnt = (T[i] - 1) / Len;
  sort(tr + 1, tr + N + 1, cmp);
  long long L = -Len, R = Len, ans = INT_MAX;
  for (long long i = 1; i <= N; i++)
    L = max(L, (tr[i].X - (Len - tr[i].ps)) / (tr[i].cnt + 1)),
    R = min(R, (tr[i].X + (Len - tr[i].ps)) / (tr[i].cnt + 1));
  for (long long i = 1; i <= N; i++) {
    if (tr[i].ps == tr[i - 1].ps) {
      ans = (tr[i].X - tr[i - 1].X) / (tr[i].cnt - tr[i - 1].cnt);
      break;
    }
    long long MMax = tr[i].ps - tr[i - 1].ps - tr[i].X + tr[i - 1].X,
              MMin = (tr[i - 1].ps - tr[i].ps - tr[i].X + tr[i - 1].X);
    long long p = -tr[i].cnt + tr[i - 1].cnt;
    if (!p) {
      if (MMin > MMax) print();
      continue;
    }
    if (p < 0) {
      L = Max(L, ceil(1.0 * MMax / p)), R = Min(R, floor(1.0 * MMin / p));
    }
    if (p > 0) {
      L = Max(L, ceil(1.0 * MMin / p)), R = Min(R, floor(1.0 * MMax / p));
    }
  }
  if (L > R) print();
  if (ans != INT_MAX)
    Lx = Rx = ans;
  else
    Lx = L, Rx = R;
  bool P = 0;
  for (long long p = Rx - 3; p <= Rx; p++) {
    memset(Ans1, -1, sizeof(Ans1));
    solveX(p);
    Sx[0] = 0;
    for (long long i = 1; i <= Len; i++) Sx[i] = Sx[i - 1] + Ans1[i];
    bool ff = 1;
    for (long long i = 1; i <= N; i++) {
      long long WW = Sx[tr[i].ps] + tr[i].cnt * Sx[Len];
      if (WW != tr[i].X) {
        ff = 0;
        break;
      }
    }
    if (!ff) continue;
    P = 1;
    break;
  }
  if (!P) print();
  L = -Len, R = Len, ans = INT_MAX;
  for (long long i = 1; i <= N; i++)
    L = max(L, (tr[i].Y - (Len - tr[i].ps)) / (tr[i].cnt + 1)),
    R = min(R, (tr[i].Y + (Len - tr[i].ps)) / (tr[i].cnt + 1));
  for (long long i = 1; i <= N; i++) {
    if (tr[i].ps == tr[i - 1].ps) {
      ans = (tr[i].Y - tr[i - 1].Y) / (tr[i].cnt - tr[i - 1].cnt);
      break;
    }
    long long MMax = tr[i].ps - tr[i - 1].ps - tr[i].Y + tr[i - 1].Y,
              MMin = (tr[i - 1].ps - tr[i].ps - tr[i].Y + tr[i - 1].Y);
    long long p = -tr[i].cnt + tr[i - 1].cnt;
    if (!p) {
      if (MMin > MMax) print();
      continue;
    }
    if (p < 0) {
      L = Max(L, ceil(1.0 * MMax / p)), R = Min(R, floor(1.0 * MMin / p));
    } else {
      L = Max(L, ceil(1.0 * MMin / p)), R = Min(R, floor(1.0 * MMax / p));
    }
  }
  if (L > R) print();
  if (ans != INT_MAX)
    Ly = Ry = ans;
  else
    Ly = L, Ry = R;
  P = 0;
  for (long long p = Ry - 3; p <= Ry; p++) {
    memset(Ans2, -1, sizeof(Ans1));
    solveY(p);
    Sy[0] = 0;
    for (long long i = 1; i <= Len; i++) Sy[i] = Sy[i - 1] + Ans2[i];
    bool ff = 1;
    for (long long i = 1; i <= N; i++) {
      long long WW = Sy[tr[i].ps] + tr[i].cnt * Sy[Len];
      if (WW != tr[i].Y) {
        ff = 0;
        break;
      }
    }
    if (!ff) continue;
    P = 1;
    break;
  }
  if (!P) print();
  for (long long i = 1; i <= Len; i++) {
    if (Ans1[i] == 1 && Ans2[i] == 1) putchar('R');
    if (Ans1[i] == 1 && Ans2[i] == -1) putchar('U');
    if (Ans1[i] == -1 && Ans2[i] == 1) putchar('D');
    if (Ans1[i] == -1 && Ans2[i] == -1) putchar('L');
  }
  printf("\n");
  return 0;
}
