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 int maxn = 200000 + 10;
struct pll {
  long long x, y;
};
pll cal(long long k, long long a, long long b) {
  assert(k > 0);
  pll p;
  p.x = (a > 0 ? (a - 1) / k + 1 : a / k);
  p.y = (b >= 0 ? b / k : (b + 1) / k - 1);
  return p;
}
struct P {
  int id;
  long long a, b, c, d;
  bool operator<(const P &rhs) const { return id < rhs.id; }
} p[maxn];
struct cond {
  long long a, b, c, d, e;
} con[maxn];
int ccnt;
pll get_interval(long long x, int &pa) {
  pll ret = (pll){-(1LL << 60), (1LL << 60)};
  pa = 3;
  for (int i = 0; i < ccnt; i++) {
    if (con[i].a % 2) {
      int z = ((con[i].e - x - con[i].d - con[i].b) % 2 + 2) % 2;
      if (z == 0 && (pa & 1)) pa ^= 1;
      if (z == 1 && (pa & 2)) pa ^= 2;
    }
    long long val = con[i].e - ((x * con[i].a + con[i].b) > 0
                                    ? (x * con[i].a + con[i].b)
                                    : (-(x * con[i].a + con[i].b)));
    pll tmp = cal(con[i].c, -val - con[i].d, val - con[i].d);
    ret.x = max(ret.x, tmp.x);
    ret.y = min(ret.y, tmp.y);
  }
  return ret;
}
int n, L;
void found_ans(long long x, long long y) {
  for (int i = 0; i < n + 1; i++) {
    if (p[i].id == p[i + 1].id) continue;
    long long x1 = x * p[i].a + p[i].b, y1 = y * p[i].c + p[i].d;
    long long x2 = x * p[i + 1].a + p[i + 1].b,
              y2 = y * p[i + 1].c + p[i + 1].d;
    long long dx = x2 - x1, dy = y2 - y1, dis = p[i + 1].id - p[i].id;
    assert(((dx) > 0 ? (dx) : (-(dx))) + ((dy) > 0 ? (dy) : (-(dy))) <= dis);
    assert((dis + dx + dy) % 2 == 0);
    dis -= ((dx) > 0 ? (dx) : (-(dx))) + ((dy) > 0 ? (dy) : (-(dy)));
    while (dx < 0) putchar('L'), dx++;
    while (dx > 0) putchar('R'), dx--;
    while (dy < 0) putchar('D'), dy++;
    while (dy > 0) putchar('U'), dy--;
    while (dis) putchar('L'), putchar('R'), dis -= 2;
  }
}
int main() {
  scanf("%d%d", &n, &L);
  for (int i = 1; i <= n; i++) {
    long long t, x, y;
    scanf("%I64d%I64d%I64d", &t, &x, &y);
    if ((t + x + y) % 2) {
      printf("NO\n");
      return 0;
    }
    long long u = t / L;
    int v = t % L;
    p[i] = (P){v, -u, x, -u, y};
  }
  p[0] = (P){0, 0, 0, 0, 0};
  p[n + 1] = (P){L, 1, 0, 1, 0};
  sort(p, p + n + 2);
  for (int i = 0; i < n + 1; i++) {
    long long a = p[i].a - p[i + 1].a, b = p[i].b - p[i + 1].b;
    long long c = p[i].c - p[i + 1].c, d = p[i].d - p[i + 1].d;
    if (!a) {
      if (((b) > 0 ? (b) : (-(b))) + ((d) > 0 ? (d) : (-(d))) >
          p[i + 1].id - p[i].id) {
        printf("NO\n");
        return 0;
      }
      continue;
    }
    if (a < 0) a = -a, b = -b, c = -c, d = -d;
    con[ccnt++] = (cond){a, b, c, d, p[i + 1].id - p[i].id};
  }
  int mi = L + 1, mid;
  for (int i = 0; i < ccnt; i++)
    if (con[i].e < mi) mi = con[mid = i].e;
  pll tmp = cal(con[mid].a, -con[mid].e - con[mid].b, con[mid].e - con[mid].b);
  for (long long i = tmp.x; i <= tmp.y; i++) {
    int pa;
    pll tmp2 = get_interval(i, pa);
    if ((tmp2.x % 2) && !(pa & 1)) tmp2.x++;
    if ((tmp2.x % 2 == 0) && !(pa & 2)) tmp2.x++;
    if (tmp2.y >= tmp2.x && pa) {
      found_ans(i, tmp2.x);
      return 0;
    }
  }
  printf("NO\n");
}