#include <bits/stdc++.h>
using namespace std;
const int MAXN = 105;
const int MAX_K = 15;
const int INF = (int)1e9;
int n, m, k;
char grid[MAXN][MAXN];
int dp[MAXN][MAXN][MAX_K];
int dx[] = {-1, -1};
int dy[] = {-1, 1};
int moves[] = {'L', 'R'};
int is_in(int x, int y) { return 0 <= x && x < n && 0 <= y && y < m; }
int solve(int x, int y, int mod) {
  int val = grid[x][y] - '0';
  if (x == 0) {
    if ((mod + val) % (k + 1) == 0) {
      return val;
    }
    return -INF;
  }
  if (dp[x][y][mod] != -1) {
    return dp[x][y][mod];
  }
  int aux = -INF;
  for (int i = 0; i < 2; i++) {
    int nx = x + dx[i];
    int ny = y + dy[i];
    if (is_in(nx, ny)) {
      aux = max(aux, val + solve(nx, ny, (mod + val) % (k + 1)));
    }
  }
  dp[x][y][mod] = aux;
  return aux;
}
void print_ans(int x, int y, int ans) {
  int mod = 0;
  printf("%d\n", y + 1);
  for (int i = n - 2; i >= 0; i--) {
    int val = grid[x][y] - '0';
    ans -= grid[x][y] - '0';
    for (int j = 0; j < 2; j++) {
      int nx = x + dx[j];
      int ny = y + dy[j];
      int n_mod = (mod + val) % (k + 1);
      if (is_in(nx, ny) && solve(nx, ny, n_mod) == ans) {
        printf("%c", moves[j]);
        x = nx;
        y = ny;
        mod = n_mod;
        break;
      }
    }
  }
  return;
}
int main(void) {
  scanf(" %d %d %d", &n, &m, &k);
  for (int i = 0; i < n; i++) {
    scanf(" %s", grid[i]);
  }
  int ans = -1;
  memset(dp, -1, sizeof(dp));
  for (int i = 0; i < m; i++) {
    ans = max(ans, solve(n - 1, i, 0));
  }
  printf("%d\n", ans);
  if (ans != 1) {
    for (int i = 0; i < m; i++) {
      if (solve(n - 1, i, 0) == ans) {
        print_ans(n - 1, i, ans);
        break;
      }
    }
  }
  return 0;
}
