#include <bits/stdc++.h>
using namespace std;
int G[110][110];
int dp[110][110][20];
int p[110][110][20];
int K, M, N;
int f(int row, int col, int resto) {
  if (col >= M || col < 0) return -2;
  if (dp[row][col][resto] != -1) return dp[row][col][resto];
  if (row == 0) {
    if ((resto + G[0][col]) % K == 0)
      return G[0][col];
    else
      return -2;
  }
  int tmp, res = -2;
  tmp = f(row - 1, col - 1, (G[row][col] + resto) % K);
  if (tmp != -2)
    if (res < G[row][col] + tmp) {
      res = G[row][col] + tmp;
      p[row][col][resto] = -1;
    }
  tmp = f(row - 1, col + 1, (G[row][col] + resto) % K);
  if (tmp != -2)
    if (res < G[row][col] + tmp) {
      res = G[row][col] + tmp;
      p[row][col][resto] = 1;
    }
  return dp[row][col][resto] = res;
}
void print(int r, int c, int md) {
  int next = c + p[r][c][md];
  if (r == 0) return;
  if (p[r][c][md] == 1)
    cout << 'R';
  else
    cout << 'L';
  print(r - 1, next, (md + G[r][c]) % K);
}
int main() {
  cin >> N >> M >> K;
  char c;
  for (int i = (int)0; i < (int)N; i++)
    for (int j = (int)0; j < (int)M; j++) {
      cin >> c;
      G[i][j] = c - '0';
      for (int k = (int)0; k < (int)20; k++) dp[i][j][k] = -1;
    }
  int res = -2, tmp, id = -1;
  K++;
  for (int i = (int)0; i < (int)M; i++) {
    int tmp = f(N - 1, i, 0);
    if (tmp == -2) continue;
    if (res < tmp) {
      res = tmp;
      id = i + 1;
    }
  }
  if (res == -2)
    cout << -1 << endl;
  else {
    cout << res << endl;
    cout << id << endl;
    print(N - 1, id - 1, 0);
    cout << endl;
  }
  return 0;
}
