#include <bits/stdc++.h>
using namespace std;
struct dot {
  int v;
  char d[11];
  int g[11];
};
int INF = -9999;
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  dot** A = new dot*[n + 2];
  for (int i = 1; i <= n; i++) {
    string s;
    cin >> s;
    A[i] = new dot[m + 2];
    A[i][0].v = INF;
    A[i][m + 1].v = INF;
    for (int l = 0; l < 11; l++) {
      A[i][0].g[l] = INF;
      A[i][m + 1].g[l] = INF;
    }
    for (int j = 1; j <= m; j++) {
      A[i][j].v = s[j - 1] - '0';
      for (int l = 0; l < 11; l++) {
        A[i][j].g[l] = INF;
      }
    }
  }
  for (int j = 1; j <= m; j++) {
    A[1][j].g[A[1][j].v % (k + 1)] = A[1][j].v;
  }
  for (int i = 2; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      for (int l = 0; l <= k; l++) {
        if (A[i][j].g[(A[i - 1][j - 1].g[l] + A[i][j].v - (k + 1) * INF) %
                      (k + 1)] < A[i - 1][j - 1].g[l] + A[i][j].v) {
          A[i][j]
              .g[(A[i - 1][j - 1].g[l] + A[i][j].v - (k + 1) * INF) % (k + 1)] =
              A[i - 1][j - 1].g[l] + A[i][j].v;
          A[i][j]
              .d[(A[i - 1][j - 1].g[l] + A[i][j].v - (k + 1) * INF) % (k + 1)] =
              'L';
        }
        if (A[i][j].g[(A[i - 1][j + 1].g[l] + A[i][j].v - (k + 1) * INF) %
                      (k + 1)] < A[i - 1][j + 1].g[l] + A[i][j].v) {
          A[i][j]
              .g[(A[i - 1][j + 1].g[l] + A[i][j].v - (k + 1) * INF) % (k + 1)] =
              A[i - 1][j + 1].g[l] + A[i][j].v;
          A[i][j]
              .d[(A[i - 1][j + 1].g[l] + A[i][j].v - (k + 1) * INF) % (k + 1)] =
              'R';
        }
      }
    }
  }
  int ma = 0;
  for (int j = 1; j <= m; j++) {
    if (A[n][j].g[0] > A[n][ma].g[0]) ma = j;
  }
  if (A[n][ma].g[0] < 0) {
    cout << "-1";
    return 0;
  }
  cout << A[n][ma].g[0] << "\n" << ma << "\n";
  int q = n;
  int w = ma;
  int v = A[n][ma].g[0];
  while (q > 1) {
    if (A[q][w].d[v % (k + 1)] == 'R') {
      v -= A[q][w].v;
      cout << 'R';
      q--;
      w++;
    } else {
      v -= A[q][w].v;
      cout << 'L';
      q--;
      w--;
    }
  }
  return 0;
}
