#include <bits/stdc++.h>
using namespace std;
const int oo = 0x3f3f3f3f;
int dp[105][105][12];
struct DP {
  int col, d;
} path[105][105][12];
char str[105];
int maze[105][105];
char road[105 * 2], cnt;
int main() {
  int n, m, k;
  while (scanf("%d %d %d", &n, &m, &k) != EOF) {
    k++;
    for (int i = 1; i <= n; i++) {
      scanf("%s", str + 1);
      for (int j = 1; j <= m; j++) maze[i][j] = str[j] - '0';
    }
    memset(dp, -1, sizeof dp);
    memset(path, -1, sizeof path);
    for (int i = 1; i <= m; i++) dp[n][i][maze[n][i] % k] = maze[n][i];
    for (int i = n - 1; i >= 1; i--) {
      for (int j = 1; j <= m; j++) {
        int now;
        for (int l = 0; l <= k; l++) {
          if (dp[i + 1][j - 1][l] == -1) continue;
          now = (l + maze[i][j]) % k;
          if (dp[i][j][now] < dp[i + 1][j - 1][l] + maze[i][j]) {
            dp[i][j][now] = dp[i + 1][j - 1][l] + maze[i][j];
            path[i][j][now].col = j - 1;
            path[i][j][now].d = l;
          }
        }
        for (int r = 0; r <= k; r++) {
          if (dp[i + 1][j + 1][r] == -1) continue;
          now = (r + maze[i][j]) % k;
          if (dp[i][j][now] < dp[i + 1][j + 1][r] + maze[i][j]) {
            dp[i][j][now] = dp[i + 1][j + 1][r] + maze[i][j];
            path[i][j][now].col = j + 1;
            path[i][j][now].d = r;
          }
        }
      }
    }
    int col, d = 0, ans = -1, row = 1;
    for (int i = 1; i <= m; i++)
      if (ans < dp[1][i][0]) {
        ans = dp[1][i][0];
        col = i;
      }
    printf("%d\n", ans);
    if (ans == -1) continue;
    cnt = 0;
    while (path[row][col][d].d != -1) {
      int next_col = path[row][col][d].col;
      int next_d = path[row][col][d].d;
      if (col < next_col)
        road[++cnt] = 'L';
      else
        road[++cnt] = 'R';
      row++;
      col = next_col;
      d = next_d;
    }
    printf("%d\n", col);
    for (int i = cnt; i >= 1; i--) printf("%c", road[i]);
    puts("");
  }
  return 0;
}
