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 = 200010;
const int maxl = 2000010;
const int inf = 0x3f3f3f3f;
int vis[maxl], n, l;
long long cx[maxl], cy[maxl], k[maxl];
int t_x[maxl], t_y[maxl];
int ra = -1, rb = -1;
long long lb_a, rb_a, lb_b, rb_b;
int found;
long long vx, vy;
string ans;
long long lceil(double x) { return (long long)ceil(x); }
long long lfloor(double x) { return (long long)floor(x); }
void calans() {
  int last = 0, cur_x = 0, cur_y = 0;
  for (int i = 1; i <= l; i++) {
    if (vis[i]) {
      int x = t_x[i], y = t_y[i];
      if (abs(x - cur_x) + abs(y - cur_y) <= i - last) {
        int cnt = i - last;
        while (x < cur_x) {
          ans.push_back('L');
          --cur_x;
          cnt--;
        }
        while (x > cur_x) {
          ans.push_back('R');
          ++cur_x;
          cnt--;
        }
        while (y < cur_y) {
          ans.push_back('D');
          --cur_y;
          cnt--;
        }
        while (y > cur_y) {
          ans.push_back('U');
          ++cur_y;
          cnt--;
        }
        if (cnt & 1) {
          puts("NO");
          exit(0);
        }
        while (cnt) {
          ans.push_back('L');
          ans.push_back('R');
          cnt -= 2;
        }
        cur_x = x, cur_y = y, last = i;
      } else {
        puts("NO");
        exit(0);
      }
    }
  }
}
int main() {
  scanf("%d%d", &n, &l);
  vis[0] = 1;
  lb_a = lb_b = -inf;
  rb_a = rb_b = inf;
  for (int i = 1; i <= n; i++) {
    long long t, x, y;
    scanf("%lld%lld%lld", &t, &x, &y);
    if ((((x + y) % 2 + 2) ^ t) & 1) {
      puts("NO");
      return 0;
    }
    if (vis[t % l]) {
      if (t / l == k[t % l]) {
        if (cx[t % l] == x && cy[t % l] == y) {
          continue;
        } else {
          puts("NO");
          return 0;
        }
      } else {
        if ((cx[t % l] - x) % (k[t % l] - t / l)) {
          puts("NO");
          return 0;
        }
        if ((cy[t % l] - y) % (k[t % l] - t / l)) {
          puts("NO");
          return 0;
        }
        long long _vx = (cx[t % l] - x) / (k[t % l] - t / l);
        long long _vy = (cy[t % l] - y) / (k[t % l] - t / l);
        if (found) {
          if (vx != _vx || vy != _vy) {
            puts("NO");
            return 0;
          }
        } else {
          vx = _vx;
          vy = _vy;
          found = 1;
        }
      }
    } else {
      vis[t % l] = 1;
      cx[t % l] = x, cy[t % l] = y;
      k[t % l] = t / l;
    }
  }
  if (!found) {
    vis[l] = 1;
    cx[l] = cy[l] = 0;
    k[l] = -1;
    int last = 0;
    for (int i = 1; i <= l; i++) {
      if (vis[i]) {
        if (k[i] < k[last]) {
          rb_a = min(rb_a, lfloor(1.0 *
                                  (i - last -
                                   ((cx[i] - cy[i]) - (cx[last] - cy[last]))) /
                                  (k[last] - k[i])));
          lb_a =
              max(lb_a,
                  lceil(1.0 *
                        (last - i - ((cx[i] - cy[i]) - (cx[last] - cy[last]))) /
                        (k[last] - k[i])));
          rb_b = min(rb_b, lfloor(1.0 *
                                  (i - last -
                                   ((cx[i] + cy[i]) - (cx[last] + cy[last]))) /
                                  (k[last] - k[i])));
          lb_b =
              max(lb_b,
                  lceil(1.0 *
                        (last - i - ((cx[i] + cy[i]) - (cx[last] + cy[last]))) /
                        (k[last] - k[i])));
        } else if (k[i] > k[last]) {
          rb_a = min(rb_a, lfloor(1.0 *
                                  (last - i -
                                   ((cx[i] - cy[i]) - (cx[last] - cy[last]))) /
                                  (k[last] - k[i])));
          lb_a =
              max(lb_a,
                  lceil(1.0 *
                        (i - last - ((cx[i] - cy[i]) - (cx[last] - cy[last]))) /
                        (k[last] - k[i])));
          rb_b = min(rb_b, lfloor(1.0 *
                                  (last - i -
                                   ((cx[i] + cy[i]) - (cx[last] + cy[last]))) /
                                  (k[last] - k[i])));
          lb_b =
              max(lb_b,
                  lceil(1.0 *
                        (i - last - ((cx[i] + cy[i]) - (cx[last] + cy[last]))) /
                        (k[last] - k[i])));
        } else {
          long long ta = (cx[i] - cy[i]) - (cx[last] - cy[last]);
          long long tb = (cx[i] + cy[i]) - (cx[last] + cy[last]);
          if (ta > i - last || ta < last - i || tb > i - last ||
              tb < last - i) {
            puts("NO");
            return 0;
          }
        }
        if ((k[i] ^ k[last]) & 1) {
          ra = rb = ((i - last) ^ cx[i] ^ cy[i] ^ cx[last] ^ cy[last]) & 1;
        }
        last = i;
      }
    }
    if (ra >= 0 && ((lb_a ^ ra) & 1)) ++lb_a;
    if (rb >= 0 && ((lb_b ^ rb) & 1)) ++lb_b;
    if (ra >= 0 && ((rb_a ^ ra) & 1)) --rb_a;
    if (rb >= 0 && ((rb_b ^ rb) & 1)) ++rb_b;
    if (lb_a > rb_a || lb_b > rb_b) {
      puts("NO");
      return 0;
    }
    if ((lb_a + lb_b) & 1) {
      if (!ra && lb_a + 1 <= rb_a) {
        lb_a++;
      } else if (!rb && lb_b + 1 <= rb_b) {
        lb_b++;
      } else {
        puts("NO");
        return 0;
      }
    }
    vx = (lb_a + lb_b) / 2;
    vy = (lb_b - lb_a) / 2;
  }
  vis[l] = 1;
  t_x[l] = vx, t_y[l] = vy;
  for (int i = 1; i < l; i++) {
    long double _x = cx[i] - (long double)k[i] * vx;
    long double _y = cy[i] - (long double)k[i] * vy;
    if (_x + _y > i || _x + _y < -i) {
      puts("NO");
      return 0;
    }
    t_x[i] = cx[i] - k[i] * vx;
    t_y[i] = cy[i] - k[i] * vy;
  }
  calans();
  cout << ans << endl;
  return 0;
}