#include <bits/stdc++.h>
using namespace std;
template <typename T>
void read(T &x) {
  x = 0;
  int f = 1;
  char c = getchar();
  for (; !isdigit(c); c = getchar())
    if (c == '-') f = -1;
  for (; isdigit(c); c = getchar()) x = x * 10 + c - '0';
  x = x * f;
}
int n, m, kk, pos, ans;
int d[120][120];
bool f[101][101][5001];
char dir[101][101][5001];
char c;
string pth = "";
int main() {
  cin >> n >> m >> kk;
  kk++;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) {
      cin >> c;
      d[i][j] = c - '0';
    }
  for (int i = 1; i <= m; i++) f[n][i][d[n][i]] = 1;
  for (int i = n - 1; i >= 1; i--)
    for (int j = 1; j <= m; j++)
      for (int k = 4021; k >= d[i][j]; k--) {
        if (j != 1 and f[i + 1][j - 1][k - d[i][j]]) {
          f[i][j][k] = 1;
          dir[i][j][k] = 'R';
        }
        if (j != m and f[i + 1][j + 1][k - d[i][j]]) {
          f[i][j][k] = 1;
          dir[i][j][k] = 'L';
        }
      }
  pos = -1;
  ans = -1;
  for (int i = 4021; i >= 0; i--) {
    if (i % kk == 0)
      for (int j = 1; j <= m; j++)
        if (f[1][j][i]) {
          ans = i;
          pos = j;
        }
    if (pos != -1) break;
  }
  if (pos == -1) {
    cout << pos << endl;
    return 0;
  }
  cout << ans << endl;
  for (int i = 1; i <= n - 1; i++) {
    pth = pth + dir[i][pos][ans];
    int sav = ans;
    ans -= d[i][pos];
    if (dir[i][pos][sav] == 'L')
      pos++;
    else
      pos--;
  }
  cout << pos << endl;
  for (int i = pth.length() - 1; i >= 0; i--) cout << pth[i];
  cout << endl;
  return 0;
}
