#include <bits/stdc++.h>
using namespace std;
long long read() {
  long long s = 0, w = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') {
      w = -1;
    }
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    s = s * 10 + ch - '0';
    ch = getchar();
  }
  return w * s;
}
int n, m, k, a[111][111], f[111][111][2000];
char d[111][111][2000];
bool check(int y) { return (y >= 1 && y <= m); }
void dfs(int x, int y, int z) {
  if (x == n) {
    cout << y << endl;
    return;
  }
  if (d[x][y][z] == 'R')
    dfs(x + 1, y - 1, z - a[x][y]);
  else
    dfs(x + 1, y + 1, z - a[x][y]);
  cout << d[x][y][z];
}
int main() {
  n = read();
  m = read();
  k = read();
  for (int i = 1; i <= n; i++) {
    char s;
    for (int j = 1; j <= m; j++) {
      s = getchar();
      while (s < '0' || s > '9') s = getchar();
      a[i][j] = s - '0';
    }
  }
  for (int i = 1; i <= m; i++) {
    f[n][i][a[n][i]] = 1;
  }
  for (int i = n - 1; i >= 1; i--) {
    for (int j = 1; j <= m; j++) {
      for (int z = a[i][j]; z <= 1010; z++) {
        if (check(j - 1) && f[i + 1][j - 1][z - a[i][j]]) {
          f[i][j][z] = 1;
          d[i][j][z] = 'R';
        }
        if (check(j + 1) && f[i + 1][j + 1][z - a[i][j]]) {
          f[i][j][z] = 1;
          d[i][j][z] = 'L';
        }
      }
    }
  }
  for (int i = 1010; i >= 0; i--) {
    if (i % (k + 1)) continue;
    for (int j = 1; j <= m; j++) {
      if (f[1][j][i]) {
        cout << i << endl;
        dfs(1, j, i);
        return 0;
      }
    }
  }
  puts("-1");
  return 0;
}
