#include <bits/stdc++.h>
using namespace std;
int n, m, k, dp[101][101][1000];
char g[101][110];
queue<char> path;
int maxPeas = -1;
void input() {
  scanf("%d %d %d\n", &n, &m, &k);
  k++;
  for (int i = 0; i < n; i++) gets(g[i]);
}
int solve(int i, int j, int peas) {
  if (i < 0) {
    if (peas % k == 0) return peas;
    return -100000000;
  }
  if (j >= m || j < 0) return -100000000;
  int &ret = dp[i][j][peas];
  if (ret != -1) return ret;
  int ch1 = solve(i - 1, j + 1, peas + g[i][j] - '0');
  int ch2 = solve(i - 1, j - 1, peas + g[i][j] - '0');
  return ret = max(ch1, ch2);
}
void getPath(int i, int j, int peas) {
  if (i == 0) return;
  int inc = g[i][j] - '0';
  if (j + 1 < m && dp[i - 1][j + 1][peas + inc] == maxPeas) {
    path.push('R');
    return getPath(i - 1, j + 1, peas + inc);
  }
  path.push('L');
  return getPath(i - 1, j - 1, peas + inc);
}
void manage() {
  memset(dp, -1, sizeof dp);
  for (int i = 0; i < m; i++) {
    maxPeas = max(maxPeas, solve(n - 2, i + 1, g[n - 1][i] - '0'));
    maxPeas = max(maxPeas, solve(n - 2, i - 1, g[n - 1][i] - '0'));
    dp[n - 1][i][0] = max(dp[n - 1][i][g[n - 1][i] - 0], maxPeas);
  }
  if (maxPeas == -1) {
    puts("-1");
    return;
  }
  int col;
  bool done = 0;
  for (int i = 0; i < m && !done; i++)
    if (dp[n - 1][i][0] == maxPeas) getPath(n - 1, i, 0), done = 1, col = i + 1;
  printf("%d\n%d\n", maxPeas, col);
  while (!path.empty()) {
    printf("%c", path.front());
    path.pop();
  }
}
int main() {
  input();
  manage();
}
