func_code_string: #include <bits/stdc++.h>   #pragma warning(disable : 4996)   using namespace std;   int n, l;   long long a[300000][3];   long long b[300000][3];   long long t[300000][2];   vector<int> c[3000000];   vector<pair<long long, long long> > g;   long long p[3000000];   long long dab[3000000][2];   void sayno() {     printf( NO );     exit(0);   }   void calc() {     int i, j, k;     long long d = -1;     for (i = 0; i < l; i++) {       if (c[i].size() >= 2) {         d = (t[c[i][1]][1] - t[c[i][0]][1]) /             ((t[c[i][1]][0] - t[c[i][0]][0]) / l);         break;       }     }     if (d == -1) {       int past = 0;       g.clear();       for (i = 1; i <= l; i++) {         if (!c[i % l].size()) continue;         int x = c[past][0], y = c[i % l][0];         if (t[x][0] < t[y][0]) {           long long u = (t[y][0] - t[x][0]) / l;           long long v = t[y][1] - t[x][1];           long long w = (t[y][0] - t[x][0]) % l;           if (u != 0)             g.push_back(pair<long long, long long>((v - w + u - 1) / u, v / u));         } else {           long long u = (t[x][0] - t[y][0]) / l + 1;           long long v = t[x][1] - t[y][1];           long long w = t[y][0] + u * l - t[x][0];           if (u != 0)             g.push_back(pair<long long, long long>((v + u - 1) / u, (v + w) / u));         }         past = i;       }       sort(g.begin(), g.end());       for (auto e : g) {         if (e.second < g.back().first) sayno();       }       d = g.back().first;     }     memset(p, -1, sizeof(p));     for (i = 0; i < n; i++) {       long long u = t[i][1] - d * (t[i][0] / l);       long long v = t[i][0] % l;       if (p[v] == -1)         p[v] = u;       else if (p[v] != u)         sayno();     }     p[l] = d;     int past = 0;     for (i = 1; i <= l; i++) {       if (p[i] == -1) continue;       if (p[i] - p[past] < 0 || p[i] - p[past] > i - past) sayno();       for (j = 0; j < p[i] - p[past]; j++) {         dab[past + j][1] = 1;       }       for (j = p[i] - p[past]; j < i - past; j++) {         dab[past + j][1] = -1;       }       past = i;     }   }   int main() {     int i, j, k;     cin >> n >> l;     for (i = 0; i <= n; i++) {       if (i != 0) scanf( %I64d%I64d%I64d , &a[i][0], &a[i][1], &a[i][2]);       b[i][0] = a[i][0], b[i][1] = a[i][1] + a[i][2], b[i][2] = a[i][1] - a[i][2];       if ((b[i][1] + b[i][0]) % 2 == 1 || (b[i][2] + b[i][0]) % 2 == 1) sayno();       b[i][1] = (b[i][1] + b[i][0]) / 2, b[i][2] = (b[i][2] + b[i][0]) / 2;       c[b[i][0] % l].push_back(i);     }     n++;     for (i = 0; i < n; i++) t[i][0] = b[i][0], t[i][1] = b[i][1];     calc();     for (i = 0; i < l; i++) dab[i][0] = dab[i][1];     for (i = 0; i < n; i++) t[i][0] = b[i][0], t[i][1] = b[i][2];     calc();     for (i = 0; i < l; i++) {       if (dab[i][0] == -1 & dab[i][1] == -1)         printf( L );       else if (dab[i][0] == 1 && dab[i][1] == 1)         printf( R );       else if (dab[i][0] == -1 && dab[i][1] == 1)         printf( D );       else         printf( U );     }     return 0;   }   