#include <bits/stdc++.h>
using namespace std;
const int N = 110;
int n, m, k, a[N][N];
int f[N][N][15];
char s[N][N], res[N];
int pre[N][N][15];
int main() {
  cin >> n >> m >> k;
  for (int i = 1; i <= n; i++) cin >> s[i] + 1;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) a[i][j] = s[i][j] - '0';
  memset(f, -1, sizeof f);
  k++;
  for (int i = 1; i <= m; i++) f[n][i][a[n][i] % k] = a[n][i] / k;
  for (int i = n; i > 1; i--) {
    for (int j = 1; j <= m; j++)
      for (int s = 0; s < k; s++)
        if (f[i][j][s] > -1) {
          int num, mo;
          if (j > 1) {
            mo = (a[i - 1][j - 1] + s) % k;
            num = (a[i - 1][j - 1] + s) / k;
            if (f[i - 1][j - 1][mo] < f[i][j][s] + num) {
              f[i - 1][j - 1][mo] = f[i][j][s] + num;
              pre[i - 1][j - 1][mo] = 1;
            }
          }
          if (j < m) {
            mo = (a[i - 1][j + 1] + s) % k;
            num = (a[i - 1][j + 1] + s) / k;
            if (f[i - 1][j + 1][mo] < f[i][j][s] + num) {
              f[i - 1][j + 1][mo] = f[i][j][s] + num;
              pre[i - 1][j + 1][mo] = 2;
            }
          }
        }
  }
  int ans = -1, pos, mod = 0;
  for (int i = 1; i <= m; i++) {
    if (ans < f[1][i][0] * k) {
      ans = (f[1][i][0] * k);
      pos = i;
    }
  }
  cout << (ans) << endl;
  if (ans > -1) {
    for (int i = 1; i < n; i++) {
      if (pre[i][pos][mod] == 1) {
        mod = ((mod - a[i][pos]) % k + k) % k;
        res[i] = 'L';
        pos++;
      } else {
        mod = ((mod - a[i][pos]) % k + k) % k;
        res[i] = 'R';
        pos--;
      }
    }
    cout << pos << endl;
    for (int i = n - 1; i > 0; i--) cout << res[i];
  }
  return 0;
}
