#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:64000000")
using namespace std;
struct item {
  char c;
  int x, y, k;
  item() {
    x = y = k = -1;
    c = 'A';
  };
  item(int X, int Y, int K, char C) {
    x = X;
    y = Y;
    k = K;
    c = C;
  }
};
int d[100][100][20];
item pr[100][100][20];
int a[100][100];
vector<char> ans;
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  k++;
  for (int i = 0; i < n; i++) {
    char c;
    for (int j = 0; j < m; j++) {
      scanf(" %c ", &c);
      a[i][j] = int(c) - '0';
    }
  }
  memset(d, -1, sizeof(d));
  for (int i = 0; i < m; i++) d[n - 1][i][(a[n - 1][i]) % k] = a[n - 1][i];
  for (int i = n - 1 - 1; i >= 0; i--) {
    for (int j = 0; j < m; j++) {
      for (int z = 0; z < k; z++) {
        if (j == 0 && j != m - 1) {
          d[i][j][z] = d[i + 1][j + 1][(z - a[i][j] + 100 * k) % k] + a[i][j];
          pr[i][j][z] = item(i + 1, j + 1, (z - a[i][j] + 100 * k) % k, 'L');
        } else if (j == m - 1 && j != 0) {
          d[i][j][z] = d[i + 1][j - 1][(z - a[i][j] + 100 * k) % k] + a[i][j];
          pr[i][j][z] = item(i + 1, j - 1, (z - a[i][j] + 100 * k) % k, 'R');
        } else if (d[i + 1][j - 1][(z - a[i][j] + 100 * k) % k] >
                   d[i + 1][j + 1][(z - a[i][j] + 100 * k) % k]) {
          d[i][j][z] = d[i + 1][j - 1][(z - a[i][j] + 100 * k) % k] + a[i][j];
          pr[i][j][z] = item(i + 1, j - 1, (z - a[i][j] + 100 * k) % k, 'R');
        } else {
          d[i][j][z] = d[i + 1][j + 1][(z - a[i][j] + 100 * k) % k] + a[i][j];
          pr[i][j][z] = item(i + 1, j + 1, (z - a[i][j] + 100 * k) % k, 'L');
        }
        if (d[i][j][z] == a[i][j] - 1) d[i][j][z] = -1;
      }
    }
  }
  int maxx = -1, maxi;
  for (int i = 0; i < m; i++)
    if (maxx < d[0][i][0]) {
      maxx = d[0][i][0];
      maxi = i;
    }
  if (maxx == -1) {
    printf("-1");
    exit(0);
  }
  cout << maxx << endl;
  int x = 0, y = maxi, k1 = 0;
  while (x >= 0 && y >= 0) {
    ans.push_back(pr[x][y][k1].c);
    if (x == n - 1) cout << y + 1 << endl;
    int x1 = x, y1 = y, k2 = k1;
    x = pr[x1][y1][k2].x;
    y = pr[x1][y1][k2].y;
    k1 = pr[x1][y1][k2].k;
  }
  ans.pop_back();
  reverse(ans.begin(), ans.end());
  for (int i = 0; i < ans.size(); i++) printf("%c", ans[i]);
  return 0;
}
