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 long long inf = 1e18;
struct Task {
  int n, l;
  struct item {
    long long t, x, y, cmp;
    friend bool operator<(const item& a, const item& b) {
      return a.cmp < b.cmp;
    }
  };
  struct ineq {
    long long beforeMin, afterMin, beforeMax, afterMax, when;
    friend bool operator<(const ineq& a, const ineq& b) {
      return a.when < b.when;
    }
  };
  vector<item> items;
  Task(int n, int l) : n(n), l(l), items(n) {
    for (auto& item : items) {
      cin >> item.t >> item.x >> item.y;
      item.cmp = item.t % l;
    }
  }
  long long mfloor(long long x, long long d) {
    long long result = x / d;
    if (x < 0 && x % d != 0) --result;
    return result;
  }
  long long mceil(long long x, long long d) {
    long long result = x / d;
    if (x > 0 && x % d != 0) ++result;
    return result;
  }
  ineq createIneq(long long x1, long long y1, long long a1, long long x2,
                  long long y2, long long a2, long long t) {
    if (a1 > a2) {
      swap(x1, x2);
      swap(y1, y2);
      swap(a1, a2);
    }
    ineq result;
    result.when = mceil(x2 - x1, a2 - a1);
    long long before = t + x1 - x2;
    result.beforeMin = mfloor(before - y1 + y2, a2 - a1);
    result.beforeMax = mceil(-before - y1 + y2, a2 - a1);
    long long after = t - x1 + x2;
    result.afterMin = mfloor(after - y1 + y2, a2 - a1);
    result.afterMax = mceil(-after - y1 + y2, a2 - a1);
    return result;
  }
  void move(string& result, int& x, int& y, int nx, int ny, int diff) {
    while (x < nx) ++x, result += "R", --diff;
    while (x > nx) --x, result += "L", --diff;
    while (y < ny) ++y, result += "U", --diff;
    while (y > ny) --y, result += "D", --diff;
    while (diff > 0) {
      result += "LR";
      diff -= 2;
    }
  }
  string computeAnswer(int dx, int dy) {
    string result;
    int x = 0, y = 0;
    int t = 0;
    for (auto& item : items) {
      int nx = item.x - (item.t / l) * dx;
      int ny = item.y - (item.t / l) * dy;
      int diff = item.t % l - t;
      move(result, x, y, nx, ny, diff);
      t = item.t % l;
    }
    move(result, x, y, dx, dy, l - t);
    return result;
  }
  void run() {
    for (auto& item : items) {
      if ((abs(item.x) + abs(item.y)) % 2 != item.t % 2) {
        cout << "NO" << endl;
        return;
      }
    }
    items.push_back({0, 0, 0, 0});
    sort(items.begin(), items.end());
    vector<ineq> q;
    for (int i = 1; i < (int)items.size(); ++i) {
      long long x1, y1, a1;
      long long x2, y2, a2;
      long long t = items[i].cmp - items[i - 1].cmp;
      x1 = items[i - 1].x;
      y1 = items[i - 1].y;
      a1 = items[i - 1].t / l;
      x2 = items[i].x;
      y2 = items[i].y;
      a2 = items[i].t / l;
      if (a1 == a2) {
        if (abs(x1 - x2) + abs(y1 - y2) > t) {
          cout << "NO" << endl;
          return;
        }
        continue;
      }
      q.push_back(createIneq(x1, y1, a1, x2, y2, a2, t));
    }
    q.push_back(createIneq(items.back().x, items.back().y, items.back().t / l,
                           0, 0, -1, l - items.back().cmp));
    sort(q.begin(), q.end());
    vector<long long> mn(q.size() + 1), mx(q.size() + 1);
    mn.back() = inf;
    mx.back() = -inf;
    for (int i = (int)q.size() - 1; i >= 0; --i) {
      mn[i] = min(mn[i + 1], q[i].beforeMin);
      mx[i] = max(mx[i + 1], q[i].beforeMax);
    }
    int j = 0;
    long long mnAfter = inf, mxAfter = -inf;
    for (int x = -l; x <= l; ++x) {
      while (j < (int)q.size() && q[j].when <= x) {
        mnAfter = min(mnAfter, q[j].afterMin);
        mxAfter = max(mxAfter, q[j].afterMax);
        ++j;
      }
      long long lb = max(mxAfter + x, mx[j] - x);
      long long rb = min(mnAfter - x, mn[j] + x);
      lb = max(lb, (long long)(abs(x) - l));
      rb = min(rb, (long long)(l - abs(x)));
      lb += (abs(x) + abs(lb)) % 2 != l % 2;
      if (lb > rb) {
        continue;
      }
      cout << computeAnswer(x, lb) << endl;
      return;
    }
    cout << "NO" << endl;
  }
};
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, l;
  cin >> n >> l;
  Task a(n, l);
  a.run();
  return 0;
}