#include <bits/stdc++.h>
using namespace std;
const long double EPS = 1e-9;
const long double PI = 3.1415926535897932384626433832795;
const int INF = 1000 * 1000 * 1000;
const int NMAX = 1000 * 1000;
long i, j, k, l, n, m, x, y, ans;
long a[200][200];
pair<int, int> g[200][200][20];
long d[200][200][20];
int main() {
  freopen("out.deb", "w", stderr);
  scanf("%d %d %d\n", &n, &m, &k);
  k++;
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= m; j++) {
      char t;
      scanf("%c", &t);
      a[i][j] = (t - '0');
    }
    if (i != n) scanf("\n");
  }
  memset(d, -1, sizeof(d));
  for (i = 1; i <= m; i++) d[n][i][a[n][i] % k] = a[n][i];
  for (i = n; i >= 1; i--) {
    for (j = 1; j <= m; j++) {
      for (l = 0; l <= k; l++) {
        if (d[i][j][l] == -1) continue;
        if (j >= 2) {
          if (d[i - 1][j - 1][(l + (a[i - 1][j - 1])) % k] <
              d[i][j][l] + a[i - 1][j - 1]) {
            d[i - 1][j - 1][(l + (a[i - 1][j - 1])) % k] =
                d[i][j][l] + a[i - 1][j - 1];
            g[i - 1][j - 1][(l + (a[i - 1][j - 1])) % k] = make_pair(j, l);
          }
        }
        if (j <= m) {
          if (d[i - 1][j + 1][(l + (a[i - 1][j + 1])) % k] <
              d[i][j][l] + a[i - 1][j + 1]) {
            d[i - 1][j + 1][(l + (a[i - 1][j + 1])) % k] =
                d[i][j][l] + a[i - 1][j + 1];
            g[i - 1][j + 1][(l + (a[i - 1][j + 1])) % k] = make_pair(j, l);
          }
        }
      }
    }
  }
  ans = -1;
  for (i = 1; i <= m; i++) {
    if (ans < d[1][i][0]) {
      l = i;
      ans = d[1][i][0];
    }
  }
  if (ans == -1) {
    printf("-1");
    return 0;
  }
  i = 1;
  j = l;
  l = 0;
  string s;
  while (i < n) {
    if (j > g[i][j][l].first)
      s = 'R' + s;
    else
      s = 'L' + s;
    int nl = l;
    l = g[i][j][l].second;
    j = g[i][j][nl].first;
    i++;
  }
  printf("%d\n%d\n", ans, j);
  cout << s;
  return 0;
}
