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;
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
const int MAXLEN = 2000000;
const int MAXPOS = 200000;
const int MAXN = MAXPOS + 2;
typedef struct P {
  long long x, y, p, q;
} P;
bool operator<(const P &a, const P &b) { return a.q < b.q; }
int npos, len;
long long x[MAXPOS], y[MAXPOS], t[MAXPOS];
int n;
P p[MAXN];
void createp(long long ct, long long cx, long long cy) {
  long long cp = ct / len, cq = ct % len;
  p[n].x = cx, p[n].y = cy, p[n].p = cp, p[n].q = cq;
  ++n;
}
long long bound[4];
long long divdown(long long a, long long b) {
  if (b < 0) a = -a, b = -b;
  return a >= 0 ? a / b : (a - b + 1) / b;
}
void createcond(int type, long long mult, long long lim) {
  long long cbound = divdown(lim, mult);
  if (cbound < bound[type]) {
    bound[type] = cbound;
  }
}
char ret[MAXLEN + 1];
void run() {
  scanf("%d%d", &npos, &len);
  for (int i = (0); i < (npos); ++i)
    scanf("%I64d%I64d%I64d", &t[i], &x[i], &y[i]);
  n = 0;
  createp(0, 0, 0);
  createp(0, 0, 0);
  p[n - 1].p = -1, p[n - 1].q = len;
  for (int i = (0); i < (npos); ++i) createp(t[i], x[i], y[i]);
  sort(p, p + n);
  for (int i = (0); i < (4); ++i) bound[i] = LLONG_MAX;
  for (int i = (0); i < (n - 1); ++i) {
    long long dx = p[i + 1].x - p[i].x, dy = p[i + 1].y - p[i].y,
              dp = p[i + 1].p - p[i].p, dq = p[i + 1].q - p[i].q;
    if (dp == 0) continue;
    createcond(dp > 0 ? 3 : 0, abs(dp), dq - dx - dy);
    createcond(dp > 0 ? 1 : 2, abs(dp), dq + dx - dy);
    createcond(dp > 0 ? 2 : 1, abs(dp), dq - dx + dy);
    createcond(dp > 0 ? 0 : 3, abs(dp), dq + dx + dy);
  }
  for (long long ds = -bound[3]; ds <= bound[0] && ds <= -bound[3] + 3; ++ds)
    for (long long dt = -bound[2]; dt <= bound[1] && dt <= -bound[2] + 3;
         ++dt) {
      if ((ds + dt) % 2 != 0) continue;
      long long DX = (ds + dt) / 2, DY = (ds - dt) / 2;
      bool ok = true;
      int at = 0;
      for (int i = (0); i < (n - 1); ++i) {
        long long dx = p[i + 1].x - p[i].x, dy = p[i + 1].y - p[i].y,
                  dp = p[i + 1].p - p[i].p, dq = p[i + 1].q - p[i].q;
        long long cx = dx - dp * DX, cy = dy - dp * DY;
        long long acx = abs(cx), acy = abs(cy);
        if (acx + acy > dq) {
          ok = false;
          break;
        }
        if ((acx + acy) % 2 != dq % 2) {
          ok = false;
          break;
        }
        for (int j = (0); j < (acx); ++j) ret[at++] = cx < 0 ? 'L' : 'R';
        for (int j = (0); j < (acy); ++j) ret[at++] = cy < 0 ? 'D' : 'U';
        for (int j = (0); j < (dq - acx - acy); ++j)
          ret[at++] = j % 2 == 0 ? 'L' : 'R';
      }
      if (!ok) continue;
      ret[at++] = '\0';
      printf("%s\n", ret);
      return;
    }
  printf("NO\n");
}
int main() {
  run();
  return 0;
}