#include <bits/stdc++.h>
using namespace std;
const long long OO = (4e18) + 9;
const int MOD = (1e9) + 7;
const int oo = 2147483647;
const double EPS = 1e-8;
const double PI = acos(-1.0);
int dx[] = {0, 1, 0, -1};
int dy[] = {1, 0, -1, 0};
int dX[] = {1, 0, -1, 0, 1, -1, 1, -1};
int dY[] = {0, 1, 0, -1, 1, 1, -1, -1};
string abc = "abcdefghijklmnopqrstuvwxyz";
string vowels = "aeiou";
int dcmp(long double d1, long double d2) {
  return fabs(d1 - d2) <= EPS ? 0 : d1 > d2 ? 1 : -1;
}
long long gcd(long long x, long long y) { return !y ? x : gcd(y, x % y); }
long long lcm(long long a, long long b) { return a * (b / gcd(a, b)); }
int ord(int r, int c, int nCol) { return (nCol * r) + c + 1; }
pair<int, int> rord(int n, int nCol) {
  int r = n % nCol, c = n / nCol;
  if (n % nCol == 0) c--, r = nCol;
  return pair<int, int>(r, c);
}
long long poww(long long num, long long p, long long md = MOD) {
  num %= md;
  long long ret = 1;
  while (p > 0) {
    if (p & 1) ret = (ret * num) % md;
    num = (num * num) % md;
    p >>= 1;
  }
  return ret;
}
long long nCr(long long n, long long r) {
  if (n < r) return 0;
  if (r == 0) return 1;
  return n * nCr(n - 1, r - 1) / r;
}
const int N = 1010;
int n, mat2[N][N], mat5[N][N], dp2[N][N], dp5[N][N];
int solve2(int x = 0, int y = 0) {
  if (x >= n || y >= n) return 1e6;
  if (x == n - 1 && y == n - 1) return mat2[x][y];
  int& ret = dp2[x][y];
  if (~ret) return ret;
  return ret =
             min(solve2(x + 1, y) + mat2[x][y], solve2(x, y + 1) + mat2[x][y]);
}
int solve5(int x = 0, int y = 0) {
  if (x >= n || y >= n) return 1e6;
  if (x == n - 1 && y == n - 1) return mat5[x][y];
  int& ret = dp5[x][y];
  if (~ret) return ret;
  return ret =
             min(solve5(x + 1, y) + mat5[x][y], solve5(x, y + 1) + mat5[x][y]);
}
string path2, path5;
void getPath2(int x = 0, int y = 0) {
  if (x >= n - 1 && y >= n - 1) return;
  int mn = solve2(x + 1, y);
  if (mn + mat2[x][y] == solve2(x, y))
    path2 += 'D', getPath2(x + 1, y);
  else
    path2 += 'R', getPath2(x, y + 1);
}
void getPath5(int x = 0, int y = 0) {
  if (x >= n - 1 && y >= n - 1) return;
  int mn = solve5(x + 1, y);
  if (mn + mat5[x][y] == solve5(x, y))
    path5 += 'D', getPath5(x + 1, y);
  else
    path5 += 'R', getPath5(x, y + 1);
}
int main() {
  memset(dp2, -1, sizeof dp2), memset(dp5, -1, sizeof dp5);
  scanf("%d", &n);
  int cnt, num, tmp, zx = -1, zy = -1;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) {
      scanf("%d", &num);
      if (!num) zx = i, zy = j;
      tmp = num, cnt = 0;
      while (num && !(num % 2)) cnt++, num /= 2;
      mat2[i][j] = cnt, cnt = 0;
      while (tmp && !(tmp % 5)) cnt++, tmp /= 5;
      mat5[i][j] = cnt, cnt = 0;
    }
  int ans2 = solve2(), ans5 = solve5();
  if (zx != -1 && min(ans2, ans5) > 0) {
    for (int i = 0; i < zx; i++) path2 += 'D';
    for (int i = 0; i < zy; i++) path2 += 'R';
    for (int i = 0; i < n - zx - 1; i++) path2 += 'D';
    for (int i = 0; i < n - zy - 1; i++) path2 += 'R';
    return cout << 1 << endl << path2 << endl, 0;
  }
  getPath2(), getPath5();
  if (ans2 < ans5)
    cout << ans2 << endl << path2 << endl;
  else
    cout << ans5 << endl << path5 << endl;
  return 0;
}

### Prompt

Your challenge is to write a Cpp solution to the following problem:

There is a square matrix n × n, consisting of non-negative integer numbers. You should find such a way on it that 

  * starts in the upper left cell of the matrix; 
  * each following cell is to the right or down from the current cell; 
  * the way ends in the bottom right cell. 



Moreover, if we multiply together all the numbers along the way, the result should be the least "round". In other words, it should end in the least possible number of zeros.

