#include <bits/stdc++.h>
using namespace std;
int d[110][110][20];
bool t[110][110][20];
int v[110][110];
int main() {
  int n, m, k;
  scanf("%d%d%d", &n, &m, &k);
  ++k;
  char ch;
  scanf("%c", &ch);
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      scanf("%c", &ch);
      v[i][j] = int(ch) - int('0');
    };
    scanf("%c", &ch);
  };
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      for (int o = 0; o < k; ++o) {
        d[i][j][o] = -100000;
      };
    };
  };
  for (int i = 0; i < m; ++i) {
    d[n - 1][i][v[n - 1][i] % k] = v[n - 1][i];
  };
  for (int i = n - 2; i >= 0; --i) {
    for (int j = 0; j < m; ++j) {
      for (int o = 0; o < k; ++o) {
        if (j == 0 || (j != m - 1) && d[i + 1][j + 1][o] > d[i + 1][j - 1][o]) {
          d[i][j][(o + v[i][j]) % k] = d[i + 1][j + 1][o] + v[i][j];
          t[i][j][(o + v[i][j]) % k] = true;
        } else {
          d[i][j][(o + v[i][j]) % k] = d[i + 1][j - 1][o] + v[i][j];
          t[i][j][(o + v[i][j]) % k] = false;
        };
      };
    };
  };
  int ans = -1, pos;
  for (int i = 0; i < m; ++i) {
    if (d[0][i][0] > ans) {
      ans = d[0][i][0];
      pos = i;
    };
  };
  printf("%d\n", ans);
  if (ans == -1) return 0;
  int ntt = 0;
  string ss("");
  for (int i = 0; i < n - 1; ++i) {
    int tt = ntt;
    ntt = (d[i][pos][tt] - v[i][pos] + 1000 * k) % k;
    if (t[i][pos][tt]) {
      ss += 'L';
      ++pos;
    } else {
      ss += 'R';
      --pos;
    };
  };
  reverse(ss.begin(), ss.end());
  printf("%d\n", pos + 1);
  cout << ss << endl;
  return 0;
};
