#include <bits/stdc++.h>
using namespace std;
int ar[105][105];
int f[105][105][20], k, tracej, tracei, n, m, tracek = 0;
string tracevoid;
int dongdu(int x) { return (x % k + k) % k; }
void trace() {
  int i;
  tracei = 1;
  tracek = 0;
  while (tracei < n) {
    if (max(f[tracei + 1][tracej + 1][dongdu(tracek - ar[tracei][tracej])],
            f[tracei + 1][tracej - 1][dongdu(tracek - ar[tracei][tracej])]) ==
            f[tracei + 1][tracej - 1][dongdu(tracek - ar[tracei][tracej])] &&
        tracej > 1) {
      tracevoid += 'R';
      tracek = dongdu(tracek - ar[tracei][tracej]);
      tracei++;
      tracej--;
    } else {
      tracevoid += 'L';
      tracek = dongdu(tracek - ar[tracei][tracej]);
      tracei++;
      tracej++;
    }
  }
  cout << tracej << endl;
  for (i = tracevoid.length() - 1; i >= 0; i--) {
    cout << tracevoid[i];
  }
}
int main() {
  int i, j, l, max1 = -1;
  string s;
  cin >> n >> m >> k;
  k += 1;
  for (i = 0; i <= n + 1; i++) {
    for (j = 0; j <= m + 1; j++) {
      for (l = 0; l < k; l++) {
        f[i][j][l] = -1;
      }
    }
  }
  for (i = 1; i <= n + 1; i++) {
    for (j = 1; j <= m + 1; j++) {
      for (l = 0; l < k; l++) {
        f[i][j][l] = -69696;
      }
    }
  }
  for (i = 1; i <= n; i++) {
    cin >> s;
    for (j = 0; j < m; j++) {
      ar[i][j + 1] = s[j] - '0';
      if (i == n) {
        f[i][j + 1][dongdu(ar[i][j + 1])] = ar[i][j + 1];
      }
    }
  }
  for (i = n - 1; i >= 1; i--) {
    for (j = 1; j <= m; j++) {
      for (l = 0; l < k; l++) {
        if (max(f[i + 1][j + 1][dongdu(l - ar[i][j])],
                f[i + 1][j - 1][dongdu(l - ar[i][j])]) != -1) {
          f[i][j][l] = max(f[i + 1][j + 1][dongdu(l - ar[i][j])],
                           f[i + 1][j - 1][dongdu(l - ar[i][j])]) +
                       ar[i][j];
        }
      }
    }
  }
  for (j = 1; j <= m; j++) {
    if (f[1][j][0] > max1) {
      max1 = f[1][j][0];
      tracej = j;
    }
  }
  if (max1 == -1) {
    cout << -1;
    return 0;
  }
  cout << max1 << endl;
  trace();
}
