#include <bits/stdc++.h>
using namespace std;
int n, m, i, j, l, st, k, dp[101][100][11];
pair<int, int> p[101][100][11];
int answer, MAX, ind, IND;
char a[100][100];
vector<char> ans;
void output(int n, int m, int l) {
  if (n <= 0) return;
  output(n - 1, p[n][m][l].first, p[n][m][l].second);
  if (p[n][m][l].first < m)
    ans.push_back('R');
  else
    ans.push_back('L');
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m >> k;
  k++;
  for (i = 0; i < n; i++) {
    for (j = 0; j < m; j++) {
      cin >> a[i][j];
    }
  }
  for (i = 0; i < n / 2; i++) {
    for (j = 0; j < m; j++) {
      swap(a[i][j], a[n - 1 - i][j]);
    }
  }
  for (st = 0; st < m; st++) {
    dp[0][st][0] = 1;
    p[0][st][0] = {-1, -1};
    for (i = 0; i < n; i++) {
      for (j = 0; j < m; j++) {
        for (l = 0; l < k; l++) {
          if (dp[i][j][l]) {
            if (j > 0) {
              if (dp[i][j][l] + (a[i][j] - '0') >
                  dp[i + 1][j - 1][(l + a[i][j] - '0') % k]) {
                dp[i + 1][j - 1][(l + a[i][j] - '0') % k] =
                    dp[i][j][l] + (a[i][j] - '0');
                p[i + 1][j - 1][(l + a[i][j] - '0') % k] = {j, l};
              }
            }
            if (j < m - 1) {
              if (dp[i][j][l] + (a[i][j] - '0') >
                  dp[i + 1][j + 1][(l + a[i][j] - '0') % k]) {
                dp[i + 1][j + 1][(l + a[i][j] - '0') % k] =
                    dp[i][j][l] + (a[i][j] - '0');
                p[i + 1][j + 1][(l + a[i][j] - '0') % k] = {j, l};
              }
            }
          }
        }
      }
    }
    MAX = -1;
    for (i = 0; i < m; i++) {
      if (MAX < dp[n][i][0]) MAX = dp[n][i][0], ind = i;
    }
    if (answer < MAX) {
      answer = MAX;
      ans.clear();
      IND = st;
      output(n, ind, 0);
    }
    for (i = 0; i <= n; i++) {
      for (j = 0; j < m; j++) {
        for (l = 0; l < k; l++) dp[i][j][l] = 0;
      }
    }
  }
  if (answer == 0) {
    cout << -1;
    return 0;
  }
  cout << answer - 1 << endl << IND + 1 << endl;
  for (i = 0; i < ans.size() - 1; i++) cout << ans[i];
  return 0;
}
