#include <bits/stdc++.h>
using namespace std;
int N, M, K, R;
char arr[102][102];
int best[102][102][1002];
int solve(int r, int c, int p) {
  if (r < 0) {
    if (p % K == 0) return p;
    return -1 << 30;
  }
  if (best[r][c][p] != -1) return best[r][c][p];
  int ret = -1 << 30;
  if (c - 1 >= 0) ret = max(ret, solve(r - 1, c - 1, p + (arr[r][c] - '0')));
  if (c + 1 < M) ret = max(ret, solve(r - 1, c + 1, p + (arr[r][c] - '0')));
  return best[r][c][p] = ret;
}
void solve2(int r, int c, int p) {
  if (r == 0) {
    printf("\n");
    return;
  }
  int ret = -1 << 30;
  if (c - 1 >= 0 && best[r - 1][c - 1][p + (arr[r][c] - '0')] == R)
    printf("L"), solve2(r - 1, c - 1, p + (arr[r][c] - '0'));
  else if (c + 1 < M && best[r - 1][c + 1][p + (arr[r][c] - '0')] == R)
    printf("R"), solve2(r - 1, c + 1, p + (arr[r][c] - '0'));
  return;
}
int main() {
  scanf("%d %d %d", &N, &M, &K);
  K++;
  for (int i = 0; i < N; i++) scanf("%s", arr[i]);
  int ret = -1 << 30, ind;
  memset(best, -1, sizeof(best));
  for (int i = 0; i < M; i++) {
    int x = solve(N - 1, i, 0);
    if (x > ret) ret = x, ind = i;
  }
  if (ret == -1 << 30)
    printf("-1\n");
  else
    printf("%d\n", ret);
  R = ret;
  if (ret != -1 << 30) {
    printf("%d\n", ind + 1);
    solve2(N - 1, ind, 0);
  }
}
