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;
long l, n;
vector<long long> vt, vx, vy;
string result;
vector<long long> rx, ry, m;
long long xl, yl;
void no(string str) {
  cout << "NO";
  if ((n == 100) && (l == 1000000)) cout << endl << str;
  exit(0);
}
long long mabs(long long x) {
  if (x < 0)
    return -x;
  else
    return x;
}
bool find_l() {
  long long xl, yl;
  bool is_l = false;
  rx[0] = 0;
  ry[0] = 0;
  m[0] = 0;
  for (long i = 0; i < n; i++) {
    if ((vt[i] % 2) != (mabs(vx[i] + vy[i]) % 2)) no("reading");
    long long mi = vt[i] / l;
    long p = vt[i] % l;
    if (m[p] != -1) {
      if (is_l) {
        if ((rx[p] != vx[i] - xl * mi) || (ry[p] != vy[i] - yl * mi))
          no("diff point in p");
      } else {
        xl = (vx[i] - rx[p]) / (mi - m[p]);
        if ((vx[i] - rx[p]) % (mi - m[p])) no("can't find correct xl");
        yl = (vy[i] - ry[p]) / (mi - m[p]);
        if ((vy[i] - ry[p]) % (mi - m[p])) no("can't find correct yl");
        is_l = true;
        rx[l] = xl;
        ry[l] = yl;
        m[l] = 1;
        for (long j = 0; j < l; j++)
          if (m[j] > 0) {
            rx[j] -= xl * m[j];
            ry[j] -= yl * m[j];
            m[j] = 0;
          }
      }
    } else {
      if (is_l) {
        m[p] = 0;
        rx[p] = vx[i] - mi * xl;
        ry[p] = vy[i] - mi * yl;
      } else {
        m[p] = mi;
        rx[p] = vx[i];
        ry[p] = vy[i];
      }
    }
  }
  return is_l;
}
struct romb {
  long long x1, x2, y1, y2;
  void insert(long long x, long long y, long long delta, long long m) {
    if (m < 0) delta = -delta;
    x1 = (x - y - delta) / m;
    if ((x - y - delta) % m > 0) x1++;
    x2 = (x - y + delta) / m;
    if ((x - y + delta) % m < 0) x2--;
    y1 = (x + y - delta) / m;
    if ((x + y - delta) % m > 0) y1++;
    y2 = (x + y + delta) / m;
    if ((x + y + delta) % m < 0) y2--;
  }
};
bool merge(romb& r1, romb r2) {
  if (r1.x1 < r2.x1) r1.x1 = r2.x1;
  if (r2.x2 < r1.x2) r1.x2 = r2.x2;
  if (r1.x1 > r2.x2) return false;
  if (r1.y1 < r2.y1) r1.y1 = r2.y1;
  if (r2.y2 < r1.y2) r1.y2 = r2.y2;
  if (r1.y1 > r2.y2) return false;
  return true;
}
bool getXY(romb r, long long& x, long long& y) {
  long long xr = r.x1;
  long long yr = r.y1;
  if (mabs(yr % 2) != mabs(l % 2)) {
    if (r.y1 == r.y2)
      return false;
    else
      yr++;
  }
  if ((xr - yr) % 2) {
    if (r.x1 == r.x2)
      return false;
    else
      xr++;
  }
  x = xr - (xr - yr) / 2;
  y = yr - (xr + yr) / 2;
  return true;
}
void find_l2() {
  int p = 0;
  romb r, nr;
  r.x1 = -l;
  r.x2 = l;
  r.y1 = -l;
  r.y2 = l;
  for (int i = 1; i < l; i++) {
    if (m[i] != -1) {
      if (m[i] != m[p]) {
        nr.insert(rx[i] - rx[p], ry[i] - ry[p], i - p, m[i] - m[p]);
        if (!merge(r, nr)) no("incorrect merge");
      }
      p = i;
    }
  }
  nr.insert(rx[p], ry[p], l - p, m[p] + 1);
  if (!merge(r, nr)) no("incorrect last merge");
  if (!getXY(r, xl, yl)) no("incorrect getXY");
  rx[l] = xl;
  ry[l] = yl;
  m[l] = 1;
  for (long j = 0; j < l; j++)
    if (m[j] > 0) {
      rx[j] -= xl * m[j];
      ry[j] -= yl * m[j];
      m[j] = 0;
    }
}
void get_result(string& str) {
  str.resize(l);
  int p = 0;
  for (int i = 1; i <= l; i++) {
    if (m[i] != -1) {
      if ((i - p) < (mabs(rx[i] - rx[p]) + mabs(ry[i] - ry[p])))
        no("incorrect distance");
      int k = p;
      if (rx[i] > rx[p])
        for (int j = 0; j < (rx[i] - rx[p]); j++) str[j + k] = 'R';
      if (rx[i] < rx[p])
        for (int j = 0; j < (rx[p] - rx[i]); j++) str[j + k] = 'L';
      k += mabs(rx[i] - rx[p]);
      if (ry[i] > ry[p])
        for (int j = 0; j < (ry[i] - ry[p]); j++) str[j + k] = 'U';
      if (ry[i] < ry[p])
        for (int j = 0; j < (ry[p] - ry[i]); j++) str[j + k] = 'D';
      k += mabs(ry[i] - ry[p]);
      if ((i - k) % 2) {
        cout << i << " " << p << " " << rx[i] << " " << rx[p] << " " << ry[i]
             << " " << ry[p] << " " << xl << " " << yl << endl;
        no("incorrect odd");
      }
      for (; k < i; k += 2) {
        str[k] = 'U';
        str[k + 1] = 'D';
      }
      p = i;
    }
  }
}
void handle() {
  rx.resize(l + 1);
  ry.resize(l + 1);
  m.resize(l + 1);
  m.assign(l + 1, -1);
  if (!find_l()) find_l2();
  get_result(result);
}
int main() {
  cin >> n >> l;
  vt.resize(n);
  vx.resize(n);
  vy.resize(n);
  result.resize(l);
  for (long i = 0; i < n; i++) {
    cin >> vt[i] >> vx[i] >> vy[i];
  }
  handle();
  cout << result;
  cin >> n;
  return 0;
}