Input

The first line contains an integer number n (2 ≤ n ≤ 1000), n is the size of the matrix. Then follow n lines containing the matrix elements (non-negative integer numbers not exceeding 109).

Output

In the first line print the least number of trailing zeros. In the second line print the correspondent way itself.

Examples

Input

3
1 2 3
4 5 6
7 8 9


Output

0
DDRR

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
const long long OO = (4e18) + 9;
const int MOD = (1e9) + 7;
const int oo = 2147483647;
const double EPS = 1e-8;
const double PI = acos(-1.0);
int dx[] = {0, 1, 0, -1};
int dy[] = {1, 0, -1, 0};
int dX[] = {1, 0, -1, 0, 1, -1, 1, -1};
int dY[] = {0, 1, 0, -1, 1, 1, -1, -1};
string abc = "abcdefghijklmnopqrstuvwxyz";
string vowels = "aeiou";
int dcmp(long double d1, long double d2) {
  return fabs(d1 - d2) <= EPS ? 0 : d1 > d2 ? 1 : -1;
}
long long gcd(long long x, long long y) { return !y ? x : gcd(y, x % y); }
long long lcm(long long a, long long b) { return a * (b / gcd(a, b)); }
int ord(int r, int c, int nCol) { return (nCol * r) + c + 1; }
pair<int, int> rord(int n, int nCol) {
  int r = n % nCol, c = n / nCol;
  if (n % nCol == 0) c--, r = nCol;
  return pair<int, int>(r, c);
}
long long poww(long long num, long long p, long long md = MOD) {
  num %= md;
  long long ret = 1;
  while (p > 0) {
    if (p & 1) ret = (ret * num) % md;
    num = (num * num) % md;
    p >>= 1;
  }
  return ret;
}
long long nCr(long long n, long long r) {
  if (n < r) return 0;
  if (r == 0) return 1;
  return n * nCr(n - 1, r - 1) / r;
}
const int N = 1010;
int n, mat2[N][N], mat5[N][N], dp2[N][N], dp5[N][N];
int solve2(int x = 0, int y = 0) {
  if (x >= n || y >= n) return 1e6;
  if (x == n - 1 && y == n - 1) return mat2[x][y];
  int& ret = dp2[x][y];
  if (~ret) return ret;
  return ret =
             min(solve2(x + 1, y) + mat2[x][y], solve2(x, y + 1) + mat2[x][y]);
}
int solve5(int x = 0, int y = 0) {
  if (x >= n || y >= n) return 1e6;
  if (x == n - 1 && y == n - 1) return mat5[x][y];
  int& ret = dp5[x][y];
  if (~ret) return ret;
  return ret =
             min(solve5(x + 1, y) + mat5[x][y], solve5(x, y + 1) + mat5[x][y]);
}
string path2, path5;
void getPath2(int x = 0, int y = 0) {
  if (x >= n - 1 && y >= n - 1) return;
  int mn = solve2(x + 1, y);
  if (mn + mat2[x][y] == solve2(x, y))
    path2 += 'D', getPath2(x + 1, y);
  else
    path2 += 'R', getPath2(x, y + 1);
}
void getPath5(int x = 0, int y = 0) {
  if (x >= n - 1 && y >= n - 1) return;
  int mn = solve5(x + 1, y);
  if (mn + mat5[x][y] == solve5(x, y))
    path5 += 'D', getPath5(x + 1, y);
  else
    path5 += 'R', getPath5(x, y + 1);
}
int main() {
  memset(dp2, -1, sizeof dp2), memset(dp5, -1, sizeof dp5);
  scanf("%d", &n);
  int cnt, num, tmp, zx = -1, zy = -1;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) {
      scanf("%d", &num);
      if (!num) zx = i, zy = j;
      tmp = num, cnt = 0;
      while (num && !(num % 2)) cnt++, num /= 2;
      mat2[i][j] = cnt, cnt = 0;
      while (tmp && !(tmp % 5)) cnt++, tmp /= 5;
      mat5[i][j] = cnt, cnt = 0;
    }
  int ans2 = solve2(), ans5 = solve5();
  if (zx != -1 && min(ans2, ans5) > 0) {
    for (int i = 0; i < zx; i++) path2 += 'D';
    for (int i = 0; i < zy; i++) path2 += 'R';
    for (int i = 0; i < n - zx - 1; i++) path2 += 'D';
    for (int i = 0; i < n - zy - 1; i++) path2 += 'R';
    return cout << 1 << endl << path2 << endl, 0;
  }
  getPath2(), getPath5();
  if (ans2 < ans5)
    cout << ans2 << endl << path2 << endl;
  else
    cout << ans5 << endl << path5 << endl;
  return 0;
}

```