#include <bits/stdc++.h>
using namespace std;
const int maxn = 1005;
int n;
int mp[maxn][maxn];
int pre[2][maxn][maxn], dp[2][maxn][maxn];
int path[2][maxn][maxn];
void make(int x, int y) {
  int num = mp[x][y];
  while (num % 2 == 0) {
    pre[0][x][y]++;
    num /= 2;
  }
  while (num % 5 == 0) {
    pre[1][x][y]++;
    num /= 5;
  }
}
void print(int type, int x, int y) {
  if (path[type][x][y] != -1) {
    if (path[type][x][y] == 1) {
      print(type, x - 1, y);
      printf("D");
    } else if (path[type][x][y] == 2) {
      print(type, x, y - 1);
      printf("R");
    }
  }
}
void pri(int mid, int x, int y) {
  if (x == 1 && y == 1) return;
  if (path[mid][x][y] == 2) {
    pri(mid, x, y - 1);
    putchar('R');
  } else {
    pri(mid, x - 1, y);
    putchar('D');
  }
}
int main() {
  int x1, y1;
  int flg = 0;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++) {
      scanf("%d", &mp[i][j]);
      if (mp[i][j] == 0) {
        mp[i][j] = 10;
        flg = 1;
        x1 = i;
        y1 = j;
      }
      make(i, j);
    }
  dp[0][1][1] = pre[0][1][1];
  dp[1][1][1] = pre[1][1][1];
  for (int i = 2; i <= n; i++) {
    for (int id = 0; id < 2; id++) {
      dp[id][i][1] = dp[id][i - 1][1] + pre[id][i][1];
      path[id][i][1] = 1;
      dp[id][1][i] = dp[id][1][i - 1] + pre[id][1][i];
      path[id][1][i] = 2;
    }
  }
  for (int i = 2; i <= n; i++) {
    for (int j = 2; j <= n; j++) {
      for (int id = 0; id < 2; id++) {
        if (dp[id][i - 1][j] < dp[id][i][j - 1]) {
          dp[id][i][j] = dp[id][i - 1][j] + pre[id][i][j];
          path[id][i][j] = 1;
        } else {
          dp[id][i][j] = dp[id][i][j - 1] + pre[id][i][j];
          path[id][i][j] = 2;
        }
      }
    }
  }
  int res = min(dp[1][n][n], dp[0][n][n]);
  int type = (res == dp[1][n][n]);
  if (res > 1 && flg) {
    cout << 1 << endl;
    for (int i = 1; i < x1; i++) printf("D");
    for (int j = 1; j < y1; j++) printf("R");
    for (int i = x1 + 1; i <= n; i++) printf("D");
    for (int i = y1 + 1; i <= n; i++) printf("R");
    return 0;
  }
  cout << res << endl;
  pri(type, n, n);
  cout << endl;
}

### Prompt

Please create a solution in cpp 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 int maxn = 1005;
int n;
int mp[maxn][maxn];
int pre[2][maxn][maxn], dp[2][maxn][maxn];
int path[2][maxn][maxn];
void make(int x, int y) {
  int num = mp[x][y];
  while (num % 2 == 0) {
    pre[0][x][y]++;
    num /= 2;
  }
  while (num % 5 == 0) {
    pre[1][x][y]++;
    num /= 5;
  }
}
void print(int type, int x, int y) {
  if (path[type][x][y] != -1) {
    if (path[type][x][y] == 1) {
      print(type, x - 1, y);
      printf("D");
    } else if (path[type][x][y] == 2) {
      print(type, x, y - 1);
      printf("R");
    }
  }
}
void pri(int mid, int x, int y) {
  if (x == 1 && y == 1) return;
  if (path[mid][x][y] == 2) {
    pri(mid, x, y - 1);
    putchar('R');
  } else {
    pri(mid, x - 1, y);
    putchar('D');
  }
}
int main() {
  int x1, y1;
  int flg = 0;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++) {
      scanf("%d", &mp[i][j]);
      if (mp[i][j] == 0) {
        mp[i][j] = 10;
        flg = 1;
        x1 = i;
        y1 = j;
      }
      make(i, j);
    }
  dp[0][1][1] = pre[0][1][1];
  dp[1][1][1] = pre[1][1][1];
  for (int i = 2; i <= n; i++) {
    for (int id = 0; id < 2; id++) {
      dp[id][i][1] = dp[id][i - 1][1] + pre[id][i][1];
      path[id][i][1] = 1;
      dp[id][1][i] = dp[id][1][i - 1] + pre[id][1][i];
      path[id][1][i] = 2;
    }
  }
  for (int i = 2; i <= n; i++) {
    for (int j = 2; j <= n; j++) {
      for (int id = 0; id < 2; id++) {
        if (dp[id][i - 1][j] < dp[id][i][j - 1]) {
          dp[id][i][j] = dp[id][i - 1][j] + pre[id][i][j];
          path[id][i][j] = 1;
        } else {
          dp[id][i][j] = dp[id][i][j - 1] + pre[id][i][j];
          path[id][i][j] = 2;
        }
      }
    }
  }
  int res = min(dp[1][n][n], dp[0][n][n]);
  int type = (res == dp[1][n][n]);
  if (res > 1 && flg) {
    cout << 1 << endl;
    for (int i = 1; i < x1; i++) printf("D");
    for (int j = 1; j < y1; j++) printf("R");
    for (int i = x1 + 1; i <= n; i++) printf("D");
    for (int i = y1 + 1; i <= n; i++) printf("R");
    return 0;
  }
  cout << res << endl;
  pri(type, n, n);
  cout << endl;
}

```