#include <bits/stdc++.h>
using namespace std;
int n, l;
class pt {
 public:
  long long x, y, k, t;
  int w;
  bool operator<(const pt &p) const { return w < p.w; }
} p[200010];
long long lx = -4e18, rx = 4e18, ly = -4e18, ry = 4e18;
int main() {
  scanf("%d%d", &n, &l);
  for (int i = 1; i <= n; i++) {
    long long a, b;
    scanf("%lld%lld%lld", &p[i].t, &a, &b);
    if ((a ^ b ^ p[i].t) & 1) {
      puts("NO");
      return 0;
    }
    p[i].k = p[i].t / l, p[i].w = p[i].t % l;
    p[i].x = (a + b + p[i].t) / 2;
    p[i].y = (b - a + p[i].t) / 2;
  }
  sort(p + 1, p + n + 1);
  p[++n].k = -1;
  p[n].w = l;
  for (int i = 1; i <= n; i++) {
    long long k = p[i].k - p[i - 1].k;
    long long w = p[i].w - p[i - 1].w;
    if (!k) {
      if (p[i].x - p[i - 1].x - w > 0 || p[i].x - p[i - 1].x < 0) {
        puts("NO");
        return 0;
      }
      if (p[i].y - p[i - 1].y - w > 0 || p[i].y - p[i - 1].y < 0) {
        puts("NO");
        return 0;
      }
    } else if (k > 0) {
      lx = max(lx, (long long)ceil((double)(p[i].x - p[i - 1].x - w) / k));
      rx = min(rx, (long long)floor((double)(p[i].x - p[i - 1].x) / k));
      ly = max(ly, (long long)ceil((double)(p[i].y - p[i - 1].y - w) / k));
      ry = min(ry, (long long)floor((double)(p[i].y - p[i - 1].y) / k));
    } else {
      k *= -1;
      lx = max(lx, (long long)ceil((double)(p[i - 1].x - p[i].x) / k));
      rx = min(rx, (long long)floor((double)(p[i - 1].x - p[i].x + w) / k));
      ly = max(ly, (long long)ceil((double)(p[i - 1].y - p[i].y) / k));
      ry = min(ry, (long long)floor((double)(p[i - 1].y - p[i].y + w) / k));
    }
  }
  if (lx > rx || ly > ry) {
    puts("NO");
    return 0;
  }
  for (int i = 1; i <= n; i++) {
    int dx = (p[i].x - p[i].k * lx) - (p[i - 1].x - p[i - 1].k * lx);
    int dy = (p[i].y - p[i].k * ly) - (p[i - 1].y - p[i - 1].k * ly);
    int t = p[i].w - p[i - 1].w, x = 0, y = 0;
    while (t--) {
      if (x < dx) {
        x++;
        if (y < dy)
          putchar('U'), ++y;
        else
          putchar('R');
      } else {
        if (y < dy)
          putchar('L'), ++y;
        else
          putchar('D');
      }
    }
  }
  return 0;
}
