#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using vll = vector<LL>;
using vb = vector<bool>;
struct S {
  LL t, k, x;
};
using vs = vector<S>;
void no() {
  cout << "NO\n";
  exit(0);
}
LL floordiv(LL a, LL b) { return (a - (a % b + b) % b) / b; }
LL ceildiv(LL a, LL b) { return (a + (b - a % b) % b) / b; }
vb solve(int l, vs &v) {
  vb r(l);
  sort((v).begin(), (v).end(), [](S a, S b) { return a.t < b.t; });
  S ls = {0, 0, 0};
  LL lo = 0, hi = l;
  v.push_back({l, -1, 0});
  for (S &cr : v) {
    LL p = cr.k - ls.k, q = cr.x - ls.x, d = cr.t - ls.t;
    if (p > 0) {
      lo = max(lo, ceildiv(q - d, p));
      hi = min(hi, floordiv(q, p));
    } else if (p < 0) {
      hi = min(hi, floordiv(q - d, p));
      lo = max(lo, ceildiv(q, p));
    } else if (q < 0 || q > d)
      no();
    ls = cr;
  }
  if (lo > hi) no();
  LL sl = lo, prs = 0, prt = 0;
  for (S &cr : v) {
    LL s = cr.x - sl * cr.k;
    if (cr.t == prt && s != prs) no();
    for (int i = prt; i < prt + s - prs; i++) r[i] = 1;
    prs = s, prt = cr.t;
  }
  return r;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0);
  int n, l;
  cin >> n >> l;
  vs a(n), b(n);
  for (int i = 0; i < (n); i++) {
    LL t, x, y, p, q;
    cin >> t >> x >> y;
    p = x + y + t, q = x - y + t;
    if (p & 1) no();
    for (int k : {0, 1}) (k ? a : b)[i] = {t % l, t / l, (k ? p : q) / 2};
  }
  vb x = solve(l, a), y = solve(l, b);
  for (int i = 0; i < (l); i++) cout << "LDUR"[2 * x[i] | y[i]];
  cout << '\n';
}
