#include <bits/stdc++.h>
using namespace std;
const int MAX = 100 + 20;
int number[MAX][MAX];
int ans[MAX][MAX][12];
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  k = k + 1;
  for (int i = 1; i <= n; i = i + 1) {
    for (int j = 1; j <= m; j = j + 1) {
      char t;
      cin >> t;
      number[n - i + 1][m - j + 1] = t - '0';
    }
  }
  for (int i = 0; i <= n + 1; i = i + 1) {
    for (int j = 0; j <= m + 1; j = j + 1) {
      for (int p = 0; p < k; p = p + 1) {
        ans[i][j][p] = -1;
      }
    }
  }
  for (int i = 1; i <= m; i = i + 1) {
    int x = (number[1][i] % k);
    ans[1][i][x] = number[1][i];
  }
  for (int i = 2; i <= n; i = i + 1) {
    for (int j = 1; j <= m; j = j + 1) {
      for (int p = 0; p < k; p = p + 1) {
        int x = ((p - number[i][j]) + (k * 10)) % k;
        int ans_1 = ans[i - 1][j + 1][x];
        int ans_2 = ans[i - 1][j - 1][x];
        int ans_3 = max(ans_1, ans_2);
        if (ans_3 == -1) {
          ans[i][j][p] = ans_3;
        } else {
          ans[i][j][p] = ans_3 + number[i][j];
        }
      }
    }
  }
  int ans_1 = ans[n][1][0];
  string temp;
  int x = n;
  int y = 1;
  int z = 0;
  for (int i = 1; i <= m; i = i + 1) {
    if (ans_1 < ans[n][i][0]) {
      ans_1 = ans[n][i][0];
      y = i;
    }
  }
  int out = ans_1;
  while (x > 1) {
    ans_1 = ans_1 - number[x][y];
    int z = (ans_1) % k;
    int ans_2 = ans[x - 1][y - 1][z];
    int ans_3 = ans[x - 1][y + 1][z];
    if (ans_2 <= ans_3) {
      x--;
      y++;
      temp = temp + 'R';
    } else {
      x--;
      y--;
      temp = temp + 'L';
    }
  }
  string ans_2;
  y = m - y + 1;
  for (int i = temp.size() - 1; i >= 0; i = i - 1) {
    ans_2 = ans_2 + temp[i];
  }
  cout << out << endl;
  if (out != -1) {
    cout << y << endl;
    cout << ans_2 << endl;
  }
  return 0;
}
