#include <bits/stdc++.h>
using namespace std;
int n, m, k;
int memo[105][105][15];
char S[105][105];
int dp(int x, int y, int mod) {
  if (x == 0) {
    if ((S[x][y] - '0' + mod) % (k + 1) == 0) return S[x][y] - '0';
    return -(1 << 30);
  }
  int &dev = memo[x][y][mod];
  if (dev == -1) {
    int temp = S[x][y] - '0';
    dev = -(1 << 30);
    if (y - 1 >= 0)
      dev = max(dev, temp + dp(x - 1, y - 1, (mod + temp) % (k + 1)));
    if (y + 1 < m)
      dev = max(dev, temp + dp(x - 1, y + 1, (mod + temp) % (k + 1)));
  }
  return dev;
}
string f(int x, int y, int mod) {
  if (x == 0) return "";
  int temp = S[x][y] - '0';
  int op1 = -1, op2 = -1;
  if (y - 1 >= 0) op1 = temp + dp(x - 1, y - 1, (mod + temp) % (k + 1));
  if (y + 1 < m) op2 = temp + dp(x - 1, y + 1, (mod + temp) % (k + 1));
  if (op1 == -1) return "R" + f(x - 1, y + 1, (mod + temp) % (k + 1));
  if (op2 == -1) return "L" + f(x - 1, y - 1, (mod + temp) % (k + 1));
  if (op1 <= op2) return "R" + f(x - 1, y + 1, (mod + temp) % (k + 1));
  return "L" + f(x - 1, y - 1, (mod + temp) % (k + 1));
}
int main() {
  while (scanf("%d%d%d", &n, &m, &k) == 3) {
    memset(memo, -1, sizeof(memo));
    for (int i = 0; i < (n); i++) scanf("%s", S[i]);
    int maxi = -1, ind;
    for (int j = 0; j < (m); j++)
      if (dp(n - 1, j, 0) > maxi) maxi = dp(n - 1, j, 0), ind = j;
    if (maxi != -1) {
      cout << maxi << endl;
      cout << ind + 1 << endl;
      cout << f(n - 1, ind, 0) << endl;
    } else
      puts("-1");
  }
}
