#include <bits/stdc++.h>
using namespace std;
int DP[101][101][11], n, m, k, matrix[101][101], dad[101][101][11];
vector<char> path;
void update(int a, int b) {
  if (b > 0 && b < m - 1) {
    for (int i = 0; i < k; i++) {
      if (dad[a + 1][b - 1][i]) {
        if (DP[a][b][(i + matrix[a][b]) % k] <
            DP[a + 1][b - 1][i] + matrix[a][b]) {
          DP[a][b][(i + matrix[a][b]) % k] = DP[a + 1][b - 1][i] + matrix[a][b];
          dad[a][b][(i + matrix[a][b]) % k] = 1;
        }
      }
    }
    for (int i = 0; i < k; i++) {
      if (dad[a + 1][b + 1][i]) {
        if (DP[a][b][(i + matrix[a][b]) % k] <
            DP[a + 1][b + 1][i] + matrix[a][b]) {
          DP[a][b][(i + matrix[a][b]) % k] = DP[a + 1][b + 1][i] + matrix[a][b];
          dad[a][b][(i + matrix[a][b]) % k] = 2;
        }
      }
    }
  }
  if (b == 0) {
    for (int i = 0; i < k; i++) {
      if (dad[a + 1][b + 1][i]) {
        if (DP[a][b][(i + matrix[a][b]) % k] <
            DP[a + 1][b + 1][i] + matrix[a][b]) {
          DP[a][b][(i + matrix[a][b]) % k] = DP[a + 1][b + 1][i] + matrix[a][b];
          dad[a][b][(i + matrix[a][b]) % k] = 2;
        }
      }
    }
  }
  if (b == m - 1) {
    for (int i = 0; i < k; i++) {
      if (dad[a + 1][b - 1][i]) {
        if (DP[a][b][(i + matrix[a][b]) % k] <
            DP[a + 1][b - 1][i] + matrix[a][b]) {
          DP[a][b][(i + matrix[a][b]) % k] = DP[a + 1][b - 1][i] + matrix[a][b];
          dad[a][b][(i + matrix[a][b]) % k] = 1;
        }
      }
    }
  }
}
int mod(int a, int b, int c) {
  c -= matrix[a][b];
  while (c < 0) c += k;
  return c;
}
int LAST;
void make_path(int a, int b, int c, int last) {
  if (last == -1) {
    LAST = b;
    return;
  }
  if (last == 1) {
    make_path(a + 1, b - 1, mod(a, b, c), dad[a + 1][b - 1][mod(a, b, c)]);
  }
  if (last == 2) {
    make_path(a + 1, b + 1, mod(a, b, c), dad[a + 1][b + 1][mod(a, b, c)]);
  }
  path.push_back((last == 1) ? 'R' : 'L');
}
int main() {
  for (int i = 0; i < 101; i++)
    for (int j = 0; j < 101; j++)
      for (int k = 0; k < 11; k++) DP[i][j][k] = -1e9;
  cin >> n >> m >> k;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      char c;
      cin >> c;
      matrix[i][j] = c - '0';
    }
  }
  k++;
  for (int i = 0; i < m; i++) {
    DP[n - 1][i][matrix[n - 1][i] % k] = matrix[n - 1][i];
    dad[n - 1][i][matrix[n - 1][i] % k] = -1;
  }
  for (int i = n - 2; i >= 0; i--) {
    for (int j = 0; j < m; j++) {
      update(i, j);
    }
  }
  int ans = -1;
  int max_ind = -1;
  for (int i = 0; i < m; i++) {
    if (dad[0][i][0] != 0) {
      if (ans < DP[0][i][0]) {
        ans = DP[0][i][0];
        max_ind = i;
      }
    }
  }
  cout << ans << endl;
  if (ans == -1) return 0;
  make_path(0, max_ind, 0, dad[0][max_ind][0]);
  cout << LAST + 1 << endl;
  for (int i = 0; i < path.size(); i++) {
    cout << path[i];
  }
  cout << endl;
}
