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 n, m, a[2][2000000 + 5], vis[2000000 + 5];
long long t[2000000 + 5], pos[2][2000000 + 5];
int tt;
struct Node {
  long long a, b, c;
} ord[2000000 + 5];
template <class T>
void read(T &x) {
  char ch;
  bool ok;
  for (ok = 0, ch = getchar(); !isdigit(ch); ch = getchar())
    if (ch == '-') ok = 1;
  for (x = 0; isdigit(ch); x = x * 10 + ch - '0', ch = getchar())
    ;
  if (ok) x = -x;
}
int L, R;
void get_rge(long long x, long long y, long long z) {
  if (!x) return;
  long double l = (long double)(z - y) / x, r = (long double)(-z - y) / x;
  if (l > r) swap(l, r);
  L = max(L, (int)ceil(l - 1e-12));
  R = min(R, (int)floor(r + 1e-12));
}
int fl = 1;
void sol(int ty) {
  memset(vis, 0, sizeof vis);
  memset(ord, 0, sizeof ord);
  for (int i = (1), en = (n); i <= en; ++i) {
    long long a = -t[i] / m, to = t[i] % m;
    if (to == m - 1) {
      if (vis[to]) {
        if (pos[ty][i] / (-a + 1) != ord[to].b) {
          fl = 0;
          return;
        }
      } else {
        vis[to] = 1;
        ord[to].b = pos[ty][i] / (-a + 1);
      }
      continue;
    }
    if (vis[to]) {
      if (ord[to].a == a && ord[to].b != pos[ty][i]) {
        fl = 0;
        return;
      }
      if ((pos[ty][i] - ord[to].b) % (ord[to].a - a)) {
        fl = 0;
        return;
      }
      long long tem = (pos[ty][i] - ord[to].b) / (ord[to].a - a);
      if (vis[m - 1] && ord[m - 1].b != tem) {
        fl = 0;
        return;
      }
      vis[m - 1] = 1;
      ord[m - 1] = (Node){0, tem};
    } else {
      vis[to] = 1;
      ord[to] = (Node){a, pos[ty][i]};
    }
  }
  L = ord[m - 1].b;
  R = ord[m - 1].b;
  if (!vis[m - 1]) {
    L = -0x3f3f3f3f;
    R = 0x3f3f3f3f;
    int pre = -1;
    for (int i = (1), en = (m - 2); i <= en; ++i)
      if (vis[i]) {
        get_rge(ord[i].a - ord[pre == -1 ? m : pre].a,
                ord[i].b - ord[pre == -1 ? m : pre].b, i - pre);
        pre = i;
      }
    get_rge(1 - ord[pre == -1 ? m : pre].a, -ord[pre == -1 ? m : pre].b,
            m - 1 - pre);
    if (L > R) {
      fl = 0;
      return;
    }
    ord[m - 1].b = L;
    vis[m - 1] = 1;
  }
  ord[m - 1].c = ord[m - 1].b;
  long long tem = ord[m - 1].c, pre = -1;
  for (int i = (0), en = (m - 1); i <= en; ++i)
    if (vis[i]) {
      if (i != m - 1) ord[i].c = tem * ord[i].a + ord[i].b;
      if ((ord[i].c - ord[pre == -1 ? m : pre].c + i - pre) % 2) break;
      long long tem1 = (ord[i].c - ord[pre == -1 ? m : pre].c + i - pre) / 2;
      if (tem1 > i - pre) {
        fl = 0;
        return;
      }
      for (int j = (pre + 1), en = (pre + tem1); j <= en; ++j) a[ty][j] = 1;
      pre = i;
      if (i == m - 1) return;
    }
  if (tem + 1 >= L && tem + 1 <= R) {
    memset(a[ty], 0, sizeof a[ty]);
    tem = ++ord[m - 1].c;
    pre = -1;
    for (int i = (0), en = (m - 1); i <= en; ++i)
      if (vis[i]) {
        if (i != m - 1) ord[i].c = tem * ord[i].a + ord[i].b;
        if ((ord[i].c - ord[pre == -1 ? m : pre].c + i - pre) % 2) {
          fl = 0;
          return;
        }
        long long tem1 = (ord[i].c - ord[pre == -1 ? m : pre].c + i - pre) / 2;
        if (tem1 > i - pre) {
          fl = 0;
          return;
        }
        for (int j = (pre + 1), en = (pre + tem1); j <= en; ++j) a[ty][j] = 1;
        pre = i;
      }
  } else
    fl = 0;
}
int main() {
  read(n);
  read(m);
  for (int i = (1), en = (n); i <= en; ++i) {
    long long x, y;
    read(t[i]);
    read(x);
    read(y);
    t[i]--;
    if (i == 2) tt = y;
    long long tem = x;
    x = x + y;
    y = tem - y;
    pos[0][i] = x;
    pos[1][i] = y;
  }
  sol(1);
  if (!fl) {
    puts("NO");
    return 0;
  }
  sol(0);
  if (!fl) {
    puts("NO");
    return 0;
  }
  for (int i = (0), en = (m - 1); i <= en; ++i) {
    if (!a[0][i] && !a[1][i]) putchar('L');
    if (!a[0][i] && a[1][i]) putchar('D');
    if (a[0][i] && !a[1][i]) putchar('U');
    if (a[0][i] && a[1][i]) putchar('R');
  }
  return 0;
}