#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const int MAXN = 205;
char field[MAXN][MAXN];
int a[MAXN][MAXN];
int dp[MAXN][MAXN][20], n, m, k;
int Roll[MAXN][MAXN][20];
int main() {
  scanf("%d%d%d", &n, &m, &k);
  k++;
  for (int i = (n)-1; i >= (0); i--) scanf("%s", field[i]);
  for (int i = (0); i < (n); i++)
    for (int j = (0); j < (m); j++) a[i][j] = field[i][j] - '0';
  memset(dp, -1, sizeof dp);
  memset(Roll, -1, sizeof Roll);
  for (int j = (0); j < (m); j++) dp[0][j][a[0][j] % k] = a[0][j];
  for (int i = (0); i < (n - 1); i++) {
    for (int j = (0); j < (m - 1); j++) {
      for (int v = (0); v < (k); v++) {
        if (dp[i][j][v] == -1) continue;
        int t = dp[i][j][v] + a[i + 1][j + 1];
        if (dp[i + 1][j + 1][t % k] < t)
          dp[i + 1][j + 1][t % k] = t, Roll[i + 1][j + 1][t % k] = 1;
      }
    }
    for (int j = (1); j < (m); j++) {
      for (int v = (0); v < (k); v++) {
        if (dp[i][j][v] == -1) continue;
        int t = dp[i][j][v] + a[i + 1][j - 1];
        if (dp[i + 1][j - 1][t % k] < t)
          dp[i + 1][j - 1][t % k] = t, Roll[i + 1][j - 1][t % k] = 0;
      }
    }
  }
  int ans = -1, pos = -1, v = 0;
  for (int j = (0); j < (m); j++)
    if (ans < dp[n - 1][j][0]) ans = dp[n - 1][j][0], pos = j;
  if (ans == -1) return 0 * puts("-1");
  printf("%d\n", ans);
  stack<int> stk;
  for (int i = (n)-1; i >= (1); i--) {
    stk.push(Roll[i][pos][v]);
    int u = ((v - a[i][pos]) % k + k) % k;
    if (Roll[i][pos][v])
      pos--;
    else
      pos++;
    v = u;
  }
  printf("%d\n", pos + 1);
  while (!stk.empty()) printf("%c", "LR"[stk.top()]), stk.pop();
}
