#include <bits/stdc++.h>
using namespace std;
const int oo = 1 << 29;
int R, C, k;
char g[128][128];
int dp[128][128][11];
bool vis[128][128][11];
int calc(int r, int c, int m) {
  if (r < 0 || c < 0 || c == C) return -oo * (m || c < 0 || c == C);
  if (!vis[r][c][m]) {
    vis[r][c][m] = true;
    dp[r][c][m] =
        int(g[r][c] - '0') + max(calc(r - 1, c - 1, (m + g[r][c] - '0') % k),
                                 calc(r - 1, c + 1, (m + g[r][c] - '0') % k));
  }
  return dp[r][c][m];
}
void print(int r, int c, int m) {
  if (r == 0) return;
  if (dp[r][c][m] ==
      int(g[r][c] - '0') + calc(r - 1, c - 1, (m + g[r][c] - '0') % k)) {
    printf("L");
    print(r - 1, c - 1, (m + g[r][c] - '0') % k);
  } else {
    printf("R");
    print(r - 1, c + 1, (m + g[r][c] - '0') % k);
  }
}
int main() {
  scanf("%d%d%d", &R, &C, &k);
  for (int i = 0; i < R; ++i) scanf("%s", g[i]);
  ++k;
  int r = -1, idx;
  for (int i = 0; i < C; ++i)
    if (r < calc(R - 1, i, 0)) {
      r = calc(R - 1, i, 0);
      idx = i;
    }
  if (r < 0)
    puts("-1");
  else {
    printf("%d\n%d\n", r, idx + 1);
    print(R - 1, idx, 0);
  }
  return 0;
}
