#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false), cin.tie(0);
  int t = 1, n, m, i, j, k, l, u, to;
  while (t--) {
    cin >> n >> m >> k;
    k++;
    int inf = 1e9;
    int dp[101][101][11], a[101][101];
    for (i = 0; i < n; i++) {
      for (j = 0; j < m; j++) {
        for (l = 0; l < k; l++) {
          dp[i][j][l] = -inf;
        }
      }
    }
    for (i = 0; i < n; i++) {
      string s;
      cin >> s;
      for (j = 0; j < m; j++) {
        a[i][j] = s[j] - '0';
      }
    }
    for (j = 0; j < m; j++) {
      dp[n - 1][j][a[n - 1][j] % k] = a[n - 1][j];
    }
    for (i = n - 2; i >= 0; i--) {
      for (j = 0; j < m; j++) {
        for (l = 0; l < k; l++) {
          if (j - 1 >= 0) {
            dp[i][j][l] =
                max(dp[i][j][l],
                    dp[i + 1][j - 1][(l + k - a[i][j] % k) % k] + a[i][j]);
          }
          if (j + 1 < m) {
            dp[i][j][l] =
                max(dp[i][j][l],
                    dp[i + 1][j + 1][(l + k - a[i][j] % k) % k] + a[i][j]);
          }
        }
      }
    }
    string ans = "";
    int mx = -inf;
    for (i = 0; i < m; i++) {
      if (dp[0][i][0] > mx) {
        mx = dp[0][i][0];
        j = i;
      }
    }
    if (mx < 0) {
      cout << -1;
      return 0;
    }
    for (l = 0, i = 0; i < n - 1; i++) {
      if (j - 1 >= 0 &&
          dp[i][j][l] ==
              dp[i + 1][j - 1][(l + k - a[i][j] % k) % k] + a[i][j]) {
        l = (l + k - a[i][j--] % k) % k;
        ans += "R";
        continue;
      }
      if (j + 1 < m &&
          dp[i][j][l] ==
              dp[i + 1][j + 1][(l + k - a[i][j] % k) % k] + a[i][j]) {
        l = (l + k - a[i][j++] % k) % k;
        ans += "L";
      }
    }
    reverse(ans.begin(), ans.end());
    cout << mx << '\n' << j + 1 << '\n';
    cout << ans;
  }
}
