#include <bits/stdc++.h>
using namespace std;
string s[110];
vector<pair<long long, long long> > v[110][110], v1;
pair<long long, long long> cur;
long long a[20];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n, l, m, k, i, j, mx, id, pre;
  cin >> n >> m >> k;
  k++;
  for (i = 0; i < n; i++) {
    cin >> s[i];
    for (j = 0; j < m; j++) s[i][j] -= 48;
  }
  for (i = 0; i < m; i++) v[0][i].push_back(make_pair(s[0][i], -1));
  for (i = 1; i < n; i++)
    for (j = 0; j < m; j++) {
      v1.clear();
      for (l = 0; l < k; l++) a[l] = 0;
      if (j - 1 >= 0) {
        for (l = 0; l < (int)(v[i - 1][j - 1].size()); l++) {
          cur = v[i - 1][j - 1][l];
          v1.push_back(make_pair(cur.first + s[i][j], j - 1));
        }
      }
      if (j + 1 < m) {
        for (l = 0; l < (int)(v[i - 1][j + 1].size()); l++) {
          cur = v[i - 1][j + 1][l];
          v1.push_back(make_pair(cur.first + s[i][j], j + 1));
        }
      }
      sort(v1.rbegin(), v1.rend());
      for (l = 0; l < (int)(v1.size()); l++) {
        cur = v1[l];
        if (a[cur.first % k] == 0) {
          a[cur.first % k] = 1;
          v[i][j].push_back(cur);
        }
      }
    }
  mx = -1;
  for (i = 0; i < m; i++)
    for (j = 0; j < (int)(v[n - 1][i].size()); j++) {
      cur = v[n - 1][i][j];
      if (cur.first % k == 0) {
        if (cur.first > mx) {
          mx = cur.first;
          id = i;
          pre = cur.second;
        }
      }
    }
  cout << mx << "\n";
  if (mx != -1) {
    cout << id + 1 << "\n";
    i = n - 1;
    while (pre != -1) {
      if (pre < id)
        cout << "L";
      else
        cout << "R";
      mx -= s[i][id];
      i--;
      for (j = 0; j < (int)(v[i][pre].size()); j++) {
        cur = v[i][pre][j];
        if (cur.first == mx) {
          id = pre;
          pre = cur.second;
          break;
        }
      }
    }
    cout << "\n";
  }
  return 0;
}
