#include <bits/stdc++.h>
using namespace std;
int dp[102][102][12];
int moves[102][102][12][2];
int B[102][102];
int M[102][102];
int n, m, k;
int main() {
  scanf("%d %d %d\n", &n, &m, &k);
  memset((moves), (-1), sizeof((moves)));
  char ch;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      scanf("%c", &ch);
      B[i][j] = ch - '0';
      M[i][j] = B[i][j] % (k + 1);
      for (int s = 0; s <= k; s++) dp[i][j][s] = -10000;
    }
    scanf("%c", &ch);
  }
  for (int i = 0; i < m; i++) {
    int s = M[0][i];
    for (int j = 0; j <= k; j++) {
      int v = (j + s) % (k + 1);
      if (v == 0) dp[0][i][j] = B[0][i];
    }
  }
  for (int i = 1; i < n; i++) {
    for (int j = 0; j < m; j++) {
      for (int s = 0; s <= k; s++) {
        if (i == n - 1) s = 0;
        int nx = i - 1, ny = j - 1;
        if (nx >= 0 && nx < n && ny >= 0 && ny < m) {
          int fm = s + M[i][j];
          fm %= (k + 1);
          int sm = B[i][j] + dp[i - 1][j - 1][fm];
          if (dp[i][j][s] < sm) {
            dp[i][j][s] = max(dp[i][j][s], sm);
            moves[i][j][s][0] = 0;
            moves[i][j][s][1] = fm;
          }
        }
        nx = i - 1, ny = j + 1;
        if (nx >= 0 && nx < n && ny >= 0 && ny < m) {
          int fm = s + M[i][j];
          fm %= (k + 1);
          int sm = B[i][j] + dp[i - 1][j + 1][fm];
          if (dp[i][j][s] < sm) {
            dp[i][j][s] = max(dp[i][j][s], sm);
            moves[i][j][s][0] = 1;
            moves[i][j][s][1] = fm;
          }
        }
        if (i == n - 1) break;
      }
    }
  }
  int ans = -5000, sta = -1;
  for (int i = 0; i < m; i++) {
    if (dp[n - 1][i][0] > ans) {
      ans = dp[n - 1][i][0];
      sta = i;
    }
  }
  if (ans < 0) {
    printf("-1\n");
    return 0;
  } else {
    printf("%d\n", ans);
    printf("%d\n", sta + 1);
    int nx = n - 1, ny = sta, s = 0;
    while (nx > 0) {
      if (moves[nx][ny][s][0] == 0) {
        printf("L");
        s = moves[nx][ny][s][1];
        nx -= 1, ny -= 1;
        continue;
      }
      if (moves[nx][ny][s][0] == 1) {
        printf("R");
        s = moves[nx][ny][s][1];
        nx -= 1, ny += 1;
        continue;
      }
      if (moves[nx][ny][s][0] < 0) break;
    }
  }
  if (n > 1) printf("\n");
  return 0;
}
