#include <bits/stdc++.h>
using namespace std;
int n, m, k, dp[200][200][20], par[200][200][20];
char A[200][200];
int main() {
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 0; i < n; i++) scanf("%s", &A[i]);
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) A[i][j] -= '0';
  for (int j = 0; j < m; j++)
    for (int ost = 0; ost <= k; ost++) dp[n - 1][j][ost] = -2e9;
  for (int j = 0; j < m; j++) dp[n - 1][j][A[n - 1][j] % (k + 1)] = A[n - 1][j];
  for (int i = n - 2; i >= 0; i--)
    for (int j = 0; j < m; j++)
      for (int ost = 0; ost <= k; ost++) {
        if (j == 0) {
          par[i][j][ost] = 1;
          dp[i][j][ost] =
              dp[i + 1][j + 1][(ost - A[i][j] + 20000 * (k + 1)) % (k + 1)] +
              A[i][j];
        }
        if (j == m - 1) {
          par[i][j][ost] = 2;
          dp[i][j][ost] =
              dp[i + 1][j - 1][(ost - A[i][j] + 20000 * (k + 1)) % (k + 1)] +
              A[i][j];
        }
        if (j > 0 && j < m - 1) {
          if (dp[i + 1][j + 1][(ost - A[i][j] + 20000 * (k + 1)) % (k + 1)] >
              dp[i + 1][j - 1][(ost - A[i][j] + 20000 * (k + 1)) % (k + 1)])
            par[i][j][ost] = 1;
          else
            par[i][j][ost] = 2;
          dp[i][j][ost] = max(
              dp[i + 1][j + 1][(ost - A[i][j] + 20000 * (k + 1)) % (k + 1)] +
                  A[i][j],
              dp[i + 1][j - 1][(ost - A[i][j] + 20000 * (k + 1)) % (k + 1)] +
                  A[i][j]);
        };
      };
  int answer = -1, best_col = -1;
  for (int i = 0; i < m; i++)
    if (answer < dp[0][i][0]) {
      answer = dp[0][i][0];
      best_col = i;
    };
  printf("%d\n", answer);
  if (best_col != -1) {
    string ans = "";
    int cur_ost = 0;
    for (int i = 0; i < n - 1; i++) {
      int value = A[i][best_col];
      if (par[i][best_col][cur_ost] == 1) {
        ans += 'L';
        ++best_col;
      } else {
        ans += 'R';
        --best_col;
      };
      cur_ost = (cur_ost - value + 20000 * (k + 1)) % (k + 1);
    };
    reverse(ans.begin(), ans.end());
    cout << best_col + 1 << '\n' << ans << '\n';
  };
  return 0;
}
