#include <bits/stdc++.h>
using namespace std;
long long readInt() {
  bool minus = false;
  long long result = 0;
  char ch;
  ch = getchar();
  while (true) {
    if (ch == '-') break;
    if (ch >= '0' && ch <= '9') break;
    ch = getchar();
  }
  if (ch == '-')
    minus = true;
  else
    result = ch - '0';
  while (true) {
    ch = getchar();
    if (ch < '0' || ch > '9') break;
    result = result * 10 + (ch - '0');
  }
  if (minus)
    return -result;
  else
    return result;
}
long long exp(long long taban, long long us) {
  long long carpan = taban % 1000000007;
  long long temp = us;
  long long res = 1;
  while (temp) {
    if (temp % 2) res = (res * carpan) % 1000000007;
    temp /= 2;
    carpan = (carpan * carpan) % 1000000007;
  }
  return res;
}
long long ebob(long long a, long long b) {
  if (!a) return b;
  return ebob(b % a, a);
}
long long ekok(long long a, long long b) { return (a * b) / ebob(a, b); }
int n, m, k;
vector<vector<char>> vec(105, vector<char>(105));
int dp[105][105][15];
bool safe(int r, int c) { return r >= 0 && r < n && c >= 0 && c < m; }
void go(int r, int c, int val, string move, string& ans, int& mx) {
  if (dp[r][c][val % (k + 1)] >= val)
    return;
  else {
    dp[r][c][val % (k + 1)] = val;
    if (r == 0 && val % (k + 1) == 0) {
      if (mx < dp[r][c][0]) {
        ans = move;
        mx = dp[r][c][0];
      }
    }
  }
  if (safe(r - 1, c - 1))
    go(r - 1, c - 1, val + vec[r - 1][c - 1] - '0', move + 'L', ans, mx);
  if (safe(r - 1, c + 1))
    go(r - 1, c + 1, val + vec[r - 1][c + 1] - '0', move + 'R', ans, mx);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> m >> k;
  vec.resize(n);
  for (int i = 0; i < n; i++) vec[i].resize(m);
  for (auto& x : vec)
    for (auto& y : x) cin >> y;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++)
      for (int h = 0; h < k; h++) dp[i][j][h] = -1;
  int res = -1;
  string ans;
  int col = -1;
  for (int j = 0; j < m; j++) {
    string tmp;
    int mx = -1;
    go(n - 1, j, vec[n - 1][j] - '0', "", tmp, mx);
    if (res < mx) {
      res = mx;
      ans = tmp;
      col = j + 1;
    }
  }
  if (res == -1) {
    cout << res;
    return 0;
  }
  cout << res << "\n" << col << "\n" << ans << "\n";
}
