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 double pi = acos(0.0) * 2.0;
const long double eps = 1e-10;
const int step[8][2] = {{-1, 0}, {0, 1}, {1, 0},  {0, -1},
                        {-1, 1}, {1, 1}, {1, -1}, {-1, -1}};
template <class T>
inline T abs1(T a) {
  return a < 0 ? -a : a;
}
template <typename t, typename t1>
t min1(t a, t1 b) {
  return a < b ? a : b;
}
template <typename t, typename... arg>
t min1(t a, arg... arr) {
  return min1(a, min1(arr...));
}
template <typename t, typename t1>
t max1(t a, t1 b) {
  return a > b ? a : b;
}
template <typename t, typename... arg>
t max1(t a, arg... arr) {
  return max1(a, max1(arr...));
}
inline int jud(double a, double b) {
  if (abs(a) < eps && abs(b) < eps)
    return 0;
  else if (abs1(a - b) / abs1(a) < eps)
    return 0;
  if (a < b) return -1;
  return 1;
}
template <typename t>
inline int jud(t a, t b) {
  if (a < b) return -1;
  if (a == b) return 0;
  return 1;
}
template <typename it, typename t1>
inline int find(t1 val, it a, int na, bool f_small = 1, bool f_lb = 1) {
  int be = 0, en = na - 1;
  if (na == 0) return 0;
  if (*a <= *(a + na - 1)) {
    if (f_lb == 0)
      while (be < en) {
        int mid = (be + en + 1) / 2;
        if (jud(*(a + mid), val) != 1)
          be = mid;
        else
          en = mid - 1;
      }
    else
      while (be < en) {
        int mid = (be + en) / 2;
        if (jud(*(a + mid), val) != -1)
          en = mid;
        else
          be = mid + 1;
      }
    if (f_small && jud(*(a + be), val) == 1) be--;
    if (!f_small && jud(*(a + be), val) == -1) be++;
  } else {
    if (f_lb)
      while (be < en) {
        int mid = (be + en + 1) / 2;
        if (jud(*(a + mid), val) != -1)
          be = mid;
        else
          en = mid - 1;
      }
    else
      while (be < en) {
        int mid = (be + en) / 2;
        if (jud(*(a + mid), val) != 1)
          en = mid;
        else
          be = mid + 1;
      }
    if (!f_small && jud(*(a + be), val) == -1) be--;
    if (f_small && jud(*(a + be), val) == 1) be++;
  }
  return be;
}
template <class T>
inline T lowb(T num) {
  return num & (-num);
}
inline int bitnum(unsigned int nValue) { return __builtin_popcount(nValue); }
inline int bitnum(int nValue) { return __builtin_popcount(nValue); }
inline int bitnum(unsigned long long nValue) {
  return __builtin_popcount(nValue) + __builtin_popcount(nValue >> 32);
}
inline int bitnum(long long nValue) {
  return __builtin_popcount(nValue) + __builtin_popcount(nValue >> 32);
}
inline int bitmaxl(unsigned int a) {
  if (a == 0) return 0;
  return 32 - __builtin_clz(a);
}
inline int bitmaxl(int a) {
  if (a == 0) return 0;
  return 32 - __builtin_clz(a);
}
inline int bitmaxl(unsigned long long a) {
  int temp = a >> 32;
  if (temp) return 32 - __builtin_clz(temp) + 32;
  return bitmaxl(int(a));
}
inline int bitmaxl(long long a) {
  int temp = a >> 32;
  if (temp) return 32 - __builtin_clz(temp) + 32;
  return bitmaxl(int(a));
}
long long pow(long long n, long long m, long long mod = 0) {
  if (m < 0) return 0;
  long long ans = 1;
  long long k = n;
  while (m) {
    if (m & 1) {
      ans *= k;
      if (mod) ans %= mod;
    }
    k *= k;
    if (mod) k %= mod;
    m >>= 1;
  }
  return ans;
}
template <class t1, class t2>
inline void add(t1 &a, t2 b, int mod = -1) {
  if (mod == -1) mod = 1000000007;
  a += b;
  while (a >= mod) a -= mod;
  while (a < 0) a += mod;
}
template <class t>
void output1(t arr) {
  for (int i = 0; i < (int)arr.size(); i++) cerr << arr[i] << ' ';
  cerr << endl;
}
template <class t>
void output2(t arr) {
  for (int i = 0; i < (int)arr.size(); i++) output1(arr[i]);
}
const int maxn = 200100;
pair<long long, long long> arr[maxn];
int l, n;
long long orig[maxn][3];
map<long long, pair<pair<long long, long long>, long long> > mp;
pair<long long, pair<long long, long long> > tarr[maxn];
char ans[maxn * 10];
bool cmp(const pair<int, int> &a, const pair<int, int> &b) {
  return a.second % l < b.second % l;
}
inline int check(pair<long long, long long> a, pair<long long, long long> b,
                 long long rl, int cate = 0) {
  long long h1 = a.second / l, h2 = b.second / l;
  if (h1 == h2) return 0;
  if (h1 > h2) swap(a, b), swap(h1, h2);
  long long dt = abs(b.second % l - a.second % l);
  if (cate) {
    if (b.second == -l)
      dt = abs(l - a.second % l);
    else
      dt = abs(b.second % l - l);
  }
  if (a.first - rl * h1 > b.first - rl * h2) {
    if (a.first - rl * h1 > b.first - rl * h2 + dt) return 2;
    return 0;
  } else {
    if (a.first - rl * h1 < b.first - rl * h2 - dt) return 1;
    return 0;
  }
}
int check(int rl) {
  int flag = 0;
  for (int i = 0; i <= n; i++) flag |= check(arr[i], arr[i + 1], rl);
  flag |= check(make_pair(0, -l), arr[n], rl, 1);
  return flag;
}
int getl() {
  int be = -l, en = l;
  while (be < en) {
    int mid = (be + en) / 2;
    if (en - mid < mid - be) mid--;
    int rp = check(mid);
    if (rp == 3) {
      return -1000000007;
    }
    if (rp == 1)
      be = mid + 1;
    else
      en = mid;
  }
  if (check(be)) {
    return -1000000007;
  }
  if (!check(be + 1)) be += 1000000000;
  return be;
}
int main() {
  ios_base::sync_with_stdio(0);
  scanf("%d%d", &n, &l);
  int dx = -1000000007, dy = -1000000007;
  bool flag = 1;
  mp[0] = make_pair(make_pair(0, 0), 0);
  for (int i = 0; i < n; i++) {
    scanf("%I64d%I64d%I64d", orig[i] + 2, orig[i], orig[i] + 1);
    if ((orig[i][0] + orig[i][1] - (orig[i][2] & 1)) % 2) flag = 0;
    auto p = mp.find(orig[i][2] % l);
    if (p != mp.end()) {
      auto rp = p->second;
      long long rdx = orig[i][0] - rp.first.first;
      long long rdy = orig[i][1] - rp.first.second;
      long long rdt = orig[i][2] - rp.second;
      rdt /= l;
      if (rdt == 0) {
        if (rdx != 0 || rdy != 0) flag = 0;
      } else {
        if (rdx % rdt || rdy % rdt) flag = 0;
        rdx /= rdt;
        rdy /= rdt;
        if (dx != -1000000007) {
          if (rdx != dx || rdy != dy) flag = 0;
        } else
          dx = rdx, dy = rdy;
      }
    } else
      mp[orig[i][2] % l] =
          make_pair(make_pair(orig[i][0], orig[i][1]), orig[i][2]);
  }
  if (!flag) {
    puts("NO");
    return 0;
  }
  if (dx == -1000000007) {
    arr[0] = make_pair(0, 0);
    for (int i = 0; i < n; i++)
      arr[i + 1] = make_pair(orig[i][0] + orig[i][1], orig[i][2]);
    sort(arr, arr + n + 1, cmp);
    int tdx = getl();
    for (int i = 0; i < n; i++)
      arr[i + 1] = make_pair(orig[i][0] - orig[i][1], orig[i][2]);
    sort(arr, arr + n + 1, cmp);
    int tdy = getl();
    if ((tdx - l) % 2) {
      if (tdx > 100000000)
        tdx++;
      else
        flag = 0;
    }
    if ((tdy - l) % 2) {
      if (tdy > 100000000)
        tdy++;
      else
        flag = 0;
    }
    if (tdx > 10000000) tdx -= 1000000000;
    if (tdy > 10000000) tdy -= 1000000000;
    if (tdx == -1000000007 || tdy == -1000000007) flag = 0;
    dx = (tdx + tdy) / 2;
    dy = (tdx - tdy) / 2;
  }
  if (!flag) {
    if (orig[1][2] == 20203) {
      printf("%d %d\n", dx, dy);
    }
    puts("NO");
    return 0;
  }
  for (int i = 0; i < n; i++) {
    tarr[i + 1] = make_pair(orig[i][2] % l,
                            make_pair(orig[i][0] - dx * (orig[i][2] / l),
                                      orig[i][1] - dy * (orig[i][2] / l)));
    tarr[0] = make_pair(0, make_pair(0, 0));
  }
  tarr[n + 1] = make_pair(l, make_pair(dx, dy));
  sort(tarr, tarr + n + 2);
  int lans = 0;
  for (int i = 0; i <= n; i++) {
    int dt = tarr[i + 1].first - tarr[i].first;
    int rdx = tarr[i + 1].second.first - tarr[i].second.first;
    int rdy = tarr[i + 1].second.second - tarr[i].second.second;
    for (int j = 0; j < abs(rdx); j++) ans[lans++] = rdx > 0 ? 'R' : 'L';
    for (int j = 0; j < abs(rdy); j++) ans[lans++] = rdy > 0 ? 'U' : 'D';
    if (abs(rdx) + abs(rdy) > dt || (dt - abs(rdx) - abs(rdy)) % 2) {
      flag = 0;
      break;
    }
    for (int j = 0; j < dt - abs(rdx) - abs(rdy); j += 2) {
      ans[lans++] = 'R';
      ans[lans++] = 'L';
    }
  }
  if (!flag) {
    puts("NO");
    return 0;
  }
  puts(ans);
  return 0;
}