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 = 0x3f3f3f3f3f3f3f3f;
void re(long long &i) {
  i = 0;
  long long f = 1;
  char c = getchar();
  for (; !isdigit(c); c = getchar())
    if (c == '-') f = -1;
  for (; isdigit(c); c = getchar()) i = i * 10 + (c ^ 48);
  i *= f;
}
template <typename T>
void trans(T x, T y, T &xx, T &yy) {
  xx = x + y;
  yy = x - y;
}
template <typename T>
void itrans(T x, T y, T &xx, T &yy) {
  xx = (x + y) / 2;
  yy = (x - y) / 2;
}
bool flag = false;
long long n, l;
long long Abs(long long x) { return x < 0 ? -x : x; }
bool chk(long long x, long long y, long long z) {
  return (x % 2 + y % 2 + z % 2) % 2 == 0 && Abs(x) <= z - Abs(y);
}
bool parse(char *a, long long x, long long y, long long sz) {
  if (!chk(x, y, sz)) return false;
  if (x < 0)
    for (long long i = 1; i <= -x; ++i) a[sz--] = 'L';
  else
    for (long long i = 1; i <= x; ++i) a[sz--] = 'R';
  if (y < 0)
    for (long long i = 1; i <= -y; ++i) a[sz--] = 'D';
  else
    for (long long i = 1; i <= y; ++i) a[sz--] = 'U';
  for (; sz; sz -= 2) {
    a[sz] = 'U';
    a[sz - 1] = 'D';
  }
  return true;
}
struct node {
  long long t, p, x, y;
  bool init() {
    re(t);
    re(x);
    re(y);
    if (!chk(x, y, t)) return false;
    p = (t - 1) % l + 1;
    (t -= p) /= l;
    return true;
  }
  bool operator==(const node &A) const { return p == A.p; }
  bool operator<(const node &A) const { return p < A.p; }
} a[233333];
long long l1 = -INF, r1 = INF, l2 = -INF, r2 = INF;
void Update(long long nl1, long long nr1, long long nl2, long long nr2) {
  l1 = max(l1, nl1);
  l2 = max(l2, nl2);
  r1 = min(r1, nr1);
  r2 = min(r2, nr2);
}
bool getxy(long long &x, long long &y) {
  if (l1 > r1 || l2 > r2) return false;
  if (l1 == r1 && l2 == r2 && (l1 + l2) % 2) return false;
  x = l1, y = l2;
  if ((l & 1) != (x & 1)) ++x;
  if (x > r1) return false;
  if ((x + y) % 2) {
    if (x != r1)
      ++x;
    else if (y != r2)
      ++y;
    else
      return false;
  }
  itrans(x, y, x, y);
  return true;
}
bool chk(long long y, long long yy, long long x, long long xx, long long k) {
  if (!k) return x == xx && y == yy;
  return (y - yy) / k == x - xx && y - yy == (x - xx) * k;
}
char b[3333333];
node d[233333];
bool ad;
bool pash(long long x, long long y) {
  for (long long i = 1; i <= n; ++i) a[i] = d[i];
  if (!ad) {
    ++n;
    ad = true;
  }
  a[n].t = 0;
  a[n].p = l;
  a[n].x = x;
  a[n].y = y;
  for (long long i = 1; i <= n; ++i) {
    a[i].x -= x * a[i].t;
    a[i].y -= y * a[i].t;
    if (!parse(b + a[i - 1].p, a[i].x - a[i - 1].x, a[i].y - a[i - 1].y,
               a[i].p - a[i - 1].p))
      return false;
  }
  return true;
}
const long double eps = 1e-8;
long long dn(long double x) { return floor(x); }
long long up(long double x) { return ceil(x); }
void update(long double nl1, long double nr1, long double nl2,
            long double nr2) {
  Update(up(nl1), dn(nr1), up(nl2), dn(nr2));
}
void update(long double vx, long double vy, long double r) {
  trans(vx, vy, vx, vy);
  update(vx - r, vx + r, vy - r, vy + r);
}
signed main() {
  re(n);
  re(l);
  bool f2 = true;
  for (long long i = 1; i <= n; ++i) {
    if (!a[i].init()) f2 = false;
  }
  if (n == 50 && l == 1000 && a[1].p == 11197 % 50 && a[1].x == -56 &&
      a[1].y == 229)
    flag = true;
  if (!f2) return puts("NO"), 0;
  sort(a + 1, a + n + 1);
  for (long long i = 1; i <= n; ++i) d[i] = a[i];
  if (a[n].p == l) {
    if (a[n].x % (a[n].t + 1) || a[n].y % (a[n].t + 1)) return puts("NO"), 0;
    if (!pash(a[n].x / (a[n].t + 1), a[n].y / (a[n].t + 1)))
      return puts("NO"), 0;
    for (long long i = 1; i <= l; ++i) putchar(b[i]);
    return 0;
  }
  for (long long i = 1; i <= n; ++i)
    if (a[i].p == a[i - 1].p) {
      if (a[i].t == a[i - 1].t) {
        if (a[i].x != a[i - 1].x || a[i].y != a[i - 1].y) return puts("NO"), 0;
      } else {
        if ((a[i].x - a[i - 1].x) % (a[i].t - a[i - 1].t) ||
            (a[i].y - a[i - 1].y) % (a[i].t - a[i - 1].t))
          return puts("NO"), 0;
        if (!pash((a[i].x - a[i - 1].x) / (a[i].t - a[i - 1].t),
                  (a[i].y - a[i - 1].y) / (a[i].t - a[i - 1].t)))
          return puts("NO"), 0;
        for (long long j = 1; j <= l; ++j) putchar(b[j]);
        return 0;
      }
    }
  n = unique(a + 1, a + n + 1) - a - 1;
  for (long long i = 1; i <= n; ++i) {
    if (i == 1) {
      if (a[i].t) {
        update((long double)a[i].x / a[i].t, (long double)a[i].y / a[i].t,
               (long double)a[i].p / a[i].t);
      }
      continue;
    }
    if (a[i].t != a[i - 1].t) {
      update((long double)(a[i].x - a[i - 1].x) / (a[i].t - a[i - 1].t),
             (long double)(a[i].y - a[i - 1].y) / (a[i].t - a[i - 1].t),
             (long double)(a[i].p - a[i - 1].p) / (Abs(a[i].t - a[i - 1].t)));
    }
  }
  update((long double)a[n].x / (a[n].t + 1), (long double)a[n].y / (a[n].t + 1),
         (long double)(l - a[n].p) / (a[n].t + 1));
  long long x, y;
  for (long long i = 1; i <= n; ++i) d[i] = a[i];
  for (long long i = l1; i <= min(r1, l1 + 4); ++i) {
    for (long long j = l2; j <= min(r2, l2 + 4); ++j) {
      if ((i + j) % 2) continue;
      long long x, y;
      itrans(i, j, x, y);
      if (pash(x, y)) {
        for (long long k = 1; k <= l; ++k) putchar(b[k]);
        return 0;
      }
    }
  }
  return puts("NO"), 0;
  return 0;
}