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;
template <class T>
void splitstr(const string &s, vector<T> &out) {
  istringstream in(s);
  out.clear();
  copy(istream_iterator<T>(in), istream_iterator<T>(), back_inserter(out));
}
template <class T>
T gcd(T a, T b) {
  return b ? gcd(b, a % b) : a;
}
static void redirect(int argc, const char **argv) {
  ios::sync_with_stdio(false);
  if (argc > 1) {
    static filebuf f;
    f.open(argv[1], ios::in);
    cin.rdbuf(&f);
    if (!cin) {
      cerr << "Failed to open '" << argv[1] << "'" << endl;
      exit(1);
    }
  }
  if (argc > 2) {
    static filebuf f;
    f.open(argv[2], ios::out | ios::trunc);
    cout.rdbuf(&f);
    if (!cout) {
      cerr << "Failed to open '" << argv[2] << "'" << endl;
    }
  }
}
struct event {
  long long phase;
  long long rep;
  long long x, y;
  bool operator<(const event &b) const { return phase < b.phase; }
};
static void bad() {
  cout << "NO\n";
  exit(0);
}
static long long div_down(long long p, long long q) {
  long long r = p / q;
  if (r * q > p) r--;
  return r;
}
static long long div_up(long long p, long long q) {
  long long r = p / q;
  if (r * q < p) r++;
  return r;
}
static long long parity(long long x) { return (unsigned long long)x & 1; }
int main(int argc, const char **argv) {
  redirect(argc, argv);
  long long N, L;
  cin >> N >> L;
  vector<event> events;
  events.reserve(N + 2);
  for (long long i = 0; i < N; i++) {
    long long t, p, q;
    cin >> t >> p >> q;
    long long x = p + q;
    long long y = p - q;
    if (parity(x) != parity(t)) bad();
    events.push_back(event{t % L, t / L, x, y});
  }
  events.push_back(event{0, 0, 0, 0});
  events.push_back(event{L, -1, 0, 0});
  N += 2;
  sort(begin(events), end(events));
  long long minx = -L;
  long long maxx = L;
  long long miny = -L;
  long long maxy = L;
  for (long long i = 1; i < N; i++) {
    event e1 = events[i - 1];
    event e2 = events[i];
    long long rep = e1.rep - e2.rep;
    if (rep < 0) {
      swap(e1, e2);
      rep = -rep;
    }
    long long dt = llabs(e1.phase - e2.phase);
    long long dx = e1.x - e2.x;
    long long dy = e1.y - e2.y;
    if (rep == 0) {
      if (llabs(dx) > dt || llabs(dy) > dt) bad();
    } else {
      minx = max(minx, div_up(dx - dt, rep));
      maxx = min(maxx, div_down(dx + dt, rep));
      miny = max(miny, div_up(dy - dt, rep));
      maxy = min(maxy, div_down(dy + dt, rep));
    }
  }
  if (parity(minx) != parity(L)) minx++;
  if (parity(miny) != parity(L)) miny++;
  if (parity(maxx) != parity(L)) maxx--;
  if (parity(maxy) != parity(L)) maxy--;
  if (minx > maxx || miny > maxy) bad();
  string seq;
  for (event &e : events) {
    e.x -= e.rep * minx;
    e.y -= e.rep * miny;
    e.rep = 0;
  }
  for (long long i = 1; i < N; i++) {
    long long dx = events[i].x - events[i - 1].x;
    long long dy = events[i].y - events[i - 1].y;
    for (int j = events[i - 1].phase; j < events[i].phase; j++) {
      char c;
      if (dx > 0 && dy > 0)
        c = 'R', dx--, dy--;
      else if (dx > 0)
        c = 'U', dx--, dy++;
      else if (dy > 0)
        c = 'D', dx++, dy--;
      else
        c = 'L', dx++, dy++;
      seq += c;
    }
    assert(dx == 0 && dy == 0);
  }
  cout << seq << '\n';
  return 0;
}