#include <bits/stdc++.h>
using namespace std;
const long long int mod = 1e9 + 7;
const long long int inf = 1e18;
long long int n, m, k, ans = -1, ind;
vector<string> arr;
vector<vector<vector<long long int>>> dp(
    101, vector<vector<long long int>>(101, vector<long long int>(11, -1)));
vector<vector<vector<long long int>>> dp1(
    101, vector<vector<long long int>>(101, vector<long long int>(11, -1)));
vector<long long int> brr;
int main(void) {
  cin >> n >> m >> k;
  arr.resize(n);
  for (long long int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  for (long long int i = 0; i < m; i++) {
    dp[n - 1][i][(arr[n - 1][i] - 48) % (k + 1)] =
        max((long long int)(arr[n - 1][i] - 48),
            dp[n - 1][i][(arr[n - 1][i] - 48) % (k + 1)]);
  }
  for (long long int i = n - 2; i > -1; i--) {
    for (long long int j = 0; j < m; j++) {
      for (long long int l = 0; l < k + 1; l++) {
        if (j != m - 1) {
          if (dp[i + 1][j + 1][l] != -1) {
            if (dp[i][j][(arr[i][j] - 48 + dp[i + 1][j + 1][l]) % (k + 1)] <=
                arr[i][j] - 48 + dp[i + 1][j + 1][l]) {
              dp1[i][j][(arr[i][j] - 48 + dp[i + 1][j + 1][l]) % (k + 1)] = 1;
            }
            dp[i][j][(arr[i][j] - 48 + dp[i + 1][j + 1][l]) % (k + 1)] =
                max(dp[i][j][(arr[i][j] - 48 + dp[i + 1][j + 1][l]) % (k + 1)],
                    arr[i][j] - 48 + dp[i + 1][j + 1][l]);
          }
        }
        if (j != 0) {
          if (dp[i + 1][j - 1][l] != -1 && j != 0) {
            if (dp[i][j][(arr[i][j] - 48 + dp[i + 1][j - 1][l]) % (k + 1)] <=
                arr[i][j] - 48 + dp[i + 1][j - 1][l]) {
              dp1[i][j][(arr[i][j] - 48 + dp[i + 1][j - 1][l]) % (k + 1)] = -1;
            }
            dp[i][j][(arr[i][j] - 48 + dp[i + 1][j - 1][l]) % (k + 1)] =
                max(dp[i][j][(arr[i][j] - 48 + dp[i + 1][j - 1][l]) % (k + 1)],
                    arr[i][j] - 48 + dp[i + 1][j - 1][l]);
          }
        }
      }
    }
  }
  for (long long int i = 0; i < m; i++) {
    if (ans < dp[0][i][0]) {
      ind = i;
    }
    ans = max(dp[0][i][0], ans);
  }
  cout << ans << endl;
  if (ans == -1) {
    return 0;
  }
  long long int last = ans;
  for (long long int i = 0; i < n - 1; i++) {
    long long int new_ind;
    new_ind = ind + dp1[i][ind][last % (k + 1)];
    brr.push_back(dp1[i][ind][last % (k + 1)]);
    last = last - arr[i][ind] + 48;
    ind = new_ind;
  }
  cout << ind + 1 << endl;
  reverse(brr.begin(), brr.end());
  for (long long int i = 0; i < brr.size(); i++) {
    if (brr[i] == 1) {
      cout << 'L';
    } else {
      cout << 'R';
    }
  }
}
