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 int __SIZE = 1 << 18;
char ibuf[__SIZE], *iS, *iT;
template <typename T>
inline void read(T &x) {
  char ch, t = 0;
  x = 0;
  while (!isdigit(ch = (iS == iT
                            ? (iT = (iS = ibuf) + fread(ibuf, 1, __SIZE, stdin),
                               (iS == iT ? EOF : *iS++))
                            : *iS++)))
    t |= ch == '-';
  while (isdigit(ch))
    x = x * 10 + (ch ^ 48),
    ch = (iS == iT ? (iT = (iS = ibuf) + fread(ibuf, 1, __SIZE, stdin),
                      (iS == iT ? EOF : *iS++))
                   : *iS++);
  x = t ? -x : x;
}
inline char read_alpha() {
  char c = (iS == iT ? (iT = (iS = ibuf) + fread(ibuf, 1, __SIZE, stdin),
                        (iS == iT ? EOF : *iS++))
                     : *iS++);
  while (!isalpha(c) && c != EOF)
    c = (iS == iT ? (iT = (iS = ibuf) + fread(ibuf, 1, __SIZE, stdin),
                     (iS == iT ? EOF : *iS++))
                  : *iS++);
  return c;
}
inline int read_int() {
  int x;
  return read(x), x;
}
inline long long read_ll() {
  long long x;
  return read(x), x;
}
template <typename T>
inline void chkmin(T &a, T b) {
  a = a < b ? a : b;
}
template <typename T>
inline void chkmax(T &a, T b) {
  a = a > b ? a : b;
}
const int MAXN = 200010;
const long long inf = (1ull << 63) - 1;
inline long long up(long long p, long long q) {
  return (long long)ceil(1.0L * p / q);
}
inline long long dn(long long p, long long q) {
  return (long long)floor(1.0L * p / q);
}
int n, m;
struct Node {
  long long x, y, k;
  int p;
  Node() {}
  Node(long long x, long long y, long long t) : x(x), y(y) {
    k = t / m, p = t % m;
  }
  inline long long C(long long t, long long v) {
    return (x * t + y * (!t)) - v * k;
  }
  friend bool operator<(Node a, Node b) { return a.p < b.p; }
} a[MAXN];
int d[4][2000010];
int main() {
  n = read_int(), m = read_int();
  long long lx = -inf, rx = inf;
  long long ly = -inf, ry = inf;
  for (int i = 1; i <= n; i++) {
    long long t = read_ll(), x = read_ll(), y = read_ll();
    long long tx = x + y + t;
    long long ty = y - x + t;
    if (tx < 0 || ty < 0 || (tx & 1) || (ty & 1)) return puts("NO"), 0;
    a[i] = Node(tx >> 1, ty >> 1, t);
  }
  sort(a + 1, a + 1 + n), ++n, a[n].k = -1, a[n].p = m;
  for (int i = 1; i <= n; i++) {
    long long k = a[i].k - a[i - 1].k;
    long long p = a[i].p - a[i - 1].p;
    long long X = a[i].x - a[i - 1].x;
    long long Y = a[i].y - a[i - 1].y;
    if (!k) {
      if (X > p || X < 0 || Y > p || Y < 0) return puts("NO"), 0;
    } else if (k > 0) {
      chkmax(lx, up(X - p, k)), chkmin(rx, dn(X, k));
      chkmax(ly, up(Y - p, k)), chkmin(ry, dn(Y, k));
    } else {
      k = -k;
      chkmin(rx, dn(-X + p, k)), chkmax(lx, up(-X, k));
      chkmin(ry, dn(-Y + p, k)), chkmax(ly, up(-Y, k));
    }
  }
  if (rx < lx || ry < ly) return puts("NO"), 0;
  for (int i = 1, now = 0; i <= n; i++) {
    int lX = a[i].C(1, lx) - a[i - 1].C(1, lx);
    int lY = a[i].C(0, ly) - a[i - 1].C(0, ly);
    int rX = a[i].C(1, rx) - a[i - 1].C(1, rx);
    int rY = a[i].C(0, ry) - a[i - 1].C(0, ry);
    int t = a[i].p - a[i - 1].p;
    now += t;
    for (int j = 0; j < t; j++) {
      if (j < lX) d[0][now - j] = 1;
      if (j < rX) d[1][now - j] = 1;
      if (j < lY) d[2][now - j] = 1;
      if (j < rY) d[3][now - j] = 1;
    }
  }
  for (int i = 1; i <= m; i++)
    if (d[0][i] != d[1][i]) {
      if (d[0][i] > d[1][i])
        for (int j = i; j <= m; j++) d[0][j] = d[1][j];
      break;
    }
  for (int i = 1; i <= m; i++)
    if (d[2][i] != d[3][i]) {
      if (d[2][i] > d[3][i])
        for (int j = i; j <= m; j++) d[2][j] = d[3][j];
      break;
    }
  char s[] = "DLRU";
  for (int i = 1; i <= m; i++) putchar(s[d[0][i] << 1 | d[2][i]]);
  puts("");
  return 0;
}