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 warning(disable : 4996)
using namespace std;
int n, l;
long long a[300000][3];
long long b[300000][3];
long long t[300000][2];
vector<int> c[3000000];
vector<pair<long long, long long> > g;
long long p[3000000];
long long dab[3000000][2];
void sayno() {
  printf("NO");
  exit(0);
}
void calc() {
  int i, j, k;
  long long d = -1;
  for (i = 0; i < l; i++) {
    if (c[i].size() >= 2) {
      d = (t[c[i][1]][1] - t[c[i][0]][1]) /
          ((t[c[i][1]][0] - t[c[i][0]][0]) / l);
      break;
    }
  }
  if (d == -1) {
    int past = 0;
    g.clear();
    for (i = 1; i <= l; i++) {
      if (!c[i % l].size()) continue;
      int x = c[past][0], y = c[i % l][0];
      if (t[x][0] < t[y][0]) {
        long long u = (t[y][0] - t[x][0]) / l;
        long long v = t[y][1] - t[x][1];
        long long w = (t[y][0] - t[x][0]) % l;
        if (u != 0)
          g.push_back(pair<long long, long long>((v - w + u - 1) / u, v / u));
      } else {
        long long u = (t[x][0] - t[y][0]) / l + 1;
        long long v = t[x][1] - t[y][1];
        long long w = t[y][0] + u * l - t[x][0];
        if (u != 0)
          g.push_back(pair<long long, long long>((v + u - 1) / u, (v + w) / u));
      }
      past = i;
    }
    sort(g.begin(), g.end());
    for (auto e : g) {
      if (e.second < g.back().first) sayno();
    }
    d = g.back().first;
  }
  memset(p, -1, sizeof(p));
  for (i = 0; i < n; i++) {
    long long u = t[i][1] - d * (t[i][0] / l);
    long long v = t[i][0] % l;
    if (p[v] == -1)
      p[v] = u;
    else if (p[v] != u)
      sayno();
  }
  p[l] = d;
  int past = 0;
  for (i = 1; i <= l; i++) {
    if (p[i] == -1) continue;
    if (p[i] - p[past] < 0 || p[i] - p[past] > i - past) sayno();
    for (j = 0; j < p[i] - p[past]; j++) {
      dab[past + j][1] = 1;
    }
    for (j = p[i] - p[past]; j < i - past; j++) {
      dab[past + j][1] = -1;
    }
    past = i;
  }
}
int main() {
  int i, j, k;
  cin >> n >> l;
  for (i = 0; i <= n; i++) {
    if (i != 0) scanf("%I64d%I64d%I64d", &a[i][0], &a[i][1], &a[i][2]);
    b[i][0] = a[i][0], b[i][1] = a[i][1] + a[i][2], b[i][2] = a[i][1] - a[i][2];
    if ((b[i][1] + b[i][0]) % 2 == 1 || (b[i][2] + b[i][0]) % 2 == 1) sayno();
    b[i][1] = (b[i][1] + b[i][0]) / 2, b[i][2] = (b[i][2] + b[i][0]) / 2;
    c[b[i][0] % l].push_back(i);
  }
  n++;
  for (i = 0; i < n; i++) t[i][0] = b[i][0], t[i][1] = b[i][1];
  calc();
  for (i = 0; i < l; i++) dab[i][0] = dab[i][1];
  for (i = 0; i < n; i++) t[i][0] = b[i][0], t[i][1] = b[i][2];
  calc();
  for (i = 0; i < l; i++) {
    if (dab[i][0] == -1 & dab[i][1] == -1)
      printf("L");
    else if (dab[i][0] == 1 && dab[i][1] == 1)
      printf("R");
    else if (dab[i][0] == -1 && dab[i][1] == 1)
      printf("D");
    else
      printf("U");
  }
  return 0;
}