#include <bits/stdc++.h>
using namespace std;
const int MAXBUF = 1 << 23;
char B[MAXBUF], *Si = B, *Ti = B;
inline char getc() {
  if (Si == Ti) Ti = (Si = B) + fread(B, 1, MAXBUF, stdin);
  if (Si == Ti)
    return 0;
  else
    return *Si++;
}
template <class T>
inline void read(T &a) {
  static char c;
  static int fh;
  while (((c = getc()) < '0' || c > '9') && c != '-')
    ;
  if (c == '-')
    fh = -1, a = 0;
  else
    fh = 1, a = c - '0';
  while ((c = getc()) <= '9' && c >= '0') a = (a << 3) + (a << 1) + c - '0';
  if (fh == -1) a = -a;
}
struct node {
  long long t, x, y, te, rm;
} a[200005];
long long t[200005], x[200005], y[200005], tx[200005], ty[200005];
bool ans1[2000005], ans2[2000005];
int c1 = 0, c2 = 0;
inline bool cmp(node a, node b) { return a.rm < b.rm; }
int main() {
  int i, j, k, n;
  long long l, p, q;
  read(n);
  read(l);
  for (i = 1; i <= n; i++) {
    read(a[i].t);
    read(tx[i]);
    read(ty[i]);
    a[i].x = tx[i] + ty[i];
    a[i].y = tx[i] - ty[i];
    a[i].te = a[i].t / l;
    a[i].rm = a[i].t - a[i].te * l;
    if ((a[i].x & 1) != (a[i].t & 1)) {
      puts("NO");
      return 0;
    }
    if ((a[i].y & 1) != (a[i].t & 1)) {
      puts("NO");
      return 0;
    }
  }
  long long xmin = -l, xmax = l, ymin = -l, ymax = l;
  sort(a + 1, a + n + 1, cmp);
  a[n + 1].rm = l;
  a[n + 1].te = -1;
  a[n + 1].x = 0;
  a[n + 1].y = 0;
  for (i = 1; i <= n + 1; i++) {
    long long lm = a[i].rm - a[i - 1].rm, up, dw, lx, rx, ly, ry, ko, bo;
    ko = a[i].te - a[i - 1].te;
    bo = a[i - 1].x - a[i].x;
    if (ko == 0) {
      if (bo > lm || bo < -lm) {
        puts("NO");
        return 0;
      }
      continue;
    }
    if (ko < 0) {
      ko = -ko;
      bo = -bo;
    }
    up = lm - bo;
    dw = -lm - bo;
    lx = dw / ko;
    rx = up / ko;
    while ((lx - 1) * ko >= dw) lx--;
    while (lx * ko < dw) lx++;
    while ((rx + 1) * ko <= up) rx++;
    while (rx * ko > up) rx--;
    if (lx > xmin) xmin = lx;
    if (rx < xmax) xmax = rx;
    if (xmin > xmax) {
      puts("NO");
      return 0;
    }
    ko = a[i].te - a[i - 1].te;
    bo = a[i - 1].y - a[i].y;
    if (ko < 0) {
      ko = -ko;
      bo = -bo;
    }
    up = lm - bo;
    dw = -lm - bo;
    ly = dw / ko;
    ry = up / ko;
    while ((ly - 1) * ko >= dw) ly--;
    while (ly * ko < dw) ly++;
    while ((ry + 1) * ko <= up) ry++;
    while (ry * ko > up) ry--;
    if (ly > ymin) ymin = ly;
    if (ry < ymax) ymax = ry;
    if (ymin > ymax) {
      puts("NO");
      return 0;
    }
  }
  for (p = xmax; p >= xmin; p--) {
    for (q = ymax; q >= ymin; q--) {
      bool tag = 1;
      c1 = c2 = 0;
      for (i = 1; i <= n + 1; i++) {
        t[i] = a[i].rm;
        x[i] = a[i].x - p * a[i].te;
        y[i] = a[i].y - q * a[i].te;
        t[n + 1] = l;
        x[n + 1] = p;
        y[n + 1] = q;
        long long ox = x[i] - x[i - 1], oy = y[i] - y[i - 1];
        bool xx = 0, yy = 0;
        if (ox < 0) ox = -ox, xx = 1;
        if (oy < 0) oy = -oy, yy = 1;
        long long rx = (t[i] - t[i - 1]) - ox, ry = (t[i] - t[i - 1]) - oy;
        if (rx & 1) {
          tag = 0;
          break;
        }
        if (ry & 1) {
          tag = 0;
          break;
        }
        if (rx < 0 || ry < 0) {
          tag = 0;
          break;
        }
        rx >>= 1;
        ry >>= 1;
        while (ox--) ans1[++c1] = xx;
        while (oy--) ans2[++c2] = yy;
        while (rx--) ans1[++c1] = 1, ans1[++c1] = 0;
        while (ry--) ans2[++c2] = 1, ans2[++c2] = 0;
      }
      if (!tag) continue;
      for (i = 1; i <= l; i++) {
        if (ans1[i] && ans2[i]) putchar('L');
        if (ans1[i] && (!ans2[i])) putchar('D');
        if ((!ans1[i]) && ans2[i]) putchar('U');
        if ((!ans1[i]) && (!ans2[i])) putchar('R');
      }
      exit(0);
    }
  }
  return 0;
}
