#include <bits/stdc++.h>
using namespace std;
int n, m, a[2][2000000 + 5], vis[2000000 + 5];
long long t[2000000 + 5], pos[2][2000000 + 5];
int tt;
struct Node {
  long long a, b, c;
} ord[2000000 + 5];
template <class T>
void read(T &x) {
  char ch;
  bool ok;
  for (ok = 0, ch = getchar(); !isdigit(ch); ch = getchar())
    if (ch == '-') ok = 1;
  for (x = 0; isdigit(ch); x = x * 10 + ch - '0', ch = getchar())
    ;
  if (ok) x = -x;
}
int L, R;
void get_rge(long long x, long long y, long long z) {
  if (!x) return;
  long double l = (long double)(z - y) / x, r = (long double)(-z - y) / x;
  if (l > r) swap(l, r);
  L = max(L, (int)ceil(l - 1e-12));
  R = min(R, (int)floor(r + 1e-12));
}
int fl = 1;
void sol(int ty) {
  memset(vis, 0, sizeof vis);
  memset(ord, 0, sizeof ord);
  for (int i = (1), en = (n); i <= en; ++i) {
    long long a = -t[i] / m, to = t[i] % m;
    if (to == m - 1) {
      if (vis[to]) {
        if (pos[ty][i] / (-a + 1) != ord[to].b) {
          fl = 0;
          return;
        }
      } else {
        vis[to] = 1;
        ord[to].b = pos[ty][i] / (-a + 1);
      }
      continue;
    }
    if (vis[to]) {
      if (ord[to].a == a && ord[to].b != pos[ty][i]) {
        fl = 0;
        return;
      }
      if ((pos[ty][i] - ord[to].b) % (ord[to].a - a)) {
        fl = 0;
        return;
      }
      long long tem = (pos[ty][i] - ord[to].b) / (ord[to].a - a);
      if (vis[m - 1] && ord[m - 1].b != tem) {
        fl = 0;
        return;
      }
      vis[m - 1] = 1;
      ord[m - 1] = (Node){0, tem};
    } else {
      vis[to] = 1;
      ord[to] = (Node){a, pos[ty][i]};
    }
  }
  L = ord[m - 1].b;
  R = ord[m - 1].b;
  if (!vis[m - 1]) {
    L = -0x3f3f3f3f;
    R = 0x3f3f3f3f;
    int pre = -1;
    for (int i = (1), en = (m - 2); i <= en; ++i)
      if (vis[i]) {
        get_rge(ord[i].a - ord[pre == -1 ? m : pre].a,
                ord[i].b - ord[pre == -1 ? m : pre].b, i - pre);
        pre = i;
      }
    get_rge(1 - ord[pre == -1 ? m : pre].a, -ord[pre == -1 ? m : pre].b,
            m - 1 - pre);
    if (L > R) {
      fl = 0;
      return;
    }
    ord[m - 1].b = L;
    vis[m - 1] = 1;
  }
  ord[m - 1].c = ord[m - 1].b;
  long long tem = ord[m - 1].c, pre = -1;
  for (int i = (0), en = (m - 1); i <= en; ++i)
    if (vis[i]) {
      if (i != m - 1) ord[i].c = tem * ord[i].a + ord[i].b;
      if ((ord[i].c - ord[pre == -1 ? m : pre].c + i - pre) % 2) break;
      long long tem1 = (ord[i].c - ord[pre == -1 ? m : pre].c + i - pre) / 2;
      if (tem1 > i - pre) {
        fl = 0;
        return;
      }
      for (int j = (pre + 1), en = (pre + tem1); j <= en; ++j) a[ty][j] = 1;
      pre = i;
      if (i == m - 1) return;
    }
  if (tem + 1 >= L && tem + 1 <= R) {
    memset(a[ty], 0, sizeof a[ty]);
    tem = ++ord[m - 1].c;
    pre = -1;
    for (int i = (0), en = (m - 1); i <= en; ++i)
      if (vis[i]) {
        if (i != m - 1) ord[i].c = tem * ord[i].a + ord[i].b;
        if ((ord[i].c - ord[pre == -1 ? m : pre].c + i - pre) % 2) {
          fl = 0;
          return;
        }
        long long tem1 = (ord[i].c - ord[pre == -1 ? m : pre].c + i - pre) / 2;
        if (tem1 > i - pre) {
          fl = 0;
          return;
        }
        for (int j = (pre + 1), en = (pre + tem1); j <= en; ++j) a[ty][j] = 1;
        pre = i;
      }
  } else
    fl = 0;
}
int main() {
  read(n);
  read(m);
  for (int i = (1), en = (n); i <= en; ++i) {
    long long x, y;
    read(t[i]);
    read(x);
    read(y);
    t[i]--;
    if (i == 2) tt = y;
    long long tem = x;
    x = x + y;
    y = tem - y;
    pos[0][i] = x;
    pos[1][i] = y;
  }
  sol(1);
  if (!fl) {
    puts("NO");
    return 0;
  }
  sol(0);
  if (!fl) {
    puts("NO");
    return 0;
  }
  for (int i = (0), en = (m - 1); i <= en; ++i) {
    if (!a[0][i] && !a[1][i]) putchar('L');
    if (!a[0][i] && a[1][i]) putchar('D');
    if (a[0][i] && !a[1][i]) putchar('U');
    if (a[0][i] && a[1][i]) putchar('R');
  }
  return 0;
}
