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;
pair<long long, long long> operator-(const pair<long long, long long> &a,
                                     const pair<long long, long long> &b) {
  return make_pair(a.first - b.first, a.second - b.second);
}
const int MAXL = (int)2e6 + 10;
const long long INF = (long long)1e18;
const int dir[4][2] = {{1, 1}, {-1, 1}, {1, -1}, {-1, -1}};
int n, l;
pair<long long, long long> a[MAXL], b[MAXL];
long long Sx = INF, Sy = INF, c[4], d[4];
void Add(pair<long long, long long> &w, long long a, long long b,
         long long &Sx) {
  if (w == make_pair(INF, INF)) w = make_pair(a, b);
  if (w == make_pair(a, b)) return;
  long long s = (w.second - b) / (a - w.first);
  if (a * s + b != w.first * s + w.second) puts("NO"), exit(0);
  if (Sx == INF) Sx = s;
  w = make_pair(a, b);
  if (Sx != s) puts("NO"), exit(0);
}
bool check(long long Sx, long long Sy) {
  static char ch[MAXL];
  for (int i = 1, pre = 0; i <= l; ++i)
    if (a[i] != make_pair(INF, INF)) {
      pair<long long, long long> first = a[i] - a[pre], second = b[i] - b[pre];
      long long a = first.first * Sx + first.second,
                b = second.first * Sy + second.second;
      if (abs(a) + abs(b) > i - pre || ((i - pre - abs(a) - abs(b)) & 1))
        return 0;
      for (int j = pre; j < pre + abs(a); ++j) ch[j] = (a > 0) ? 'R' : 'L';
      for (int j = pre + abs(a); j < pre + abs(a) + abs(b); ++j)
        ch[j] = (b > 0) ? 'U' : 'D';
      for (int j = pre + abs(a) + abs(b); j < i; ++j)
        ch[j] = (j & 1) ? 'U' : 'D';
      pre = i;
    }
  puts(ch);
  return 1;
}
int main() {
  scanf("%d%d", &n, &l);
  for (int i = 1; i < l; ++i) a[i] = b[i] = make_pair(INF, INF);
  a[l] = b[l] = make_pair(1, 0);
  for (int i = 1; i <= n; ++i) {
    long long t, first, second;
    scanf("%I64d%I64d%I64d", &t, &first, &second);
    if (!t && (first || second)) puts("NO"), exit(0);
    long long id = t % l;
    if (!id) id = l;
    Add(a[id], -((t - 1) / l), first, Sx);
    Add(b[id], -((t - 1) / l), second, Sy);
  }
  for (int i = 0; i < 4; ++i) c[i] = -INF, d[i] = INF;
  for (int i = 1, pre = 0; i <= l; ++i)
    if (a[i] != make_pair(INF, INF)) {
      pair<long long, long long> first = a[i] - a[pre], second = b[i] - b[pre];
      for (int k = 0; k < 4; ++k) {
        long long a = first.first,
                  b = (long long)(i - pre) -
                      (first.second * dir[k][0] + second.second * dir[k][1]);
        if (a > 0) d[k] = min(d[k], b / a);
        if (a < 0) c[k] = max(c[k], b / a);
      }
      pre = i;
    }
  for (int i = -l; i <= l; ++i) {
    if (Sx != INF) i = Sx;
    long long l = -INF, r = INF;
    for (int k = 0; k < 4; ++k) {
      long long al = c[k] - dir[k][0] * i, ar = d[k] - dir[k][0] * i;
      if (dir[k][1] == 1)
        l = max(l, al), r = min(r, ar);
      else
        l = max(l, -ar), r = min(r, -al);
    }
    if (l <= r)
      if (Sy == INF || (l <= Sy && Sy <= r)) {
        Sx = i;
        if (Sy == INF) Sy = l;
        break;
      }
    if (i == Sx) break;
  }
  if (Sx == INF || Sy == INF) puts("NO"), exit(0);
  for (int dx = -1; dx <= 1; ++dx)
    for (int dy = -1; dy <= 1; ++dy)
      if (check(Sx + dx, Sy + dy)) exit(0);
  puts("NO");
  fclose(stdin);
  fclose(stdout);
  return 0;
}