#include <bits/stdc++.h>
using namespace std;
long long int ar[102][102], n, m, k;
long long int dp[102][102][11], visit[102][102][11];
char path[102][102][11];
long long int rec(long long int i, long long int j, long long int summod) {
  if (i < 1 || i > n || j < 1 || j > m) return -100000000000;
  if (i == 1) {
    if (((summod + ar[i][j]) % (k + 1)) == 0) {
      return ar[i][j];
    } else
      return -10000000000;
  }
  if (visit[i][j][summod] != 0) {
    if (dp[i][j][summod] == -1)
      return -10000000000;
    else
      return dp[i][j][summod];
  }
  long long int a = ar[i][j] + rec(i - 1, j - 1, (summod + ar[i][j]) % (k + 1));
  if (dp[i][j][summod] < a) {
    dp[i][j][summod] = a;
    path[i][j][summod] = 'L';
  }
  long long int b = ar[i][j] + rec(i - 1, j + 1, (summod + ar[i][j]) % (k + 1));
  if (dp[i][j][summod] < b) {
    dp[i][j][summod] = b;
    path[i][j][summod] = 'R';
  }
  visit[i][j][summod] = 1;
  if (dp[i][j][summod] != -1) {
    return dp[i][j][summod];
  } else
    return -10000000000;
}
int main() {
  long long int i, j, x, max1 = -1, b, z, sum = 0;
  char ch, arr[102][102];
  cin >> n >> m >> k;
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= m; j++) {
      cin >> arr[i][j];
      ar[i][j] = (int)arr[i][j] - 48;
    }
  }
  for (i = 0; i <= n; i++) {
    for (j = 0; j <= m; j++) {
      for (z = 0; z <= 10; z++) {
        dp[i][j][z] = -1;
      }
    }
  }
  for (i = 1; i <= m; i++) {
    long long int a = rec(n, i, 0);
    if (a > max1) {
      max1 = a;
      b = i;
    }
  }
  if (max1 == -1)
    cout << -1;
  else {
    i = n;
    j = b;
    cout << max1 << "\n";
    cout << b << "\n";
    while (i > 1) {
      ch = path[i][j][sum];
      sum = ((sum + ar[i][j]) % (k + 1));
      if (ch == 'L') {
        i = i - 1;
        j = j - 1;
      }
      if (ch == 'R') {
        i = i - 1;
        j = j + 1;
      }
      if (j < 1 || j > m) {
        if (ch == 'L') {
          j = j + 2;
          ch = 'R';
        } else {
          j = j - 2;
          ch = 'L';
        }
      }
      cout << ch;
    }
  }
}
