#include <bits/stdc++.h>
using namespace std;
long long read() {
  long long a = 0, b = 0;
  char c = getchar();
  while (c > '9' || c < '0') b ^= (c == '-'), c = getchar();
  while (c >= '0' && c <= '9') a = a * 10 + c - 48, c = getchar();
  return b ? -a : a;
}
char s[105][105];
int dp[105][105][15], n, m, kk;
int rem[105][105][15];
int main() {
  n = read(), m = read(), kk = read() + 1;
  for (int i = 1; i <= n; i++) scanf("%s", s[i] + 1);
  memset(dp, -0x3f, sizeof dp);
  for (int j = 0; j <= m + 1; j++) {
    for (int k = 0; k < kk; k++) {
      dp[0][j][k] = 0;
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      for (int k = 0; k < kk; k++) {
        if (dp[i - 1][j - 1][k] >= 0) {
          int &a = dp[i][j][(dp[i - 1][j - 1][k] + s[i][j] - '0') % kk];
          int b = dp[i - 1][j - 1][k] + s[i][j] - '0';
          if (a < b) {
            rem[i][j][(dp[i - 1][j - 1][k] + s[i][j] - '0') % kk] = 1;
            a = b;
          }
        }
        if (dp[i - 1][j + 1][k] >= 0) {
          int &a = dp[i][j][(dp[i - 1][j + 1][k] + s[i][j] - '0') % kk];
          int b = dp[i - 1][j + 1][k] + s[i][j] - '0';
          if (a < b) {
            rem[i][j][(dp[i - 1][j + 1][k] + s[i][j] - '0') % kk] = 2;
            a = b;
          }
        }
      }
    }
  }
  int ans = -1;
  for (int i = 1; i <= m; i++) {
    if (dp[n][i][0] >= 0) {
      ans = max(ans, dp[n][i][0]);
    }
  }
  cout << ans << '\n';
  if (ans == -1) return 0;
  for (int i = 1; i <= m; i++) {
    if (dp[n][i][0] == ans) {
      int x = n, y = i, kc = 0;
      cout << i << '\n';
      while (x > 1) {
        if (rem[x][y][kc] == 1) {
          cout << "L";
          kc = ((kc - (s[x][y] - '0')) % kk + kk) % kk;
          x--, y--;
        } else if (rem[x][y][kc] == 2) {
          cout << "R";
          kc = ((kc - (s[x][y] - '0')) % kk + kk) % kk;
          x--, y++;
        } else {
          exit(1);
        }
      }
      return 0;
    }
  }
  return 0;
}
