#include <bits/stdc++.h>
using namespace std;
int n, m, k, ans;
int grid[100 + 9][100 + 9];
int memo[100 + 9][100 + 9][1000 + 9];
int solve(int i, int j, int sum) {
  if (i == 0) {
    sum += grid[i][j];
    if (sum % (k + 1) == 0) {
      return sum;
    }
    return -2000;
  }
  sum += grid[i][j];
  if (memo[i][j][sum] != -1) {
    return memo[i][j][sum];
  }
  int ch1 = -2000, ch2 = -2000;
  if (j > 0) {
    ch1 = solve(i - 1, j - 1, sum);
  }
  if (j < m - 1) {
    ch2 = solve(i - 1, j + 1, sum);
  }
  return memo[i][j][sum] = max(ch1, ch2);
}
void show(int i, int j, int sum) {
  if (i == 0) {
    return;
  }
  sum += grid[i][j];
  int ch1 = -1, ch2 = -1;
  if (j > 0) {
    ch1 = solve(i - 1, j - 1, sum);
  }
  if (j < m - 1) {
    ch2 = solve(i - 1, j + 1, sum);
  }
  if (ch1 == memo[i][j][sum]) {
    cout << "L";
    show(i - 1, j - 1, sum);
  } else if (ch2 == memo[i][j][sum]) {
    cout << "R";
    show(i - 1, j + 1, sum);
  }
}
int main() {
  cin >> n >> m >> k;
  memset(memo, -1, sizeof(memo));
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      char c;
      cin >> c;
      grid[i][j] = c - '0';
    }
  }
  int ans = -1;
  for (int i = 0; i < m; i++) {
    ans = max(ans, memo[n - 1][i][0] = solve(n - 1, i, 0));
  }
  cout << ans << endl;
  if (ans != -1) {
    for (int i = 0; i < m; i++) {
      if (ans == memo[n - 1][i][0]) {
        cout << i + 1 << endl;
        break;
      }
    }
    for (int i = 0; i < m; i++) {
      if (ans == memo[n - 1][i][0]) {
        show(n - 1, i, 0);
        break;
      }
    }
  }
  return 0;
}
