#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  string b[n];
  for (int i = 0; i < n; ++i) cin >> b[i];
  int d[n][m][20];
  int from[n][m][20][3];
  memset(d, -1, sizeof(d));
  for (int i = 0; i < m; i++)
    d[0][i][(b[0][i] - '0') % (k + 1)] = b[0][i] - '0';
  for (int i = 0; i < m; i++) {
    from[0][i][(b[0][i] - '0') % (k + 1)][0] = -1;
    from[0][i][(b[0][i] - '0') % (k + 1)][1] = -1;
    from[0][i][(b[0][i] - '0') % (k + 1)][2] = -1;
  }
  for (int i = 1; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (j == 0) {
        for (int a = 0; a <= 10; a++) {
          if (d[i - 1][j + 1][a] == -1) continue;
          int r = d[i - 1][j + 1][a];
          r += (b[i][j] - '0') % (k + 1);
          r %= (k + 1);
          if (d[i][j][r] < d[i - 1][j + 1][a] + b[i][j] - '0') {
            d[i][j][r] = d[i - 1][j + 1][a] + b[i][j] - '0';
            from[i][j][r][0] = i - 1;
            from[i][j][r][1] = j + 1;
            from[i][j][r][2] = a;
          }
        }
      } else if (j == m - 1) {
        for (int a = 0; a <= 10; a++) {
          if (d[i - 1][j - 1][a] == -1) continue;
          int r = d[i - 1][j - 1][a];
          r += (b[i][j] - '0') % (k + 1);
          r %= (k + 1);
          if (d[i][j][r] < d[i - 1][j - 1][a] + b[i][j] - '0') {
            d[i][j][r] = d[i - 1][j - 1][a] + b[i][j] - '0';
            from[i][j][r][0] = i - 1;
            from[i][j][r][1] = j - 1;
            from[i][j][r][2] = a;
          }
        }
      } else {
        for (int a = 0; a <= 10; a++) {
          if (d[i - 1][j + 1][a] == -1) continue;
          int r = d[i - 1][j + 1][a];
          r += (b[i][j] - '0') % (k + 1);
          r %= (k + 1);
          if (d[i][j][r] < d[i - 1][j + 1][a] + b[i][j] - '0') {
            d[i][j][r] = d[i - 1][j + 1][a] + b[i][j] - '0';
            from[i][j][r][0] = i - 1;
            from[i][j][r][1] = j + 1;
            from[i][j][r][2] = a;
          }
        }
        for (int a = 0; a <= 10; a++) {
          if (d[i - 1][j - 1][a] == -1) continue;
          int r = d[i - 1][j - 1][a];
          r += (b[i][j] - '0') % (k + 1);
          r %= (k + 1);
          if (d[i][j][r] < d[i - 1][j - 1][a] + b[i][j] - '0') {
            d[i][j][r] = d[i - 1][j - 1][a] + b[i][j] - '0';
            from[i][j][r][0] = i - 1;
            from[i][j][r][1] = j - 1;
            from[i][j][r][2] = a;
          }
        }
      }
    }
  }
  int max_sum = -1;
  int x, y;
  for (int i = 0; i < m; i++) {
    if (max_sum < d[n - 1][i][0]) {
      max_sum = d[n - 1][i][0];
      x = i;
      y = n - 1;
    }
  }
  if (max_sum == -1) {
    cout << "-1\n";
  } else {
    cout << max_sum << "\n";
    cout << x + 1 << "\n";
    string path;
    int r = 0;
    while (from[y][x][r][0] != -1) {
      int xx = from[y][x][r][1];
      if (xx == x - 1)
        path += "L";
      else if (xx == x + 1)
        path += "R";
      int yy = from[y][x][r][0];
      r = from[y][x][r][2];
      y = yy;
      x = xx;
    }
    cout << path << "\n";
  }
}
