#include <bits/stdc++.h>
int p2[1002][1002], p5[1002][1002];
char s2[1002][1002], s5[1002][1002], route[1002 << 1];
int n, ans, k, cnt, x, flx, fly;
bool flag, kkk;
inline void read(int &x) {
  x = 0;
  int f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while ('0' <= ch && ch <= '9') {
    x = (x << 3) + (x << 1) + (ch ^ 48);
    ch = getchar();
  }
  x *= f;
}
int main() {
  read(n);
  for (register int i = 0; i <= n; ++i)
    p2[0][i] = p2[i][0] = p5[0][i] = p5[i][0] = 0x3f3f3f3f;
  p2[0][1] = p5[0][1] = 0;
  for (register int i = 1; i <= n; ++i)
    for (register int j = 1; j <= n; ++j) {
      cnt = 0;
      read(x);
      if (x == 0) {
        kkk = 1, flx = i, fly = j;
        p2[i][j] = 1, s2[i][j] = 'D';
        p5[i][j] = 1, s5[i][j] = 'D';
        continue;
      }
      k = x;
      while (x % 2 == 0) ++cnt, x /= 2;
      if (p2[i - 1][j] >= p2[i][j - 1])
        p2[i][j] = p2[i][j - 1] + cnt, s2[i][j] = 'R';
      else
        p2[i][j] = p2[i - 1][j] + cnt, s2[i][j] = 'D';
      cnt = 0;
      while (k % 5 == 0) ++cnt, k /= 5;
      if (p5[i - 1][j] >= p5[i][j - 1])
        p5[i][j] = p5[i][j - 1] + cnt, s5[i][j] = 'R';
      else
        p5[i][j] = p5[i - 1][j] + cnt, s5[i][j] = 'D';
    }
  if (p2[n][n] > p5[n][n])
    ans = p5[n][n], flag = true;
  else
    ans = p2[n][n];
  cnt = 0;
  if (kkk && ans) {
    int i = flx, j = fly;
    puts("1");
    while (!(i == 1 && j == 1)) {
      if (s2[i][j] == 'R')
        route[++cnt] = 'R', --j;
      else if (s2[i][j] == 'D')
        route[++cnt] = 'D', --i;
      else
        break;
    }
    for (register int i = cnt; i >= 1; --i) printf("%c", route[i]);
    while (flx != n) ++flx, printf("D");
    while (fly != n) ++fly, printf("R");
    return 0;
  }
  printf("%d\n", ans);
  int i = n, j = n;
  if (flag)
    while (!(i == 1 && j == 1)) {
      if (s5[i][j] == 'R')
        route[++cnt] = 'R', --j;
      else if (s5[i][j] == 'D')
        route[++cnt] = 'D', --i;
      else
        break;
    }
  else
    while (!(i == 1 && j == 1)) {
      if (s2[i][j] == 'R')
        route[++cnt] = 'R', --j;
      else if (s2[i][j] == 'D')
        route[++cnt] = 'D', --i;
      else
        break;
    }
  for (register int i = cnt; i >= 1; --i) printf("%c", route[i]);
  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>
int p2[1002][1002], p5[1002][1002];
char s2[1002][1002], s5[1002][1002], route[1002 << 1];
int n, ans, k, cnt, x, flx, fly;
bool flag, kkk;
inline void read(int &x) {
  x = 0;
  int f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while ('0' <= ch && ch <= '9') {
    x = (x << 3) + (x << 1) + (ch ^ 48);
    ch = getchar();
  }
  x *= f;
}
int main() {
  read(n);
  for (register int i = 0; i <= n; ++i)
    p2[0][i] = p2[i][0] = p5[0][i] = p5[i][0] = 0x3f3f3f3f;
  p2[0][1] = p5[0][1] = 0;
  for (register int i = 1; i <= n; ++i)
    for (register int j = 1; j <= n; ++j) {
      cnt = 0;
      read(x);
      if (x == 0) {
        kkk = 1, flx = i, fly = j;
        p2[i][j] = 1, s2[i][j] = 'D';
        p5[i][j] = 1, s5[i][j] = 'D';
        continue;
      }
      k = x;
      while (x % 2 == 0) ++cnt, x /= 2;
      if (p2[i - 1][j] >= p2[i][j - 1])
        p2[i][j] = p2[i][j - 1] + cnt, s2[i][j] = 'R';
      else
        p2[i][j] = p2[i - 1][j] + cnt, s2[i][j] = 'D';
      cnt = 0;
      while (k % 5 == 0) ++cnt, k /= 5;
      if (p5[i - 1][j] >= p5[i][j - 1])
        p5[i][j] = p5[i][j - 1] + cnt, s5[i][j] = 'R';
      else
        p5[i][j] = p5[i - 1][j] + cnt, s5[i][j] = 'D';
    }
  if (p2[n][n] > p5[n][n])
    ans = p5[n][n], flag = true;
  else
    ans = p2[n][n];
  cnt = 0;
  if (kkk && ans) {
    int i = flx, j = fly;
    puts("1");
    while (!(i == 1 && j == 1)) {
      if (s2[i][j] == 'R')
        route[++cnt] = 'R', --j;
      else if (s2[i][j] == 'D')
        route[++cnt] = 'D', --i;
      else
        break;
    }
    for (register int i = cnt; i >= 1; --i) printf("%c", route[i]);
    while (flx != n) ++flx, printf("D");
    while (fly != n) ++fly, printf("R");
    return 0;
  }
  printf("%d\n", ans);
  int i = n, j = n;
  if (flag)
    while (!(i == 1 && j == 1)) {
      if (s5[i][j] == 'R')
        route[++cnt] = 'R', --j;
      else if (s5[i][j] == 'D')
        route[++cnt] = 'D', --i;
      else
        break;
    }
  else
    while (!(i == 1 && j == 1)) {
      if (s2[i][j] == 'R')
        route[++cnt] = 'R', --j;
      else if (s2[i][j] == 'D')
        route[++cnt] = 'D', --i;
      else
        break;
    }
  for (register int i = cnt; i >= 1; --i) printf("%c", route[i]);
  return 0;
}

```