#include <bits/stdc++.h>
using namespace std;
const int gor = -1;
int d[105][105][12], a[105][105];
int n, m, k;
string ans2 = "";
void rec(int i, int j, int ost) {
  if (i == n - 1) {
    cout << j + 1 << '\n';
    return;
  }
  int ostNew = (ost - a[i][j] + 100 * k) % k;
  if (j == 0) {
    ans2 += 'L';
    rec(i + 1, j + 1, ostNew);
  } else if (j == m - 1) {
    ans2 += 'R';
    rec(i + 1, j - 1, ostNew);
  } else {
    if (d[i][j][ost] - a[i][j] == d[i + 1][j + 1][ostNew]) {
      ans2 += 'L';
      rec(i + 1, j + 1, ostNew);
    } else {
      ans2 += 'R';
      rec(i + 1, j - 1, ostNew);
    }
  }
  return;
}
int main() {
  cin >> n >> m >> k;
  ++k;
  for (int i = 0; i < n; ++i) {
    string s;
    cin >> s;
    for (int j = 0; j < s.size(); ++j) a[i][j] = (int)s[j] - (int)'0';
  }
  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] = gor;
  for (int i = 0; i < m; ++i) d[n - 1][i][a[n - 1][i] % k] = a[n - 1][i];
  for (int i = n - 2; i >= 0; --i)
    for (int j = 0; j < m; ++j)
      for (int j2 = 0; j2 < k; ++j2) {
        if (j && d[i + 1][j - 1][j2] != gor)
          d[i][j][(j2 + a[i][j]) % k] =
              max(d[i][j][(j2 + a[i][j]) % k], a[i][j] + d[i + 1][j - 1][j2]);
        if (j != m - 1 && d[i + 1][j + 1][j2] != gor)
          d[i][j][(j2 + a[i][j]) % k] =
              max(d[i][j][(j2 + a[i][j]) % k], a[i][j] + d[i + 1][j + 1][j2]);
      }
  int ans = 0;
  for (int i = 1; i < m; ++i)
    if (d[0][i][0] > d[0][ans][0]) ans = i;
  cout << d[0][ans][0] << '\n';
  if (d[0][ans][0] != gor) {
    rec(0, ans, 0);
    reverse(ans2.begin(), ans2.end());
    cout << ans2 << '\n';
  }
  return 0;
}
