#include <bits/stdc++.h>
using namespace std;
int n, m, k;
int f[101][101][12];
int p[101][101][12];
string a[102];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m >> k;
  k++;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  memset(f, -1, sizeof(f));
  for (int i = 0; i < m; i++) {
    f[0][i][a[0][i] % k] = a[0][i] - '0';
  }
  for (int i = 0; i + 1 < n; i++) {
    for (int j = 0; j < m; j++) {
      for (int r = 0; r < k; r++) {
        if (f[i][j][r] < 0) continue;
        if (j + 1 < m) {
          int c = f[i][j][r] + a[i + 1][j + 1] - '0';
          if (f[i + 1][j + 1][c % k] < c) {
            f[i + 1][j + 1][c % k] = c;
            p[i + 1][j + 1][c % k] = 1;
          }
        }
        if (j - 1 >= 0) {
          int c = f[i][j][r] + a[i + 1][j - 1] - '0';
          if (f[i + 1][j - 1][c % k] < c) {
            f[i + 1][j - 1][c % k] = c;
            p[i + 1][j - 1][c % k] = 0;
          }
        }
      }
    }
  }
  int res = -1, mj = -1;
  for (int j = 0; j < m; j++) {
    if (f[n - 1][j][0] > res) {
      res = f[n - 1][j][0];
      mj = j;
    }
  }
  if (res == -1) {
    cout << res;
    return 0;
  }
  cout << res << endl << mj + 1 << endl;
  for (int i = n - 1, j = mj, r = 0; i; i--) {
    if (p[i][j][r]) {
      r = (r - (a[i][j] - '0') % k + k) % k;
      cout << "L";
      j--;
    } else {
      r = (r - (a[i][j] - '0') % k + k) % k;
      cout << "R";
      j++;
    }
  }
  return 0;
}
