#include <bits/stdc++.h>
using namespace std;
const int N = 123;
const int inf = 1e9;
int dp[N][N][15], a[N][N];
char to[N][N][15];
bool vis[N][N][15];
int n, m, k;
int dfs(int y, int x, int curk) {
  if (y == 0) return (curk ? -inf : 0);
  if (vis[y][x][curk]) return dp[y][x][curk];
  vis[y][x][curk] = true;
  int go_left = (x == 1 ? -inf : dfs(y - 1, x - 1, (curk + a[y][x]) % k));
  int go_right = (x == m ? -inf : dfs(y - 1, x + 1, (curk + a[y][x]) % k));
  int ans = a[y][x];
  if (go_left > go_right) {
    ans += go_left;
    to[y][x][curk] = 'L';
  } else {
    ans += go_right;
    to[y][x][curk] = 'R';
  }
  return dp[y][x][curk] = ans;
}
int main() {
  scanf("%d %d %d", &n, &m, &k);
  k++;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) {
      char x;
      scanf(" %c", &x);
      a[i][j] = x - '0';
    }
  int ans = -inf;
  for (int i = 1; i <= m; i++) ans = max(ans, dfs(n, i, 0));
  if (ans < 0) return puts("-1");
  printf("%d\n", ans);
  int at;
  for (int i = 1; i <= m; i++)
    if (dp[n][i][0] == ans) at = i;
  printf("%d\n", at);
  string sans;
  int curk = 0;
  for (int i = n; i > 1; i--) {
    sans.push_back(to[i][at][curk]);
    int z = (to[i][at][curk] == 'L' ? -1 : 1);
    curk += a[i][at];
    curk %= k;
    at += z;
  }
  printf("%s\n", sans.c_str());
  return 0;
}
