#include <bits/stdc++.h>
using namespace std;
template <typename T>
T MAX(T a, T b) {
  return (a > b) ? a : b;
}
template <typename T>
T MIN(T a, T b) {
  return (a < b) ? a : b;
}
template <typename T>
void UMAX(T &a, T b) {
  a = (a > b ? a : b);
}
template <typename T>
void UMIN(T &a, T b) {
  a = (a < b ? a : b);
}
int readint() {
  char c = getchar();
  int ret = 0;
  while (!(c >= '0' && c <= '9')) c = getchar();
  while (c >= '0' && c <= '9') {
    ret = ret * 10 + c - '0';
    c = getchar();
  }
  return ret;
}
void putint(int v) {
  if (!v) {
    putchar('0');
    return;
  }
  if (v >= 10) putint(v / 10);
  putchar('0' + (v % 10));
}
int n, l, dir[2][2000005], p[200005];
long long t[200005], x[200005], y[200005];
bool cmp(int a, int b) { return t[a] % (long long)l < t[b] % (long long)l; }
long long divceil(long long a, long long b) {
  if (b < 0ll) a = -a, b = -b;
  if (a >= 0ll) return (a + b - 1ll) / b;
  return -((-a) / b);
}
long long divfloor(long long a, long long b) {
  if (b < 0ll) a = -a, b = -b;
  if (a >= 0ll) return a / b;
  return -divceil(-a, b);
}
void make(int *tar, int l, int r, int s) {
  if (l > r) return;
  int len = r - l + 1, num1 = (len + s) / 2, i;
  for (i = 0; i < num1; ++i) tar[l + i] = 1;
  for (i = num1; i < len; ++i) tar[l + i] = -1;
}
bool calc(long long *x, int *tar) {
  int i, j, k;
  for (i = 0; i < n; ++i) {
    p[i] = i;
    if ((abs(x[i]) & 1ll) != (t[i] & 1ll)) return 0;
  }
  sort(p, p + n, cmp);
  long long lst = 0ll, lsk = 0ll, lsb = 0ll;
  long long mn = (long long)-l, mx = (long long)l;
  for (i = 0; i < n; ++i) {
    int d = p[i];
    long long ck = -(t[d] / (long long)l), cb = x[d];
    long long coe = ck - lsk,
              rngL = lsb - cb - (t[d] % (long long)l) + (lst % (long long)l),
              rngR = lsb - cb + (t[d] % (long long)l) - (lst % (long long)l);
    if (coe < 0ll) {
      coe = -coe;
      rngL = -rngL;
      rngR = -rngR;
      swap(rngL, rngR);
    }
    lst = t[d];
    lsk = ck;
    lsb = cb;
    if (!coe) {
      if (rngL <= 0ll && rngR >= 0ll) continue;
      return 0;
    }
    UMAX(mn, divceil(rngL, coe));
    UMIN(mx, divfloor(rngR, coe));
  }
  long long coe = 1ll - lsk, rngL = -(long long)l + (lst % (long long)l) + lsb,
            rngR = (long long)l - (lst % (long long)l) + lsb;
  if (coe < 0ll) {
    coe = -coe;
    rngL = -rngL;
    rngR = -rngR;
    swap(rngL, rngR);
  }
  if (!coe) {
    if (!(rngL <= 0ll && rngR >= 0ll)) return 0;
  } else {
    UMAX(mn, divceil(rngL, coe));
    UMIN(mx, divfloor(rngR, coe));
  }
  if ((abs(mn) & 1ll) != (long long)(l & 1)) ++mn;
  if (mn > mx) return 0;
  lst = 1ll;
  long long lsp = 0ll;
  for (i = 0; i < n; ++i) {
    int d = p[i];
    long long ck = -(t[d] / (long long)l), cb = x[d], cp = ck * mn + cb;
    make(tar, lst, t[d] % (long long)l, cp - lsp);
    lsp = cp;
    lst = (t[d] % (long long)l) + 1ll;
  }
  make(tar, lst, l, mn - lsp);
  return 1;
}
int main() {
  int i, j, k;
  scanf("%d%d", &n, &l);
  for (i = 0; i < n; ++i) {
    scanf("%I64d%I64d%I64d", t + i, x + i, y + i);
    x[i] = x[i] + y[i];
    y[i] = x[i] - y[i] - y[i];
  }
  if (!calc(x, dir[0]) || !calc(y, dir[1]))
    printf("NO\n");
  else {
    for (i = 1; i <= l; ++i) {
      if (dir[0][i] == 1 && dir[1][i] == 1)
        printf("R");
      else if (dir[0][i] == 1 && dir[1][i] == -1)
        printf("U");
      else if (dir[0][i] == -1 && dir[1][i] == 1)
        printf("D");
      else
        printf("L");
    }
    printf("\n");
  }
  return 0;
}
