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;
#pragma comment(linker, "/STACK:255000000")
bool firstout = 1;
template <class T>
T &minn(T &a, T b) {
  if (b < a) a = b;
  return a;
}
template <class T>
T &maxx(T &a, T b) {
  if (a < b) a = b;
  return a;
}
int &madd(int &a, int b) {
  a += b;
  if (a >= 1000000007) a -= 1000000007;
  return a;
}
int &msub(int &a, int b) {
  a -= b;
  if (a < 0) a += 1000000007;
  return a;
}
int &mmult(int &a, int b) { return a = (long long)a * b % 1000000007; }
int mdiv(long long a, long long b, long long m) {
  a = (a % m + m) % m;
  b = (b % m + m) % m;
  if (a % b == 0) return a / b;
  return (a + m * mdiv(-a, m, b)) / b;
}
char DS[5] = "ULDR";
int DX[4] = {1, -1, -1, 1};
int DY[4] = {-1, -1, 1, 1};
int n, m, q;
int RX[2012345], RY[2012345];
long long X[2012345], Y[2012345], T[2012345];
pair<pair<long long, long long>, pair<long long, long long> > P[2012345];
bool bld(long long *X, int *R, long long x) {
  long long a1 = 0;
  int i, j;
  j = 0;
  for (i = (0); i < (n); ++i) {
    long long a2 = X[i] - T[i] / m * x;
    long long t2 = T[i] % m;
    for (; j < t2; ++j) {
      if (a2 > a1)
        R[j] = 1;
      else
        R[j] = -1;
      a1 += R[j];
    }
    if (a1 != a2) return 0;
    a1 = a2;
  }
  long long a2 = x;
  long long t2 = m;
  for (; j < t2; ++j) {
    if (a2 > a1)
      R[j] = 1;
    else
      R[j] = -1;
    a1 += R[j];
  }
  if (a1 != a2) return 0;
  return 1;
}
bool fnd(long long *X, int *R) {
  long long mn = -m;
  long long mx = m;
  long long a1 = 0;
  long long k1 = 0;
  long long t1 = 0;
  int i;
  for (i = (0); i < (n); ++i) {
    long long a2 = X[i];
    long long k2 = T[i] / m;
    long long t2 = T[i] % m;
    long long t = t2 - t1;
    if (k1 == k2) {
      if (abs(a1 - a2) > t) return 0;
    } else if (k2 > k1) {
      minn(mx, (t - a1 + a2) / (k2 - k1));
      maxx(mn, (-t - a1 + a2) / (k2 - k1));
    } else {
      maxx(mn, (t - a1 + a2) / (k2 - k1));
      minn(mx, (-t - a1 + a2) / (k2 - k1));
    }
    a1 = a2;
    k1 = k2;
    t1 = t2;
  }
  long long t = m - t1;
  maxx(mn, (a1 - t) / (k1 + 1));
  minn(mx, (a1 + t) / (k1 + 1));
  if (mn > mx) return 0;
  if (!bld(X, R, mn)) {
    if (mn == mx) return 0;
    return bld(X, R, mn + 1);
  }
  return 1;
}
int main() {
  int i, j, k;
  char c;
  int a, d;
  int ts;
  for (ts = 1; scanf("%"
                     "d",
                     &(n)) > 0;
       ++ts) {
    scanf(
        "%"
        "d",
        &(m));
    for (i = (0); i < (n); ++i) {
      scanf(
          "%"
          "I64d",
          &(T[i]));
      scanf(
          "%"
          "I64d",
          &(X[i]));
      scanf(
          "%"
          "I64d",
          &(Y[i]));
      P[i] = make_pair(make_pair(T[i] % m, T[i]),
                       make_pair(X[i] + Y[i], X[i] - Y[i]));
    }
    sort(P, P + n);
    for (i = (0); i < (n); ++i)
      T[i] = P[i].first.second, X[i] = P[i].second.first,
      Y[i] = P[i].second.second;
    bool res = 1;
    minn(res, fnd(X, RX));
    minn(res, fnd(Y, RY));
    if (!res)
      printf(
          "%"
          "s",
          ("NO")),
          printf("\n"), firstout = 1;
    else {
      for (i = (0); i < (m); ++i) {
        for (j = (0); j < (4); ++j)
          if (DX[j] == RX[i] && DY[j] == RY[i]) break;
        printf(
            "%"
            "c",
            (DS[j]));
      }
      printf("\n"), firstout = 1;
    }
  }
  return 0;
}