#include <bits/stdc++.h>
using namespace std;
const long double EPS = 1E-9;
const int INF = (int)1E9;
const long long INF64 = (long long)1E18;
const long double PI = 2 * acos(.0);
int n, m, k;
int dp[105][105][12];
char path[105][105][12];
char mapa[105][105];
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> m >> k;
  for (int i = 0; i < (int)(n); i++) {
    cin >> mapa[i];
  }
  memset(dp, -1, sizeof(dp));
  for (int j = 0; j < (int)(m); j++)
    dp[0][j][(mapa[0][j] - '0') % (k + 1)] = (mapa[0][j] - '0');
  for (int i = 1; i < (int)(n); i++) {
    for (int j = 0; j < (int)(m); j++) {
      for (int p = 0; p < (int)(k + 2); p++) {
        if (j > 0) {
          if (dp[i - 1][j - 1][p] != -1) {
            int sum = (mapa[i][j] - '0') + dp[i - 1][j - 1][p];
            int modu = sum % (k + 1);
            if (sum > dp[i][j][modu]) {
              dp[i][j][modu] = sum;
              path[i][j][modu] = 'L';
            }
          }
        }
        if (j < m - 1) {
          if (dp[i - 1][j + 1][p] == -1) continue;
          int sum = (mapa[i][j] - '0') + dp[i - 1][j + 1][p];
          int modu = sum % (k + 1);
          if (sum > dp[i][j][modu]) {
            dp[i][j][modu] = sum;
            path[i][j][modu] = 'R';
          }
          dp[i][j][modu] = max(sum, dp[i][j][modu]);
        }
      }
    }
  }
  int maxi = -1;
  int col = -1;
  for (int i = 0; i < (int)(m); i++) {
    if (maxi < dp[n - 1][i][0]) {
      maxi = dp[n - 1][i][0];
      col = i;
    }
  }
  cout << maxi << endl;
  if (maxi == -1) return 0;
  cout << col + 1 << endl;
  int modu = 0;
  for (int i = n - 2; i >= 0; i--) {
    char loc = path[i + 1][col][modu];
    cout << loc;
    if (loc == 'L') {
      modu = (dp[i + 1][col][modu] - (mapa[i + 1][col] - '0')) % (k + 1);
      col--;
    } else {
      modu = (dp[i + 1][col][modu] - (mapa[i + 1][col] - '0')) % (k + 1);
      col++;
    }
  }
  cout << endl;
  return 0;
}
