#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:100000000000");
using namespace std;
int n, m, k;
int A[100][100];
int DP[100][100][12];
int P[100][100][12];
int main() {
  cin >> n >> m >> k;
  k++;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    for (int j = 0; j < m; j++) A[n - i - 1][j] = (int)(s[j] - '0');
  }
  memset(P, -1, sizeof(P));
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++)
      for (int l = 0; l < 12; l++) DP[i][j][l] = -100000000;
  for (int i = 0; i < m; i++) DP[0][i][A[0][i] % k] = A[0][i];
  for (int i = 0; i < n - 1; i++)
    for (int j = 0; j < m; j++)
      for (int l = 0; l < k; l++)
        if (DP[i][j][l] >= 0) {
          if (j + 1 < m) {
            if (DP[i][j][l] + A[i + 1][j + 1] >
                DP[i + 1][j + 1][(l + A[i + 1][j + 1]) % k]) {
              DP[i + 1][j + 1][(l + A[i + 1][j + 1]) % k] =
                  DP[i][j][l] + A[i + 1][j + 1];
              P[i + 1][j + 1][(l + A[i + 1][j + 1]) % k] = j;
            }
          }
          if (j - 1 >= 0) {
            if (DP[i][j][l] + A[i + 1][j - 1] >
                DP[i + 1][j - 1][(l + A[i + 1][j - 1]) % k]) {
              DP[i + 1][j - 1][(l + A[i + 1][j - 1]) % k] =
                  DP[i][j][l] + A[i + 1][j - 1];
              P[i + 1][j - 1][(l + A[i + 1][j - 1]) % k] = j;
            }
          }
        }
  int res = -1000000000, y = -1;
  for (int i = 0; i < m; i++)
    for (int j = 0; j < 1; j++)
      if (DP[n - 1][i][j] > res) {
        res = DP[n - 1][i][j];
        y = i;
      }
  if (res < 0)
    cout << -1 << endl;
  else {
    int x = n - 1;
    string r = "";
    cout << res << endl;
    while (x > 0) {
      int ty = y;
      y = P[x][y][res % k];
      res -= A[x][ty];
      if (ty > y)
        r += 'R';
      else
        r += 'L';
      x--;
    }
    cout << y + 1 << endl;
    reverse(r.begin(), r.end());
    cout << r << endl;
  }
}
