Problem: Help! A robot escaped our lab and we need help finding it. 

The lab is at the point (0, 0) of the coordinate plane, at time 0 the robot was there. The robot's movements are defined by a program — a string of length l, consisting of characters U, L, D, R. Each second the robot executes the next command in his program: if the current coordinates of the robot are (x, y), then commands U, L, D, R move it to cells (x, y + 1), (x - 1, y), (x, y - 1), (x + 1, y) respectively. The execution of the program started at time 0. The program is looped, i.e. each l seconds of executing the program start again from the first character. Unfortunately, we don't know what program was loaded into the robot when he left the lab.

Our radars managed to find out the position of the robot at n moments of time: we know that at the moment of time ti the robot is at the point (xi, yi). Given this data, either help to determine what program could be loaded into the robot, or determine that no possible program meets the data and the robot must have broken down.

Input

The first line of the input contains two space-separated integers n and l (1 ≤ n ≤ 2·105, 1 ≤ l ≤ 2·106).

Next n lines contain three space-separated integers — ti, xi, yi (1 ≤ ti ≤ 1018,  - 1018 ≤ xi, yi ≤ 1018). The radar data is given chronologically, i.e. ti < ti + 1 for all i from 1 to n - 1.

Output

Print any of the possible programs that meet the data. If no program meets the data, print a single word 'NO' (without the quotes).

Examples

Input

3 3
1 1 0
2 1 -1
3 0 -1


Output

RDL


Input

2 2
1 1 0
999 1 0


Output

RL


Input

2 5
10 10 0
20 0 0


Output

NO

Solution (in CPP):

Solution:
#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;
}