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;
int N, L;
long long T[200002], X[200002], Y[200002];
long long aT[200002], aX[200002], aY[200002];
int pos[200002];
int W1[2000002], W2[2000002];
inline int gett(long long x) {
  if (x == 0) return 0;
  return (x % L == 0 ? L : x % L);
}
inline bool compare(const int& i1, const int& i2) {
  return gett(T[i1]) > gett(T[i2]);
}
inline void constr(long long i1, long long i2, long long need, long long tm,
                   long long& v1, long long& v2) {
  if (tm == 0 && !(i1 <= need && need <= i2)) {
    cout << "NO\n";
    exit(0);
  } else if (tm == 0)
    return;
  if (tm < 0) {
    long long lim1 = ((i1 - need) / (-tm) + ((i1 - need) % (-tm) != 0));
    if (i1 - need < 0) lim1 = 0;
    long long lim2 = (i2 - need) / (-tm);
    if (i2 - need < 0) lim2 = -1;
    v1 = max(v1, lim1);
    v2 = min(v2, lim2);
  } else {
    long long lim1 = ((need - i2) / tm + ((need - i2) % tm != 0));
    if (need - i2 < 0) lim1 = 0;
    long long lim2 = ((need - i1) / tm);
    if (need - i1 < 0) lim2 = -1;
    v1 = max(v1, lim1);
    v2 = min(v2, lim2);
  }
}
int main() {
  cin.sync_with_stdio(false);
  cin >> N >> L;
  for (int i = 1; i <= N; ++i) {
    cin >> T[i] >> X[i] >> Y[i];
    if ((T[i] + X[i] + Y[i]) % 2 != 0 || T[i] + X[i] + Y[i] < 0) {
      cout << "NO\n";
      return 0;
    }
    aT[i] = T[i];
    aX[i] = X[i];
    aY[i] = Y[i];
    pos[i] = i;
  }
  sort(pos + 1, pos + N + 1, compare);
  for (int i = 1; i <= N; ++i) {
    T[i] = aT[pos[i]];
    X[i] = aX[pos[i]];
    Y[i] = aY[pos[i]];
  }
  long long v1 = 0, v2 = L;
  for (int i = 1; i <= N; ++i) {
    long long need1 = (X[i] + Y[i] + T[i]) / 2;
    long long need2 = (X[i + 1] + Y[i + 1] + T[i + 1]) / 2;
    long long need = need1 - need2;
    long long tm = ((T[i] - 1) / L) - ((T[i + 1] - 1) / L);
    long long i1 = 0, i2 = gett(T[i]) - gett(T[i + 1]);
    constr(i1, i2, need, tm, v1, v2);
    constr(0, (1LL << 60), need1, ((T[i] - 1) / L), v1, v2);
    constr(-(1LL << 60), 0, need1, ((T[i] - 1) / L) + 1, v1, v2);
  }
  if (v1 > v2) {
    cout << "NO\n";
    return 0;
  }
  int last = 0;
  for (int i = N; i >= 1; --i) {
    long long need = (X[i] + Y[i] + T[i]) / 2;
    W1[gett(T[i])] = need - v1 * ((T[i] - 1) / L);
    int now = gett(T[i]), dif = W1[now] - W1[last];
    for (int j = last + 1; j <= now; ++j) {
      W1[j] = W1[j - 1] + (dif > 0);
      --dif;
    }
    last = now;
  }
  int df = v1 - W1[last];
  for (int i = last + 1; i <= L; ++i) {
    W1[i] = W1[i - 1] + (df > 0);
    --df;
  }
  v1 = 0, v2 = L;
  for (int i = 1; i <= N; ++i) {
    long long need1 = (X[i] - Y[i] + T[i]) / 2;
    long long need2 = (X[i + 1] - Y[i + 1] + T[i + 1]) / 2;
    long long need = need1 - need2;
    long long tm = ((T[i] - 1) / L) - ((T[i + 1] - 1) / L);
    long long i1 = 0, i2 = gett(T[i]) - gett(T[i + 1]);
    constr(i1, i2, need, tm, v1, v2);
    constr(0, (1LL << 60), need1, ((T[i] - 1) / L), v1, v2);
    constr(-(1LL << 60), 0, need1, ((T[i] - 1) / L) + 1, v1, v2);
  }
  if (v1 > v2) {
    cout << "NO\n";
    return 0;
  }
  last = 0;
  for (int i = N; i >= 1; --i) {
    long long need = (X[i] - Y[i] + T[i]) / 2;
    W2[gett(T[i])] = need - v1 * ((T[i] - 1) / L);
    int now = gett(T[i]), dif = W2[now] - W2[last];
    for (int j = last + 1; j <= now; ++j) {
      W2[j] = W2[j - 1] + (dif > 0);
      --dif;
    }
    last = now;
  }
  df = v1 - W2[last];
  for (int i = last + 1; i <= L; ++i) {
    W2[i] = W2[i - 1] + (df > 0);
    --df;
  }
  for (int i = 1; i <= L; ++i) {
    int sum = (W1[i] == W1[i - 1] ? -1 : 1);
    int dif = (W2[i] == W2[i - 1] ? -1 : 1);
    int gox = (sum + dif) / 2;
    int goy = sum - gox;
    if (gox == 1)
      cout << 'R';
    else if (gox == -1)
      cout << 'L';
    else if (goy == 1)
      cout << 'U';
    else
      cout << 'D';
  }
  cout << '\n';
}