#include <bits/stdc++.h>
using namespace std;
long long dp[102][102][1002];
int n, m, k;
vector<string> v;
int f(int i, int j, int prec, long long cum) {
  if (i == n && cum % (k + 1)) return -1000000007;
  if (i == n) return cum;
  if (j < 0) return -1000000007;
  if (j >= m) return -1000000007;
  if (dp[i][j][cum] != -1) return dp[i][j][cum];
  return dp[i][j][cum] = max(f(i + 1, j + 1, j, cum + (v[i][j] - '0')),
                             f(i + 1, j - 1, j, cum + (v[i][j] - '0')));
}
void trace(int i, int j, int prec, long long cum) {
  if (i == n && cum % (k + 1)) return;
  if (i == n) return;
  if (j < 0) return;
  if (j >= m) return;
  long long perfect = f(i, j, prec, cum);
  long long c1 = f(i + 1, j + 1, j, cum + (v[i][j] - '0'));
  long long c2 = f(i + 1, j - 1, j, cum + (v[i][j] - '0'));
  if (perfect == c1) {
    if (i != n - 1) cout << "R";
    trace(i + 1, j + 1, j, cum + (v[i][j] - '0'));
  } else {
    if (i != n - 1) cout << "L";
    trace(i + 1, j - 1, j, cum + (v[i][j] - '0'));
  }
}
int main() {
  cin >> n >> m >> k;
  string s;
  for (int i = 0; i < n; i++) {
    cin >> s;
    v.push_back(s);
  }
  reverse(v.begin(), v.end());
  long long sol = -1;
  memset(dp, -1, sizeof dp);
  int ind = 0;
  for (int p = 0; p < m; p++) {
    long long k = f(0, p, 0, 0);
    if (k > sol) {
      sol = k;
      ind = p + 1;
    }
  }
  cout << sol << endl;
  if (sol == -1) return 0;
  cout << ind << endl;
  memset(dp, -1, sizeof dp);
  trace(0, ind - 1, 0, 0);
}
