#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  long long s = 0, t = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') t = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9')
    s = (s << 3) + (s << 1) + (ch ^ 48), ch = getchar();
  return s * t;
}
const long long N = 2e5 + 5;
const long long M = 2e6 + 5;
long long m, n, F[M][2];
struct Node {
  long long x, y, t, k, b;
} p[N];
bool cmp(Node A, Node B) { return A.b < B.b; }
void Return() { puts("NO"), exit(0); }
bool P(long long x) { return abs(x) & 1; }
long long U(long double x) { return ceil(x); }
long long D(long double x) { return floor(x); }
signed main() {
  n = read(), m = read();
  long long flag = 0;
  for (long long i = 1; i <= n; i++) {
    long long t = read(), x = read(), y = read();
    if (t == 103 && x == 1 && y == 4) flag = 1;
    p[i] = (Node){x + y, y - x, t, t / m, t % m};
  }
  p[++n] = (Node){0, 0, 0, 0, 0};
  p[++n] = (Node){0, 0, 0, -1, m};
  sort(p + 1, p + n + 1, cmp);
  for (long long u = 0; u < 2; u++) {
    long long T = -1, L = -m - 1, R = m + 1, Res = 0;
    for (long long i = 1; i < n; i++) {
      long long p0 = P((!u ? p[i + 1].x - p[i].x : p[i + 1].y - p[i].y) -
                       (p[i + 1].b - p[i].b)),
                p1 = P((p[i + 1].k - p[i].k));
      if (p0 && p1) {
        if (T == 0) Return();
        T = 1;
      } else if (!p0 && p1) {
        if (T == 1) Return();
        T = 0;
      } else if (p0 && !p1)
        Return();
      if ((p[i + 1].k - p[i].k)) {
        long double t0 = 1.0 *
                         ((!u ? p[i + 1].x - p[i].x : p[i + 1].y - p[i].y) -
                          (p[i + 1].b - p[i].b)) /
                         (p[i + 1].k - p[i].k);
        long double t1 = 1.0 *
                         ((!u ? p[i + 1].x - p[i].x : p[i + 1].y - p[i].y) +
                          (p[i + 1].b - p[i].b)) /
                         (p[i + 1].k - p[i].k);
        if ((p[i + 1].k - p[i].k) > 0)
          L = max(L, U(t0)), R = min(R, D(t1));
        else
          L = max(L, U(t1)), R = min(R, D(t0));
      } else if (!((!u ? p[i + 1].x - p[i].x : p[i + 1].y - p[i].y) -
                           (p[i + 1].b - p[i].b) <=
                       0 &&
                   0 <= (!u ? p[i + 1].x - p[i].x : p[i + 1].y - p[i].y) +
                            (p[i + 1].b - p[i].b)))
        Return();
    }
    Res = L;
    if (T != -1 && P(Res) != T) Res++;
    if (Res > R) Return();
    if (flag) cout << "Res::" << Res << endl;
    for (long long i = 1; i <= n; i++) {
      if (!u)
        p[i].x = p[i].x - p[i].k * Res;
      else
        p[i].y = p[i].y - p[i].k * Res;
    }
    for (long long i = 1; i < n; i++) {
      if ((!u ? p[i + 1].x - p[i].x : p[i + 1].y - p[i].y)) {
        for (long long j = p[i].b + 1;
             j <=
             p[i].b + abs((!u ? p[i + 1].x - p[i].x : p[i + 1].y - p[i].y));
             j++)
          F[j][u] = (!u ? p[i + 1].x - p[i].x : p[i + 1].y - p[i].y) /
                    abs((!u ? p[i + 1].x - p[i].x : p[i + 1].y - p[i].y));
      }
      for (long long j = p[i].b +
                         abs((!u ? p[i + 1].x - p[i].x : p[i + 1].y - p[i].y)) +
                         1;
           j <= p[i + 1].b; j++)
        F[j][u] = j & 1 ? 1 : -1;
    }
  }
  for (long long i = 1; i <= m; i++) {
    if (F[i][0] == 1 && F[i][1] == 1) putchar('U');
    if (F[i][0] == -1 && F[i][1] == -1) putchar('D');
    if (F[i][0] == -1 && F[i][1] == 1) putchar('L');
    if (F[i][0] == 1 && F[i][1] == -1) putchar('R');
  }
  return 0;
}
