#include <bits/stdc++.h>
using namespace std;
template <typename T, typename V>
void bugp(const pair<T, V> &x) {
  if (0) cerr << '{' << x.first << ", " << x.second << '}' << endl;
}
template <typename T, typename U, typename V>
void bugpp(const pair<T, pair<U, V> > &x) {
  if (0)
    cerr << '{' << x.first << ", {" << x.second.first << ", " << x.second.second
         << "}}" << endl;
}
template <typename T>
bool maximize(T &x, const T &y) {
  if (x < y) {
    x = y;
    return 1;
  }
  return 0;
}
template <typename T>
bool minimize(T &x, const T &y) {
  if (x > y) {
    x = y;
    return 1;
  }
  return 0;
}
const int N = 102, M = 102, K = 11, INF = 1000000000;
int n, m, k, C[N][M], dp[N][M][K];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> m >> k;
  ++k;
  for (int i = 1, _n = (n); i <= _n; ++i) {
    string s;
    cin >> s;
    for (int j = 0, _n = (m); j < _n; ++j) C[i][j + 1] = s[j] - 48;
  }
  fill(&dp[0][0][0], &dp[0][0][0] + sizeof(dp) / sizeof(int), -INF);
  for (int j = 1, _n = (m); j <= _n; ++j) dp[n + 1][j][0] = 0;
  int mod;
  for (int i = (n); i > 0; --i) {
    if (0) cerr << ("i") << " = " << (i) << endl;
    for (int j = 1, _n = (m); j <= _n; ++j) {
      if (0) cerr << ("j") << " = " << (j) << endl;
      for (int t = 0, _n = (k); t < _n; ++t) {
        if (0) cerr << ("t") << " = " << (t) << endl;
        mod = (t - C[i][j] + 9 * k) % k;
        if (dp[i + 1][j - 1][mod] != -INF)
          maximize(dp[i][j][t], dp[i + 1][j - 1][mod] + C[i][j]);
        if (dp[i + 1][j + 1][mod] != -INF)
          maximize(dp[i][j][t], dp[i + 1][j + 1][mod] + C[i][j]);
        if (0) cerr << ("dp[i][j][t]") << " = " << (dp[i][j][t]) << endl;
      }
    }
  }
  int col, ans = -INF, t = 0;
  for (int j = 1, _n = (m); j <= _n; ++j)
    if (maximize(ans, dp[1][j][0])) col = j;
  if (ans == -INF) {
    cout << -1;
    return 0;
  }
  string res;
  for (int i = 1, _n = (n - 1); i <= _n; ++i) {
    mod = (t - C[i][col] + 9 * k) % k;
    if (dp[i][col][t] == dp[i + 1][col - 1][mod] + C[i][col]) {
      --col;
      res.push_back('R');
    } else {
      ++col;
      res.push_back('L');
    }
    t = mod;
  }
  cout << ans << '\n' << col << '\n';
  for (int i = (res.size()) - 1; i >= 0; --i) cout << res[i];
  return 0;
}
