#include <bits/stdc++.h>
int max(int a, int b) { return a > b ? a : b; }
int main() {
  static char cc[100][100 + 1], ans[100];
  static int dp[100][100][11];
  int n, m, k, i, i_, j, j_, r, r_, c, s, x;
  scanf("%d%d%d", &n, &m, &k), k++;
  for (i = n - 1; i >= 0; i--) {
    scanf("%s", cc[i]);
    for (j = 0; j < m; j++) cc[i][j] -= '0';
  }
  for (i = 0; i < n; i++)
    for (j = 0; j < m; j++)
      for (r = 0; r < k; r++) dp[i][j][r] = -1;
  for (j = 0; j < m; j++) {
    c = cc[0][j];
    dp[0][j][c % k] = c;
  }
  for (i = 0; i < n - 1; i++)
    for (j = 0; j < m; j++)
      for (r = 0; r < k; r++) {
        x = dp[i][j][r];
        if (x >= 0) {
          if (j > 0) {
            c = cc[i + 1][j - 1];
            s = (r + c) % k;
            dp[i + 1][j - 1][s] = max(dp[i + 1][j - 1][s], x + c);
          }
          if (j + 1 < m) {
            c = cc[i + 1][j + 1];
            s = (r + c) % k;
            dp[i + 1][j + 1][s] = max(dp[i + 1][j + 1][s], x + c);
          }
        }
      }
  i_ = n - 1, j_ = 0;
  for (j = 1; j < m; j++)
    if (dp[i_][j_][0] < dp[i_][j][0]) j_ = j;
  if (dp[i_][j_][0] < 0) {
    printf("-1\n");
    return 0;
  }
  printf("%d\n", dp[i_][j_][0]);
  r_ = 0;
  while (i_ > 0) {
    x = dp[i_][j_][r_] - cc[i_][j_];
    r = x % k;
    if (j_ > 0 && dp[i_ - 1][j_ - 1][r] == x) {
      ans[i_ - 1] = 'R';
      j_--;
    } else {
      ans[i_ - 1] = 'L';
      j_++;
    }
    i_--;
    r_ = r;
  }
  printf("%d\n", j_ + 1);
  printf("%s\n", ans);
  return 0;
}
