#include <bits/stdc++.h>
using namespace std;
int grid[102][102];
int table[102][102][12];
bool visit[102][102][12];
int path[102][102][12];
int N, M, K;
string in;
void Print(int r, int c, int s) {
  int nr, nc, ns;
  if (path[r][c][s] == 1) {
    nr = r - 1;
    nc = c - 1;
    ns = (s + grid[r][c]) % (K + 1);
    printf("L");
  } else if (path[r][c][s] == 2) {
    nr = r - 1;
    nc = c + 1;
    ns = (s + grid[r][c]) % (K + 1);
    printf("R");
  }
  if (nr == 0) return;
  Print(nr, nc, ns);
}
int dp(int r, int c, int s, int k) {
  int &ans = table[r][c][s];
  if (visit[r][c][s]) return ans;
  int nr, nc, temp;
  if (r == 0) {
    if ((s + grid[r][c]) % k == 0)
      return ans = grid[r][c];
    else
      return ans = -1;
  }
  ans = -1;
  nr = r - 1;
  nc = c - 1;
  if (nr >= 0 && nr < N && nc >= 0 && nc < M) {
    temp = dp(nr, nc, (s + grid[r][c]) % k, k);
    if (temp != -1 && (temp + grid[r][c]) > ans) {
      ans = table[nr][nc][(s + grid[r][c]) % k] + grid[r][c];
      path[r][c][s] = 1;
    }
  }
  nr = r - 1;
  nc = c + 1;
  if (nr >= 0 && nr < N && nc >= 0 && nc < M) {
    temp = dp(nr, nc, (s + grid[r][c]) % k, k);
    if (temp != -1 && (temp + grid[r][c]) > ans) {
      ans = table[nr][nc][(s + grid[r][c]) % k] + grid[r][c];
      path[r][c][s] = 2;
    }
  }
  visit[r][c][s] = true;
  return ans;
}
int main() {
  int i, j, k, sc;
  scanf("%d %d %d", &N, &M, &K);
  for (i = 0; i < N; i++) {
    cin >> in;
    for (j = 0; j < M; j++) grid[i][j] = in[j] - '0';
  }
  int ans = -1;
  for (i = 0; i < M; i++) {
    if (dp(N - 1, i, 0, K + 1) > ans) {
      ans = table[N - 1][i][0];
      sc = i + 1;
    }
  }
  if (ans == -1) {
    printf("%d\n", ans);
    return 0;
  }
  printf("%d\n", ans);
  printf("%d\n", sc);
  Print(N - 1, sc - 1, 0);
  printf("\n");
  return 0;
}
