#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const long long dx[2] = {-1, -1};
const long long dy[2] = {-1, 1};
const long long MAX = 1e6 + 5;
long long gcd(long long a, long long b) { return (b == 0 ? a : gcd(b, a % b)); }
long long n, m, A, B, x, y, k, Q, ans;
string second;
int dp[12][101][101];
pair<int, int> best[12][101][101];
int cost[101][101];
bool valid(int i, int j) { return i >= 0 && i < n && j >= 0 && j < m; }
int solve(int i, int j, int rem) {
  if (i == 0) {
    rem += cost[i][j];
    rem %= (k + 1);
    if (rem == 0) return cost[i][j];
    return -1e9;
  }
  int &ret = dp[rem][i][j];
  if (~ret) return ret;
  int a = -1e9, b = -1e9;
  if (valid(i - 1, j - 1))
    a = cost[i][j] + solve(i - 1, j - 1, (rem + cost[i][j]) % (k + 1));
  if (valid(i - 1, j + 1))
    b = cost[i][j] + solve(i - 1, j + 1, (rem + cost[i][j]) % (k + 1));
  if (a > b)
    best[rem][i][j] = {i - 1, j - 1};
  else
    best[rem][i][j] = {i - 1, j + 1};
  return ret = max(a, b);
}
void print(int i, int j, int rem) {
  auto u = best[rem][i][j];
  if (u.first == -1) return;
  if (u.first == i - 1 && u.second == j - 1)
    cout << 'L';
  else
    cout << 'R';
  print(u.first, u.second, (rem + cost[i][j]) % (k + 1));
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m >> k;
  for (int i = 0; i < n; ++i) {
    cin >> second;
    for (int j = 0; j < m; ++j) cost[i][j] = (int)(second[j] - '0');
  }
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < m; ++j)
      for (int p = 0; p <= k; ++p) dp[p][i][j] = -1, best[p][i][j] = {-1, -1};
  int ans = -1, id = -1;
  for (int j = 0; j < m; ++j) {
    int sum = solve(n - 1, j, 0);
    if (sum > ans) ans = sum, id = j;
  }
  if (ans == -1) return cout << -1 << '\n', 0;
  cout << ans << '\n' << id + 1 << '\n';
  print(n - 1, id, 0);
  return 0;
}
