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>
#pragma GCC optimize("Ofast")
using namespace std;
void read(long long &x) {
  char ch = getchar();
  long long f = 0;
  x = 0;
  while (!isdigit(ch)) {
    if (ch == '-') f = 1;
    ch = getchar();
  }
  while (isdigit(ch)) x = x * 10 + ch - 48, ch = getchar();
  if (f) x = -x;
}
const long long N = 2e5 + 10, M = 2e6 + 10;
long long n, l, vala, valb;
struct qwq {
  long long k, y, sum;
  bool operator<(const qwq &x) const { return y < x.y; }
} a[N], b[N];
long long pa[N], pb[N], sa[M], sb[M];
long long ka, kb, la = -1e15, ra = 1e15, lb = -1e15, rb = 1e15;
long long mx(long long a, long long b) { return a / b + (a % b && a > 0); }
long long mn(long long a, long long b) { return a / b - (a % b && a < 0); }
signed main() {
  read(n), read(l);
  for (long long i = 1, t, x, y; i <= n; ++i) {
    read(t), read(x), read(y);
    a[i] = {t / l, t % l, x - y};
    b[i] = {t / l, t % l, x + y};
  }
  ka = kb = (l & 1);
  sort(a + 1, a + n + 1), sort(b + 1, b + n + 1);
  for (long long i = 1; i <= n; ++i) {
    long long va = a[i].y - a[i - 1].y, vb = a[i].sum - a[i - 1].sum,
              kk = (a[i - 1].k - a[i].k);
    if (kk) {
      if (kk < 0) {
        la = (la >= mx(vb - va, -kk) ? la : mx(vb - va, -kk));
        ra = (ra >= mn(vb + va, -kk) ? mn(vb + va, -kk) : ra);
      } else {
        la = (la >= mx(-vb - va, kk) ? la : mx(-vb - va, kk));
        ra = (ra >= mn(va - vb, kk) ? mn(va - vb, kk) : ra);
      }
    }
    if ((kk & 1)) {
      if ((va + vb) & 1) {
        if (ka == 0) return puts("NO"), 0;
      } else {
        if (ka == 1) return puts("NO"), 0;
      }
    } else if ((va + vb) & 1)
      return puts("NO"), 0;
  }
  for (long long i = 1; i <= n; ++i) {
    long long va = b[i].y - b[i - 1].y, vb = b[i].sum - b[i - 1].sum,
              kk = (b[i - 1].k - b[i].k);
    if (kk) {
      if (kk < 0) {
        lb = (lb >= mx(vb - va, -kk) ? lb : mx(vb - va, -kk));
        rb = (rb >= mn(vb + va, -kk) ? mn(vb + va, -kk) : rb);
      } else {
        lb = (lb >= mx(-vb - va, kk) ? lb : mx(-vb - va, kk));
        rb = (rb >= mn(va - vb, kk) ? mn(va - vb, kk) : rb);
      }
    }
    if ((kk & 1)) {
      if ((va + vb) & 1) {
        if (kb == 0) return puts("NO"), 0;
      } else {
        if (kb == 1) return puts("NO"), 0;
      }
    } else if ((va + vb) & 1)
      return puts("NO"), 0;
  }
  long long kk = -a[n].k - 1;
  if (kk) {
    if (kk < 0) {
      la = (la >= mx(-l + a[n].y + a[n].sum, -kk)
                ? la
                : mx(-l + a[n].y + a[n].sum, -kk));
      ra = (ra >= mn(-a[n].y + l + a[n].sum, -kk)
                ? mn(-a[n].y + l + a[n].sum, -kk)
                : ra);
    } else {
      la =
          (la >= mx(a[n].y - l - a[n].sum, kk) ? la
                                               : mx(a[n].y - l - a[n].sum, kk));
      ra = (ra >= mn(l - a[n].y - a[n].sum, kk) ? mn(l - a[n].y - a[n].sum, kk)
                                                : ra);
    }
    if ((kk & 1)) {
      if ((l - a[n].y - a[n].sum) & 1) {
        if (ka == 0) return puts("NO"), 0;
      } else {
        if (ka == 1) return puts("NO"), 0;
      }
    } else if ((l - a[n].y - a[n].sum) & 1)
      return puts("NO"), 0;
  }
  kk = -b[n].k - 1;
  if (kk) {
    if (kk < 0) {
      lb = (lb >= mx(-l + b[n].y + b[n].sum, -kk)
                ? lb
                : mx(-l + b[n].y + b[n].sum, -kk));
      rb = (rb >= mn(-b[n].y + l + b[n].sum, -kk)
                ? mn(-b[n].y + l + b[n].sum, -kk)
                : rb);
    } else {
      lb =
          (lb >= mx(b[n].y - l - b[n].sum, kk) ? lb
                                               : mx(b[n].y - l - b[n].sum, kk));
      rb = (rb >= mn(l - b[n].y - b[n].sum, kk) ? mn(l - b[n].y - b[n].sum, kk)
                                                : rb);
    }
    if ((kk & 1)) {
      if ((l - b[n].y - a[n].sum) & 1) {
        if (kb == 0) return puts("NO"), 0;
      } else {
        if (kb == 1) return puts("NO"), 0;
      }
    } else if ((l - b[n].y - a[n].sum) & 1)
      return puts("NO"), 0;
  }
  if (la > ra)
    return puts("NO"), 0;
  else {
    if (la == ra && (la & 1) != ka)
      return puts("NO"), 0;
    else
      vala = ((la & 1) == ka) ? la : la + 1;
  }
  if (lb > rb)
    return puts("NO"), 0;
  else {
    if (lb == rb && (lb & 1) != kb)
      return puts("NO"), 0;
    else
      valb = ((lb & 1) == kb) ? lb : lb + 1;
  }
  a[++n] = {0, l, vala}, b[n] = {0, l, valb};
  for (long long i = 1; i <= n; ++i) {
    pa[i] = a[i].sum - a[i].k * vala;
    long long _ = pa[i] - pa[i - 1], j = a[i - 1].y + 1;
    long long k = (_ > 0) ? 1 : -1;
    if (_ < 0) _ = -_;
    for (; j <= a[i].y && _; ++j, --_) sa[j] = k;
    for (; j <= a[i].y; j += 2) sa[j] = 1, sa[j + 1] = -1;
  }
  for (long long i = 1; i <= n; ++i) {
    pb[i] = b[i].sum - b[i].k * valb;
    long long _ = pb[i] - pb[i - 1], j = b[i - 1].y + 1;
    long long k = (_ > 0) ? 1 : -1;
    if (_ < 0) _ = -_;
    for (; j <= b[i].y && _; ++j, --_) sb[j] = k;
    for (; j <= b[i].y; j += 2) sb[j] = 1, sb[j + 1] = -1;
  }
  for (long long i = 1; i <= l; ++i) {
    if (sa[i] == 1 && sb[i] == 1) putchar('R');
    if (sa[i] == 1 && sb[i] == -1) putchar('D');
    if (sa[i] == -1 && sb[i] == 1) putchar('U');
    if (sa[i] == -1 && sb[i] == -1) putchar('L');
  }
  return puts(""), 0;
}