#include <bits/stdc++.h>
using namespace std;
long long dp[102][102][1005], arr[123][123];
int inf = 123456789;
long long n, m, k;
long long recur(int ind, int col, int cost) {
  if (ind >= n) {
    if (cost % k)
      return -inf;
    else
      return cost;
  }
  if (dp[ind][col][cost] != -1) return dp[ind][col][cost];
  long long ans = -inf;
  if (col > 0) ans = max(ans, recur(ind + 1, col - 1, cost + arr[ind][col]));
  if (col < m - 1)
    ans = max(ans, recur(ind + 1, col + 1, cost + arr[ind][col]));
  return dp[ind][col][cost] = ans;
}
void calc(int col, int cost) {
  int i, j;
  int ind = 1;
  int temp = arr[0][col];
  int prev = col;
  string S = "";
  while (ind < n) {
    if (col > 0 && dp[ind][col - 1][temp] == cost) {
      temp += arr[ind][col - 1];
      col--;
      S += 'R';
    }
    if (col < m - 1 && dp[ind][col + 1][temp] == cost) {
      temp += arr[ind][col + 1];
      col++;
      S += 'L';
    }
    ind++;
  }
  cout << col + 1 << endl;
  for (i = 0; i < n - 1; i++) {
    cout << S[n - 2 - i];
  }
  cout << endl;
}
int main() {
  std::ios::sync_with_stdio(false);
  cin >> n >> m >> k;
  memset(dp, -1, sizeof(dp));
  k++;
  int i, j;
  for (i = 0; i < n; i++) {
    string str;
    cin >> str;
    for (j = 0; j < m; j++) arr[i][j] = str[j] - '0';
  }
  long long ans = -inf;
  long long ind = 0;
  for (i = 0; i < m; i++) {
    long long temp = recur(0, i, 0);
    if (ans < temp) {
      ans = temp;
      ind = i;
    }
  }
  if (ans < 0) {
    cout << "-1\n";
    return 0;
  }
  cout << ans << endl;
  calc(ind, ans);
  return 0;
}
