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;
const long long INF = 4000000000000000000ll;
const int MaxN = 200001;
const int MaxL = 2000000;
inline long long getint() {
  char c;
  while (c = getchar(), ('0' > c || c > '9') && c != '-')
    ;
  if (c != '-') {
    long long res = c - '0';
    while (c = getchar(), '0' <= c && c <= '9') res = res * 10 + c - '0';
    return res;
  } else {
    long long res = 0;
    while (c = getchar(), '0' <= c && c <= '9') res = res * 10 + c - '0';
    return -res;
  }
}
template <class T>
inline void tension(T &a, const T &b) {
  if (b < a) a = b;
}
int n, l;
long long pt[MaxN], px[MaxN], py[MaxN];
char res[MaxL + 1];
pair<int, int> b[MaxN];
inline long long orzmod(long long a, long long b) { return (a % b + b) % b; }
inline long long orzfloor(long long a, long long b) {
  if (a < 0) return -((-a + b - 1) / b);
  return a / b;
}
inline bool check(long long x, long long y) {
  int res_n = 0;
  for (int i = 0; i < n; i++) {
    int v = b[i].second, u = b[(i + 1) % n].second;
    if (abs((px[u] - (double)(pt[u] / l) * x) -
            (px[v] - (double)(pt[v] / l) * x)) > 1.5e18)
      return false;
    if (abs((py[u] - (double)(pt[u] / l) * y) -
            (py[v] - (double)(pt[v] / l) * y)) > 1.5e18)
      return false;
    long long dx = (px[u] - (pt[u] / l) * x) - (px[v] - (pt[v] / l) * x);
    long long dy = (py[u] - (pt[u] / l) * y) - (py[v] - (pt[v] / l) * y);
    long long dt = i + 1 < n ? b[i + 1].first - b[i].first : l - b[i].first;
    if (i + 1 == n) dx += x, dy += y;
    if (abs(dx) + abs(dy) > dt) return false;
    if ((abs(dx) + abs(dy)) % 2 != dt % 2) return false;
    while (dx > 0) res[res_n++] = 'R', dx--, dt--;
    while (dx < 0) res[res_n++] = 'L', dx++, dt--;
    while (dy > 0) res[res_n++] = 'U', dy--, dt--;
    while (dy < 0) res[res_n++] = 'D', dy++, dt--;
    while (dt > 0) res[res_n++] = 'L', dt--, res[res_n++] = 'R', dt--;
  }
  return true;
}
inline bool handle() {
  for (int i = 0; i < n; i++)
    if (orzmod(px[i] + py[i], 2) != pt[i] % 2) return false;
  for (int i = 0; i < n; i++) b[i] = make_pair(pt[i] % l, i);
  sort(b, b + n);
  for (int i = 0; i + 1 < n; i++)
    if (b[i].first == b[i + 1].first) {
      int v = b[i].second;
      int u = b[i + 1].second;
      return check((px[v] - px[u]) / ((pt[v] - pt[u]) / l),
                   (py[v] - py[u]) / ((pt[v] - pt[u]) / l));
    }
  long long sxy = INF, mxy = INF;
  for (int i = 0; i < n; i++) {
    int v = b[i].second;
    int u = b[(i + 1) % n].second;
    long long dx = px[u] - px[v];
    long long dy = py[u] - py[v];
    long long dk = pt[u] / l - pt[v] / l;
    long long dt = i + 1 < n ? b[i + 1].first - b[i].first : l - b[i].first;
    if (i + 1 == n) dk--;
    if (dk < 0) {
      tension(sxy, orzfloor(dt - dx - dy, -dk));
      tension(mxy, orzfloor(dt - dx + dy, -dk));
    } else if (dk > 0) {
      tension(sxy, orzfloor(dt + dx + dy, dk));
      tension(mxy, orzfloor(dt + dx - dy, dk));
    } else {
      if (abs(dx) + abs(dy) > dt) return false;
    }
  }
  while (abs(sxy) % 2 != l % 2) sxy--;
  while (abs(mxy) % 2 != l % 2) mxy--;
  long long vx = (sxy + mxy) / 2, vy = (sxy - mxy) / 2;
  return check(vx, vy);
}
int main() {
  cin >> n >> l;
  for (int i = 0; i < n; i++)
    pt[i] = getint(), px[i] = getint(), py[i] = getint();
  pt[n] = 0, pt[n] = 0, py[n] = 0;
  n++;
  if (handle())
    puts(res);
  else
    puts("NO");
  return 0;
}