#include <bits/stdc++.h>
using namespace std;
const long long N = 1005;
long long n, ct0 = 0, sti, stj;
long long a[N][N], cache2[N][N], cache5[N][N];
long long ct2(long long k) {
  long long cur = 0;
  while (k % 2 == 0) {
    cur++;
    k /= 2;
  }
  return cur;
}
long long ct5(long long k) {
  long long cur = 0;
  while (k % 5 == 0) {
    cur++;
    k /= 5;
  }
  return cur;
}
long long dp2(long long i, long long j) {
  if (i == n + 1 || j == n + 1) return 1e9;
  if (i == n && j == n) return ct2(a[i][j]);
  long long &ans = cache2[i][j];
  if (ans != -1) return ans;
  ans = ct2(a[i][j]) + min(dp2(i + 1, j), dp2(i, j + 1));
  return ans;
}
long long dp5(long long i, long long j) {
  if (i == n + 1 || j == n + 1) return 1e9;
  if (i == n && j == n) return ct5(a[i][j]);
  long long &ans = cache5[i][j];
  if (ans != -1) return ans;
  ans = ct5(a[i][j]) + min(dp5(i + 1, j), dp5(i, j + 1));
  return ans;
}
void path2(long long i, long long j) {
  if (i == n && j == n) return;
  long long ans = dp2(i, j);
  if (ans == ct2(a[i][j]) + dp2(i + 1, j)) {
    cout << "D";
    return path2(i + 1, j);
  } else {
    cout << "R";
    return path2(i, j + 1);
  }
}
void path5(long long i, long long j) {
  if (i == n && j == n) return;
  long long ans = dp5(i, j);
  if (ans == ct5(a[i][j]) + dp5(i + 1, j)) {
    cout << "D";
    return path5(i + 1, j);
  } else {
    cout << "R";
    return path5(i, j + 1);
  }
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  memset(cache2, -1, sizeof(cache2));
  memset(cache5, -1, sizeof(cache5));
  cin >> n;
  for (long long i = 1; i <= n; i++) {
    for (long long j = 1; j <= n; j++) {
      cin >> a[i][j];
      if (!a[i][j]) {
        sti = i, stj = j;
        ct0++;
        a[i][j] = 10;
      }
    }
  }
  long long ans = min(dp2(1, 1), dp5(1, 1));
  if (ans > 1 && ct0 > 0) {
    cout << "1"
         << "\n";
    for (long long i = 2; i <= sti; i++) cout << "D";
    for (long long j = 2; j <= stj; j++) cout << "R";
    for (long long i = sti + 1; i <= n; i++) cout << "D";
    for (long long j = stj + 1; j <= n; j++) cout << "R";
  } else {
    cout << ans << "\n";
    if (ans == dp2(1, 1))
      path2(1, 1);
    else
      path5(1, 1);
  }
}

### Prompt

Your task is to create 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 N = 1005;
long long n, ct0 = 0, sti, stj;
long long a[N][N], cache2[N][N], cache5[N][N];
long long ct2(long long k) {
  long long cur = 0;
  while (k % 2 == 0) {
    cur++;
    k /= 2;
  }
  return cur;
}
long long ct5(long long k) {
  long long cur = 0;
  while (k % 5 == 0) {
    cur++;
    k /= 5;
  }
  return cur;
}
long long dp2(long long i, long long j) {
  if (i == n + 1 || j == n + 1) return 1e9;
  if (i == n && j == n) return ct2(a[i][j]);
  long long &ans = cache2[i][j];
  if (ans != -1) return ans;
  ans = ct2(a[i][j]) + min(dp2(i + 1, j), dp2(i, j + 1));
  return ans;
}
long long dp5(long long i, long long j) {
  if (i == n + 1 || j == n + 1) return 1e9;
  if (i == n && j == n) return ct5(a[i][j]);
  long long &ans = cache5[i][j];
  if (ans != -1) return ans;
  ans = ct5(a[i][j]) + min(dp5(i + 1, j), dp5(i, j + 1));
  return ans;
}
void path2(long long i, long long j) {
  if (i == n && j == n) return;
  long long ans = dp2(i, j);
  if (ans == ct2(a[i][j]) + dp2(i + 1, j)) {
    cout << "D";
    return path2(i + 1, j);
  } else {
    cout << "R";
    return path2(i, j + 1);
  }
}
void path5(long long i, long long j) {
  if (i == n && j == n) return;
  long long ans = dp5(i, j);
  if (ans == ct5(a[i][j]) + dp5(i + 1, j)) {
    cout << "D";
    return path5(i + 1, j);
  } else {
    cout << "R";
    return path5(i, j + 1);
  }
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  memset(cache2, -1, sizeof(cache2));
  memset(cache5, -1, sizeof(cache5));
  cin >> n;
  for (long long i = 1; i <= n; i++) {
    for (long long j = 1; j <= n; j++) {
      cin >> a[i][j];
      if (!a[i][j]) {
        sti = i, stj = j;
        ct0++;
        a[i][j] = 10;
      }
    }
  }
  long long ans = min(dp2(1, 1), dp5(1, 1));
  if (ans > 1 && ct0 > 0) {
    cout << "1"
         << "\n";
    for (long long i = 2; i <= sti; i++) cout << "D";
    for (long long j = 2; j <= stj; j++) cout << "R";
    for (long long i = sti + 1; i <= n; i++) cout << "D";
    for (long long j = stj + 1; j <= n; j++) cout << "R";
  } else {
    cout << ans << "\n";
    if (ans == dp2(1, 1))
      path2(1, 1);
    else
      path5(1, 1);
  }
}

```