#include <bits/stdc++.h>
using namespace std;
const int maxK = 11;
const int maxN = 111;
const int INF = (int)1e9;
int dp[maxN][maxN][maxK];
string A[maxN];
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  k++;
  for (int i = 0; i <= n; i++) {
    for (int j = 0; j < m; j++) {
      for (int l = 0; l < k; l++) {
        dp[i][j][l] = -INF;
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    cin >> A[i];
    for (auto &x : A[i]) x -= '0';
  }
  for (int j = 0; j < m; j++) {
    dp[0][j][0] = 0;
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < m; j++) {
      for (int l = 0; l < k; l++) {
        int o = (A[i][j] + l) % k;
        if (j != 0)
          dp[i][j][o] = max(dp[i][j][o], dp[i - 1][j - 1][l] + A[i][j]);
        if (j != m - 1)
          dp[i][j][o] = max(dp[i][j][o], dp[i - 1][j + 1][l] + A[i][j]);
      }
    }
  }
  int i = n;
  pair<int, int> cur;
  for (int j = 0; j < m; j++) {
    cur = max(cur, {dp[i][j][0], j});
  }
  int j = cur.second;
  int o = 0;
  if (dp[i][j][o] >= 0) {
    cout << dp[i][j][o] << endl;
    string ans;
    cout << j + 1 << endl;
    for (; i > 1; i--) {
      int l = (o - A[i][j] + 100 * k) % k;
      if (j && dp[i][j][o] == dp[i - 1][j - 1][l] + A[i][j]) {
        j--;
        ans.push_back('L');
      } else if (j != m - 1 && dp[i][j][o] == dp[i - 1][j + 1][l] + A[i][j]) {
        j++;
        ans.push_back('R');
      }
      o = l;
    }
    cout << ans << endl;
  } else {
    cout << -1 << endl;
  }
  return 0;
}
