#include <bits/stdc++.h>
using namespace std;
const int maxn = 200010;
const int maxl = 2000010;
const int inf = 0x3f3f3f3f;
int vis[maxl], n, l;
long long cx[maxl], cy[maxl], k[maxl];
int t_x[maxl], t_y[maxl];
int ra = -1, rb = -1;
long long lb_a, rb_a, lb_b, rb_b;
int found;
long long vx, vy;
string ans;
long long lceil(double x) { return (long long)ceil(x); }
long long lfloor(double x) { return (long long)floor(x); }
void calans() {
  int last = 0, cur_x = 0, cur_y = 0;
  for (int i = 1; i <= l; i++) {
    if (vis[i]) {
      int x = t_x[i], y = t_y[i];
      if (abs(x - cur_x) + abs(y - cur_y) <= i - last) {
        int cnt = i - last;
        while (x < cur_x) {
          ans.push_back('L');
          --cur_x;
          cnt--;
        }
        while (x > cur_x) {
          ans.push_back('R');
          ++cur_x;
          cnt--;
        }
        while (y < cur_y) {
          ans.push_back('D');
          --cur_y;
          cnt--;
        }
        while (y > cur_y) {
          ans.push_back('U');
          ++cur_y;
          cnt--;
        }
        if (cnt & 1) {
          puts("NO");
          exit(0);
        }
        while (cnt) {
          ans.push_back('L');
          ans.push_back('R');
          cnt -= 2;
        }
        cur_x = x, cur_y = y, last = i;
      } else {
        puts("NO");
        exit(0);
      }
    }
  }
}
int main() {
  scanf("%d%d", &n, &l);
  vis[0] = 1;
  lb_a = lb_b = -inf;
  rb_a = rb_b = inf;
  for (int i = 1; i <= n; i++) {
    long long t, x, y;
    scanf("%lld%lld%lld", &t, &x, &y);
    if ((((x + y) % 2 + 2) ^ t) & 1) {
      puts("NO");
      return 0;
    }
    if (vis[t % l]) {
      if (t / l == k[t % l]) {
        if (cx[t % l] == x && cy[t % l] == y) {
          continue;
        } else {
          puts("NO");
          return 0;
        }
      } else {
        if ((cx[t % l] - x) % (k[t % l] - t / l)) {
          puts("NO");
          return 0;
        }
        if ((cy[t % l] - y) % (k[t % l] - t / l)) {
          puts("NO");
          return 0;
        }
        long long _vx = (cx[t % l] - x) / (k[t % l] - t / l);
        long long _vy = (cy[t % l] - y) / (k[t % l] - t / l);
        if (found) {
          if (vx != _vx || vy != _vy) {
            puts("NO");
            return 0;
          }
        } else {
          vx = _vx;
          vy = _vy;
          found = 1;
        }
      }
    } else {
      vis[t % l] = 1;
      cx[t % l] = x, cy[t % l] = y;
      k[t % l] = t / l;
    }
  }
  if (!found) {
    vis[l] = 1;
    cx[l] = cy[l] = 0;
    k[l] = -1;
    int last = 0;
    for (int i = 1; i <= l; i++) {
      if (vis[i]) {
        if (k[i] < k[last]) {
          rb_a = min(rb_a, lfloor(1.0 *
                                  (i - last -
                                   ((cx[i] - cy[i]) - (cx[last] - cy[last]))) /
                                  (k[last] - k[i])));
          lb_a =
              max(lb_a,
                  lceil(1.0 *
                        (last - i - ((cx[i] - cy[i]) - (cx[last] - cy[last]))) /
                        (k[last] - k[i])));
          rb_b = min(rb_b, lfloor(1.0 *
                                  (i - last -
                                   ((cx[i] + cy[i]) - (cx[last] + cy[last]))) /
                                  (k[last] - k[i])));
          lb_b =
              max(lb_b,
                  lceil(1.0 *
                        (last - i - ((cx[i] + cy[i]) - (cx[last] + cy[last]))) /
                        (k[last] - k[i])));
        } else if (k[i] > k[last]) {
          rb_a = min(rb_a, lfloor(1.0 *
                                  (last - i -
                                   ((cx[i] - cy[i]) - (cx[last] - cy[last]))) /
                                  (k[last] - k[i])));
          lb_a =
              max(lb_a,
                  lceil(1.0 *
                        (i - last - ((cx[i] - cy[i]) - (cx[last] - cy[last]))) /
                        (k[last] - k[i])));
          rb_b = min(rb_b, lfloor(1.0 *
                                  (last - i -
                                   ((cx[i] + cy[i]) - (cx[last] + cy[last]))) /
                                  (k[last] - k[i])));
          lb_b =
              max(lb_b,
                  lceil(1.0 *
                        (i - last - ((cx[i] + cy[i]) - (cx[last] + cy[last]))) /
                        (k[last] - k[i])));
        } else {
          long long ta = (cx[i] - cy[i]) - (cx[last] - cy[last]);
          long long tb = (cx[i] + cy[i]) - (cx[last] + cy[last]);
          if (ta > i - last || ta < last - i || tb > i - last ||
              tb < last - i) {
            puts("NO");
            return 0;
          }
        }
        if ((k[i] ^ k[last]) & 1) {
          ra = rb = ((i - last) ^ cx[i] ^ cy[i] ^ cx[last] ^ cy[last]) & 1;
        }
        last = i;
      }
    }
    if (ra >= 0 && ((lb_a ^ ra) & 1)) ++lb_a;
    if (rb >= 0 && ((lb_b ^ rb) & 1)) ++lb_b;
    if (ra >= 0 && ((rb_a ^ ra) & 1)) --rb_a;
    if (rb >= 0 && ((rb_b ^ rb) & 1)) ++rb_b;
    if (lb_a > rb_a || lb_b > rb_b) {
      puts("NO");
      return 0;
    }
    if ((lb_a + lb_b) & 1) {
      if (!ra && lb_a + 1 <= rb_a) {
        lb_a++;
      } else if (!rb && lb_b + 1 <= rb_b) {
        lb_b++;
      } else {
        puts("NO");
        return 0;
      }
    }
    vx = (lb_a + lb_b) / 2;
    vy = (lb_b - lb_a) / 2;
  }
  vis[l] = 1;
  t_x[l] = vx, t_y[l] = vy;
  for (int i = 1; i < l; i++) {
    long double _x = cx[i] - (long double)k[i] * vx;
    long double _y = cy[i] - (long double)k[i] * vy;
    if (_x + _y > i || _x + _y < -i) {
      puts("NO");
      return 0;
    }
    t_x[i] = cx[i] - k[i] * vx;
    t_y[i] = cy[i] - k[i] * vy;
  }
  calans();
  cout << ans << endl;
  return 0;
}
