#include <bits/stdc++.h>
using namespace std;
int N, M, K, F[111][111][22], P[111][111][22], A[111][111];
string S;
inline void Print(int i, int j, int k) {
  k = (k % K + K) % K;
  if (i == N) {
    cout << j << endl;
  } else {
    Print(i + 1, P[i][j][k], k - A[i][j]);
    if (P[i][j][k] - 1 == j) cout << "L";
    if (P[i][j][k] + 1 == j) cout << "R";
  }
}
int main() {
  cin >> N >> M >> K;
  for (int i = 1; i <= N; i++) {
    cin >> S;
    for (int j = 1; j <= M; j++) A[i][j] = S[j - 1] - '0';
  }
  K++;
  memset(F, -1, sizeof(F));
  for (int i = 1; i <= M; i++) F[N][i][A[N][i] % K] = A[N][i];
  for (int i = N; i > 1; i--)
    for (int j = 1; j <= M; j++)
      for (int k = 0; k < K; k++)
        if (F[i][j][k] >= 0) {
          if (j > 1) {
            int v = (k + A[i - 1][j - 1]) % K;
            if (F[i][j][k] + A[i - 1][j - 1] > F[i - 1][j - 1][v]) {
              F[i - 1][j - 1][v] = F[i][j][k] + A[i - 1][j - 1];
              P[i - 1][j - 1][v] = j;
            }
          }
          if (j < M) {
            int v = (k + A[i - 1][j + 1]) % K;
            if (F[i][j][k] + A[i - 1][j + 1] > F[i - 1][j + 1][v]) {
              F[i - 1][j + 1][v] = F[i][j][k] + A[i - 1][j + 1];
              P[i - 1][j + 1][v] = j;
            }
          }
        }
  int Ret = 0;
  for (int i = 1; i <= M; i++)
    if (F[1][i][0] > F[1][Ret][0]) Ret = i;
  cout << F[1][Ret][0] << endl;
  if (Ret == 0) return 0;
  Print(1, Ret, 0);
  cout << endl;
  return 0;
}
