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;
template <class T>
inline void rd(T &x) {
  x = 0;
  char c = getchar();
  int f = 1;
  while (!isdigit(c)) {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (isdigit(c)) x = x * 10 - '0' + c, c = getchar();
  x *= f;
}
int curtest;
void FAIL() {
  printf("NO");
  exit(0);
}
long long Abs(long long x) { return x > 0 ? x : -x; }
long double eps = 1e-20;
int dcmp(long double x) { return x > -eps ? (x > eps) : -1; }
const int N = 2e6 + 10;
vector<int> pos;
struct node {
  long long t, x, y;
} v[N];
long long val[N], ti[N];
int vis[N];
int m, n;
long double lb, rb;
vector<char> S;
void modify(int p, long long x, long long delt) {
  if (Abs((delt * m + p) % 2) ^ Abs(x % 2)) FAIL();
  if (delt == 0) return;
  long long l = -p - x, r = p - x;
  long double dt = -delt;
  if (dt > 0)
    lb = max(lb, l / dt), rb = min(rb, r / dt);
  else
    lb = max(lb, r / dt), rb = min(rb, l / dt);
}
void sol(vector<int> &ans) {
  lb = -m, rb = m;
  for (int i = 0; i + 1 < pos.size(); ++i) {
    if (i + 2 == pos.size())
      modify(m - pos[i], -val[pos[i]], -ti[pos[i]] - 1);
    else
      modify(pos[i + 1] - pos[i], val[pos[i + 1]] - val[pos[i]],
             ti[pos[i + 1]] - ti[pos[i]]);
    if (ti[pos[i]] == 0) {
      lb = max(lb, (long double)val[pos[i]] - (m - pos[i]));
      rb = min(rb, (long double)val[pos[i]] + (m - pos[i]));
    }
  }
  long long dx = floor(rb);
  if (Abs(dx % 2) ^ (m % 2)) dx--;
  if (dcmp(dx - lb) < 0) FAIL();
  for (int i = 0; i + 1 < pos.size(); ++i) {
    int l = pos[i], r = pos[i + 1], len = r - l;
    long long x = (r == m ? dx : val[r]) - val[l] - (ti[r] - ti[l]) * dx;
    int d = x > 0 ? 1 : -1;
    x = Abs(x);
    len -= x;
    while (x) x--, ans.push_back(d);
    if (len < 0 || (len & 1)) FAIL();
    while (len) ans.push_back(1), ans.push_back(-1), len -= 2;
  }
}
long long dx, dy;
void solve(int l, int r, long long x, long long y, long long t) {
  x -= t * dx, y -= t * dy;
  char xx = x > 0 ? 'R' : 'L';
  char yy = y > 0 ? 'U' : 'D';
  x = Abs(x), y = Abs(y);
  while (x--) S.push_back(xx), r--;
  while (y--) S.push_back(yy), r--;
  if (((r - l) & 1) || r - l < 0) FAIL();
  while (r - l) S.push_back('U'), S.push_back('D'), r -= 2;
}
vector<int> ax, ay;
int main() {
  rd(n), rd(m);
  int flg = 0;
  vis[0] = 1, v[0].x = v[0].y = v[0].t = 0;
  for (int i = 1; i <= n; ++i) {
    node A;
    rd(A.t), rd(A.x), rd(A.y);
    int p = A.t % m;
    A.t /= m;
    if (vis[p]) {
      if (A.t == v[p].t) {
        if (A.x != v[p].x || A.y != v[p].y) FAIL();
        continue;
      }
      long long dt = A.t - v[p].t;
      if (flg) {
        if (v[p].x + dt * dx == A.x && v[p].y + dt * dy == A.y)
          continue;
        else
          FAIL();
      }
      dx = A.x - v[p].x, dy = A.y - v[p].y;
      if (dx % dt || dy % dt) FAIL();
      dx /= dt, dy /= dt;
      flg = 1;
    } else
      v[p] = A, vis[p] = 1;
  }
  if (flg) {
    int p1 = 0, p2;
    while (true) {
      p2 = p1 + 1;
      while (!vis[p2] && p2 < m) p2++;
      if (p2 >= m) break;
      solve(p1, p2, v[p2].x - v[p1].x, v[p2].y - v[p1].y, v[p2].t - v[p1].t);
      p1 = p2;
    }
    solve(p1, m, dx - v[p1].x, dy - v[p1].y, -v[p1].t);
    for (int i = 0; i < S.size(); ++i) putchar(S[i]);
  } else {
    for (int i = 0; i < m; ++i)
      if (vis[i]) ti[i] = v[i].t, pos.push_back(i);
    pos.push_back(m), ti[m] = 0;
    for (int i = 0; i < m; ++i)
      if (vis[i]) val[i] = v[i].x + v[i].y;
    sol(ax);
    for (int i = 0; i < m; ++i)
      if (vis[i]) val[i] = v[i].x - v[i].y;
    sol(ay);
    for (int i = 0; i < m; ++i) {
      if (ax[i] == ay[i])
        putchar(ax[i] > 0 ? 'R' : 'L');
      else
        putchar(ax[i] > 0 ? 'U' : 'D');
    }
  }
  return 0;
}