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;
inline long long read() {
  long long f = 1, ans = 0;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    ans = ans * 10 + c - '0';
    c = getchar();
  }
  return f * ans;
}
const long long MAXN = 2e5 + 11;
const long long MAXL = 2e6 + 11;
long long N, Len, X[MAXN], Y[MAXN], T[MAXN];
struct node {
  long long id, X, Y, tim, cnt, ps;
} tr[MAXN];
long long Ans1[MAXL], Ans2[MAXL];
bool cmp(node x1, node x2) { return x1.ps < x2.ps; }
void print() {
  printf("NO\n");
  exit(0);
}
long long Min(long long a, long long b) { return a <= b ? a : b; }
long long Max(long long a, long long b) { return a >= b ? a : b; }
void solveX(long long U) {
  for (long long i = 1; i <= N; i++) {
    if (tr[i].ps == tr[i - 1].ps) continue;
    long long now = tr[i].X - tr[i].cnt * U;
    long long las = tr[i - 1].X - tr[i - 1].cnt * U;
    long long l = tr[i - 1].ps + 1, r = tr[i].ps;
    long long cnt1 = (now - las + r - l + 1) / 2;
    for (long long j = l; j <= Min(r, l + cnt1 - 1); j++) Ans1[j] = 1;
  }
  if (tr[N].ps != Len) {
    long long l = tr[N].ps + 1, r = Len;
    long long cnt1 = (U - (tr[N].X - tr[N].cnt * U) + r - l + 1) / 2;
    for (long long j = l; j <= Min(Len, l + cnt1 - 1); j++) Ans1[j] = 1;
  }
}
void solveY(long long U) {
  for (long long i = 1; i <= N; i++) {
    if (tr[i].ps == tr[i - 1].ps) continue;
    long long now = tr[i].Y - tr[i].cnt * U;
    long long las = tr[i - 1].Y - tr[i - 1].cnt * U;
    long long l = tr[i - 1].ps + 1, r = tr[i].ps;
    long long cnt1 = (now - las + r - l + 1) / 2;
    for (long long j = l; j <= Min(r, l + cnt1 - 1); j++) Ans2[j] = 1;
  }
  if (tr[N].ps != Len) {
    long long l = tr[N].ps + 1, r = Len;
    long long cnt1 = (U - (tr[N].Y - tr[N].cnt * U) + r - l + 1) / 2;
    for (long long j = l; j <= Min(Len, l + cnt1 - 1); j++) Ans2[j] = 1;
  }
}
long long Sx[MAXL], Sy[MAXL], Lx, Rx, Ly, Ry;
signed main() {
  N = read(), Len = read();
  for (long long i = 1; i <= N; i++) {
    T[i] = read(), X[i] = read(), Y[i] = read();
    long long t = T[i] - T[i - 1], dis = X[i] + Y[i] - X[i - 1] - Y[i - 1];
    if (dis < 0) dis = -dis;
    if ((t & 1ll) != (dis & 1ll)) print();
  }
  for (long long i = 1; i <= N; i++)
    tr[i].id = i, tr[i].X = (X[i] + Y[i]), tr[i].Y = (X[i] - Y[i]),
    tr[i].tim = T[i], tr[i].ps = ((T[i] % Len) ? T[i] % Len : Len),
    tr[i].cnt = (T[i] - 1) / Len;
  sort(tr + 1, tr + N + 1, cmp);
  long long L = -Len, R = Len, ans = INT_MAX;
  for (long long i = 1; i <= N; i++)
    L = max(L, (tr[i].X - (Len - tr[i].ps)) / (tr[i].cnt + 1)),
    R = min(R, (tr[i].X + (Len - tr[i].ps)) / (tr[i].cnt + 1));
  for (long long i = 1; i <= N; i++) {
    if (tr[i].ps == tr[i - 1].ps) {
      ans = (tr[i].X - tr[i - 1].X) / (tr[i].cnt - tr[i - 1].cnt);
      break;
    }
    long long MMax = tr[i].ps - tr[i - 1].ps - tr[i].X + tr[i - 1].X,
              MMin = (tr[i - 1].ps - tr[i].ps - tr[i].X + tr[i - 1].X);
    long long p = -tr[i].cnt + tr[i - 1].cnt;
    if (!p) {
      if (MMin > MMax) print();
      continue;
    }
    if (p < 0) {
      L = Max(L, ceil(1.0 * MMax / p)), R = Min(R, floor(1.0 * MMin / p));
    }
    if (p > 0) {
      L = Max(L, ceil(1.0 * MMin / p)), R = Min(R, floor(1.0 * MMax / p));
    }
  }
  if (L > R) print();
  if (ans != INT_MAX)
    Lx = Rx = ans;
  else
    Lx = L, Rx = R;
  bool P = 0;
  for (long long p = Rx - 3; p <= Rx; p++) {
    memset(Ans1, -1, sizeof(Ans1));
    solveX(p);
    Sx[0] = 0;
    for (long long i = 1; i <= Len; i++) Sx[i] = Sx[i - 1] + Ans1[i];
    bool ff = 1;
    for (long long i = 1; i <= N; i++) {
      long long WW = Sx[tr[i].ps] + tr[i].cnt * Sx[Len];
      if (WW != tr[i].X) {
        ff = 0;
        break;
      }
    }
    if (!ff) continue;
    P = 1;
    break;
  }
  if (!P) print();
  L = -Len, R = Len, ans = INT_MAX;
  for (long long i = 1; i <= N; i++)
    L = max(L, (tr[i].Y - (Len - tr[i].ps)) / (tr[i].cnt + 1)),
    R = min(R, (tr[i].Y + (Len - tr[i].ps)) / (tr[i].cnt + 1));
  for (long long i = 1; i <= N; i++) {
    if (tr[i].ps == tr[i - 1].ps) {
      ans = (tr[i].Y - tr[i - 1].Y) / (tr[i].cnt - tr[i - 1].cnt);
      break;
    }
    long long MMax = tr[i].ps - tr[i - 1].ps - tr[i].Y + tr[i - 1].Y,
              MMin = (tr[i - 1].ps - tr[i].ps - tr[i].Y + tr[i - 1].Y);
    long long p = -tr[i].cnt + tr[i - 1].cnt;
    if (!p) {
      if (MMin > MMax) print();
      continue;
    }
    if (p < 0) {
      L = Max(L, ceil(1.0 * MMax / p)), R = Min(R, floor(1.0 * MMin / p));
    } else {
      L = Max(L, ceil(1.0 * MMin / p)), R = Min(R, floor(1.0 * MMax / p));
    }
  }
  if (L > R) print();
  if (ans != INT_MAX)
    Ly = Ry = ans;
  else
    Ly = L, Ry = R;
  P = 0;
  for (long long p = Ry - 3; p <= Ry; p++) {
    memset(Ans2, -1, sizeof(Ans1));
    solveY(p);
    Sy[0] = 0;
    for (long long i = 1; i <= Len; i++) Sy[i] = Sy[i - 1] + Ans2[i];
    bool ff = 1;
    for (long long i = 1; i <= N; i++) {
      long long WW = Sy[tr[i].ps] + tr[i].cnt * Sy[Len];
      if (WW != tr[i].Y) {
        ff = 0;
        break;
      }
    }
    if (!ff) continue;
    P = 1;
    break;
  }
  if (!P) print();
  for (long long i = 1; i <= Len; i++) {
    if (Ans1[i] == 1 && Ans2[i] == 1) putchar('R');
    if (Ans1[i] == 1 && Ans2[i] == -1) putchar('U');
    if (Ans1[i] == -1 && Ans2[i] == 1) putchar('D');
    if (Ans1[i] == -1 && Ans2[i] == -1) putchar('L');
  }
  printf("\n");
  return 0;
}