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 MOD = 1e9 + 7;
const int SIZE = 2e5 + 10;
bool res[2][SIZE * 10];
long long a[SIZE], b[SIZE], x[SIZE], y[SIZE], t[SIZE];
int n, l;
char an[SIZE * 10];
pair<int, int> tmp[SIZE];
bool get(bool ha[], long long d[]) {
  for (int i = 0; i < (n); ++i) {
    if ((t[i] + d[i]) % 2) return 0;
    d[i] = (t[i] + d[i]) / 2;
    if (d[i] > t[i] || d[i] < 0) return 0;
  }
  static bool first_come = 1;
  if (first_come) {
    for (int i = 0; i < (n); ++i) tmp[i] = make_pair(t[i] % l, i);
    sort(tmp, tmp + n);
    first_come = 0;
  }
  int mi = l + 1, id = -1;
  tmp[n] = tmp[0];
  tmp[n].first += l;
  vector<int> check;
  int base = 0;
  for (int i = (1); i < (n + 1); ++i) {
    if (t[tmp[i].second] / l != t[tmp[i - 1].second] / l + (i == n)) {
      check.push_back(i);
      if (tmp[i].first - tmp[i - 1].first < mi) {
        id = i;
        mi = tmp[i].first - tmp[i - 1].first;
      }
    } else {
      int one = d[tmp[i].second] - d[tmp[i - 1].second];
      if (one > tmp[i].first - tmp[i - 1].first) return 0;
      for (int j = 0; j < (one); ++j) ha[(tmp[i - 1].first + j) % l] = 1;
    }
  }
  for (int one = 0; one < (mi + 1); ++one) {
    int x = tmp[id - 1].second;
    int y = tmp[id].second;
    long long all = (d[y] - (d[x] + one)) / ((t[y] / l - (t[x] + mi) / l));
    if (all > l) continue;
    bool err = 0;
    int check_sum = 0;
    for (int i = 0; i < (((int)(check).size())); ++i) {
      int nx = tmp[check[i] - 1].second;
      int ny = tmp[check[i]].second;
      long long dd = (tmp[check[i]].first - tmp[check[i] - 1].first + l) % l;
      check_sum += dd;
      int nxt_one = d[ny] - d[nx] - all * ((t[ny] / l - (t[nx] + dd) / l));
      if (nxt_one > dd || nxt_one < 0) {
        err = 1;
        break;
      }
    }
    if (!err) {
      for (int i = 0; i < (((int)(check).size())); ++i) {
        int nx = tmp[check[i] - 1].second;
        int ny = tmp[check[i]].second;
        long long dd = (tmp[check[i]].first - tmp[check[i] - 1].first + l) % l;
        int nxt_one = d[ny] - d[nx] - all * ((t[ny] / l - (t[nx] + dd) / l));
        for (int j = 0; j < (nxt_one); ++j)
          ha[(tmp[check[i] - 1].first + j) % l] = 1;
      }
      if (!check_sum) {
        for (int j = 0; j < (all); ++j) ha[j] = 1;
      }
      return 1;
    }
  }
  return 0;
}
int main() {
  scanf("%d%d", &(n), &(l));
  n++;
  for (int i = (1); i < (n); ++i) scanf("%I64d%I64d%I64d", &t[i], &x[i], &y[i]);
  for (int i = 0; i < (n); ++i) {
    a[i] = x[i] + y[i];
    b[i] = x[i] - y[i];
  }
  if (!get(res[0], a) || !get(res[1], b))
    puts("NO");
  else {
    for (int i = 0; i < (l); ++i) {
      if (res[0][i] && res[1][i])
        an[i] = 'R';
      else if (res[0][i])
        an[i] = 'U';
      else if (res[1][i])
        an[i] = 'D';
      else
        an[i] = 'L';
    }
    puts(an);
  }
  return 0;
}