#include <bits/stdc++.h>
using namespace std;
int lim = 1 << 19;
long long mod = 1000000007;
const int N = 105;
int n, m, k, ans, ind;
string in;
int a[N][N], dp[N][N][15], path_taken[N][N][15];
deque<int> moves;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> m >> k;
  k++;
  for (int i = 0; i < n; i++) {
    cin >> in;
    for (int j = 0; j < m; j++) a[i][j] = in[j] - '0';
  }
  ans = ind = -1;
  for (int s = 0; s < m; s++) {
    memset(dp, -1, sizeof(dp));
    memset(path_taken, -1, sizeof(path_taken));
    dp[n - 1][s][a[n - 1][s] % k] = a[n - 1][s];
    for (int i = n - 2; i >= 0; i--) {
      for (int j = 0; j < m; j++) {
        for (int rem = 0; rem < k; rem++) {
          if (j < m - 1 && dp[i + 1][j + 1][rem] != -1) {
            int temp = (a[i][j] + dp[i + 1][j + 1][rem]) % k;
            if (dp[i][j][temp] == -1 ||
                dp[i][j][temp] < a[i][j] + dp[i + 1][j + 1][rem]) {
              dp[i][j][temp] = a[i][j] + dp[i + 1][j + 1][rem];
              path_taken[i][j][temp] = 0;
            }
          }
          if (j > 0 && dp[i + 1][j - 1][rem] != -1) {
            int temp = (a[i][j] + dp[i + 1][j - 1][rem]) % k;
            if (dp[i][j][temp] == -1 ||
                dp[i][j][temp] < a[i][j] + dp[i + 1][j - 1][rem]) {
              dp[i][j][temp] = a[i][j] + dp[i + 1][j - 1][rem];
              path_taken[i][j][temp] = 1;
            }
          }
        }
      }
    }
    int tempans = -1;
    int tempind = -1;
    for (int i = 0; i < m; i++) {
      if (tempans < dp[0][i][0]) {
        tempans = dp[0][i][0];
        tempind = i;
      }
    }
    if (tempind != -1) {
      if (ans < tempans) {
        ans = tempans;
        int lv, h, cur;
        lv = cur = 0;
        h = tempind;
        moves.clear();
        while (path_taken[lv][h][cur] != -1) {
          moves.push_front(path_taken[lv][h][cur]);
          int temp = cur;
          cur = (cur - a[lv][h] + k * 420) % k;
          if (path_taken[lv][h][temp] == 0)
            h++;
          else
            h--;
          lv++;
        }
        ind = h;
      }
    }
  }
  cout << ans << endl;
  if (ans != -1) {
    cout << ind + 1 << endl;
    for (int i = 0; i < moves.size(); i++) cout << (moves[i] == 0 ? 'L' : 'R');
  }
  return 0;
}
