#include <bits/stdc++.h>
using namespace std;
struct TEvent {
  long long x = 0, y = 0, t = 0;
};
const long long INF = LLONG_MAX / 2;
void assign_max(long long& v, long long candidate) {
  if (candidate > v) v = candidate;
}
void assign_min(long long& v, long long candidate) {
  if (candidate < v) v = candidate;
}
inline long long lbdiv(long long a, long long b) {
  if (a >= 0)
    return a / b;
  else
    return (a - b + 1) / b;
}
inline long long ubdiv(long long a, long long b) {
  if (a >= 0)
    return (a + b - 1) / b;
  else
    return a / b;
}
int main(void) {
  ios::sync_with_stdio(false);
  int l, n;
  cin >> n >> l;
  vector<TEvent> events(n);
  for (auto& ev : events) {
    cin >> ev.t >> ev.x >> ev.y;
  }
  ++n;
  events.push_back(TEvent());
  sort(events.begin(), events.end(),
       [l](const TEvent& left, const TEvent& right) {
         return left.t % l < right.t % l;
       });
  bool collision_found = false;
  long long total_dx = 0, total_dy = 0;
  long long min_sum = -INF, max_sum = INF, min_diff = -INF, max_diff = INF;
  for (int i = 0; i < n; ++i) {
    int im1 = i ? (i - 1) : (n - 1);
    long long dt = events[i].t - events[im1].t;
    long long dx = events[i].x - events[im1].x;
    long long dy = events[i].y - events[im1].y;
    if (dt < 0) {
      dt *= -1;
      dx *= -1;
      dy *= -1;
    }
    if (abs(dx) + abs(dy) > dt) {
      cout << "NO" << endl;
      return 0;
    }
    long long d_low_cycles = lbdiv(dt, l);
    long long d_high_cycles = ubdiv(dt, l);
    long long low_spread = dt - l * d_low_cycles;
    long long high_spread = l * d_high_cycles - dt;
    if (d_low_cycles != 0) {
      assign_max(min_sum, ubdiv(dx + dy - low_spread, d_low_cycles));
      assign_min(max_sum, lbdiv(dx + dy + low_spread, d_low_cycles));
      assign_max(min_diff, ubdiv(dx - dy - low_spread, d_low_cycles));
      assign_min(max_diff, lbdiv(dx - dy + low_spread, d_low_cycles));
    }
    if (d_high_cycles != 0) {
      assign_max(min_sum, ubdiv(dx + dy - high_spread, d_high_cycles));
      assign_min(max_sum, lbdiv(dx + dy + high_spread, d_high_cycles));
      assign_max(min_diff, ubdiv(dx - dy - high_spread, d_high_cycles));
      assign_min(max_diff, lbdiv(dx - dy + high_spread, d_high_cycles));
    }
  }
  if ((min_sum + l) % 2 != 0) ++min_sum;
  if ((min_diff + l) % 2 != 0) ++min_diff;
  if ((max_sum + l) % 2 != 0) --max_sum;
  if ((max_diff + l) % 2 != 0) --max_diff;
  if (max_diff < min_diff || max_sum < min_sum) {
    cout << "NO" << endl;
    return 0;
  }
  long long actual_dx = (min_diff + min_sum) / 2;
  long long actual_dy = (min_sum - min_diff) / 2;
  for (auto& ev : events) {
    long long c = ev.t / l;
    ev.t %= l;
    ev.x -= c * actual_dx;
    ev.y -= c * actual_dy;
  }
  events.push_back(TEvent());
  events.back().t = l;
  events.back().x = actual_dx;
  events.back().y = actual_dy;
  ostringstream oss;
  long long cx = 0, cy = 0, ct = 0;
  for (const auto& ev : events) {
    for (; ct < ev.t; ++ct) {
      if (cx < ev.x) {
        ++cx;
        oss << 'R';
      } else if (cx > ev.x) {
        --cx;
        oss << 'L';
      } else if (cy > ev.y) {
        --cy;
        oss << 'D';
      } else {
        ++cy;
        oss << 'U';
      }
    }
    if (cx != ev.x || cy != ev.y) {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << oss.str() << endl;
  return 0;
}
