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;
struct node {
  long long x, a, b;
  bool operator<(const node &a) const { return x < a.x; }
};
node top[2000001];
long long n, l, t[2000001], x[2000001], y[2000001], res, op;
long long X[2][2000001], L, R, ans;
long long read() {
  char c = 0;
  long long sum = 0, f = 1;
  while ((c < '0' || c > '9') && c != '-') c = getchar();
  if (c == '-') f = -1, c = getchar();
  while ('0' <= c && c <= '9') sum = sum * 10 + c - '0', c = getchar();
  return sum * f;
}
void Insert(long long a, long long b, long long c, long long d) {
  if (a == c) {
    if (b > d)
      L = 1e18, R = -1e18;
    else
      return;
  } else if (a < c)
    L = max(L, (long long)(ceil(1.0 * (b - d) / (c - a))));
  else
    R = min(R, (long long)(1.0 * (b - d) / (c - a)));
  return;
}
long long st[2000001], F[2000001];
bool solve(long long type) {
  L = -1e18, R = 1e18;
  long long cnt;
  for (long long i = 0; i <= n; ++i) {
    Insert(top[i].a, top[i].b + (top[i].x - top[i + 1].x), top[i + 1].a,
           top[i + 1].b);
    Insert(top[i + 1].a, top[i + 1].b + (top[i].x - top[i + 1].x), top[i].a,
           top[i].b);
    if (((top[i].a - top[i + 1].a) % 2 + 2) % 2 == 1) {
      cnt =
          2 -
          (((top[i + 1].b + (top[i].x - top[i + 1].x)) - top[i].b) % 2 + 2) % 2;
      if (op && cnt != op) return 0;
      op = cnt;
    } else {
      if ((((top[i + 1].b + (top[i].x - top[i + 1].x)) - top[i].b) % 2 + 2) %
              2 ==
          1)
        return 0;
    }
  }
  if (L > R) return 0;
  if (op && L == R && (L % 2 + 2) % 2 != op % 2) return 0;
  ans = L + (op && ((L % 2 + 2) % 2 != op % 2));
  for (long long i = 0; i <= n + 1; ++i) F[i] = top[i].a * ans + top[i].b;
  for (long long i = 0; i <= n; ++i) {
    cnt = (F[i + 1] - F[i] + top[i + 1].x - top[i].x) / 2;
    for (long long j = top[i].x; j <= top[i].x + cnt - 1; ++j) X[type][j] = 1;
    for (long long j = top[i].x + cnt; j <= top[i + 1].x - 1; ++j)
      X[type][j] = -1;
  }
  for (long long i = 1; i <= l; ++i) st[i] = st[i - 1] + X[type][i - 1];
  for (long long i = 0; i <= n + 1; ++i)
    if (st[top[i].x] != st[l] * top[i].a + top[i].b) return 0;
  return 1;
}
signed main() {
  n = read(), l = read();
  for (long long i = 1; i <= n; ++i) {
    t[i] = read(), x[i] = read(), y[i] = read();
    top[i].x = t[i] % l, top[i].a = -t[i] / l, top[i].b = x[i] + y[i];
  }
  sort(top + 1, top + n + 1);
  top[n + 1].x = l, top[n + 1].a = 1, top[n + 1].b = 0;
  if (!solve(0)) {
    puts("NO");
    return 0;
  }
  op = 0;
  for (long long i = 1; i <= n; ++i)
    top[i].x = t[i] % l, top[i].a = -t[i] / l, top[i].b = x[i] - y[i];
  sort(top + 1, top + n + 1);
  top[n + 1].x = l, top[n + 1].a = 1, top[n + 1].b = 0;
  if (!solve(1)) {
    puts("NO");
    return 0;
  }
  for (long long i = 0; i <= l - 1; ++i) {
    if (X[0][i] == -1 && X[1][i] == -1) printf("L");
    if (X[0][i] == -1 && X[1][i] == 1) printf("D");
    if (X[0][i] == 1 && X[1][i] == -1) printf("U");
    if (X[0][i] == 1 && X[1][i] == 1) printf("R");
  }
  puts("");
  return 0;
}