#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void checkmin(T& a, T b) {
  if (b < a) a = b;
}
template <class T>
inline void checkmax(T& a, T b) {
  if (b > a) a = b;
}
template <class T>
T Abs(T x) {
  return x > 0 ? x : -x;
}
template <class T>
inline T sqr(T x) {
  return x * x;
}
template <class T>
inline bool isPrime(T n) {
  if (n <= 1) return false;
  for (T i = 2; i * i <= n; i++)
    if (n % i == 0) return false;
  return true;
}
template <class T>
inline T Mod(T n, T m) {
  return (n % m + m) % m;
}
template <class T>
void debug(const T& e) {
  cout << e << endl;
}
template <class T1, class T2>
void debug(const T1& e1, const T2& e2) {
  cout << e1 << "\t" << e2 << endl;
}
template <class T1, class T2, class T3>
void debug(const T1& e1, const T2& e2, const T3& e3) {
  cout << e1 << "\t" << e2 << "\t" << e3 << endl;
}
template <class T1, class T2, class T3, class T4>
void debug(const T1& e1, const T2& e2, const T3& e3, const T4& e4) {
  cout << e1 << "\t" << e2 << "\t" << e3 << "\t" << e4 << endl;
}
template <class T1, class T2, class T3, class T4, class T5>
void debug(const T1& e1, const T2& e2, const T3& e3, const T4& e4,
           const T5& e5) {
  cout << e1 << "\t" << e2 << "\t" << e3 << "\t" << e4 << "\t" << e5 << endl;
}
template <class T>
void debug(vector<T>& e) {
  int i;
  for (i = 0; i < (int)e.size(); i++) cout << e[i] << " ";
  cout << endl;
}
template <class T>
void debug(vector<basic_string<T> >& e) {
  int i, j;
  for (i = 0; i < (int)e.size(); i++) {
    for (j = 0; j < (int)e[i].size(); j++) cout << e[i][j];
    cout << endl;
  }
  cout << endl;
}
template <class T>
void debug(vector<vector<T> >& e, int row, int col) {
  int i, j;
  for (i = 0; i < row; i++) {
    for (j = 0; j < col; j++) cout << e[i][j] << "\t";
    cout << endl;
  }
  cout << endl;
}
template <class T>
void debug(T e[200][200], int row, int col) {
  int i, j;
  for (i = 0; i < row; i++) {
    for (j = 0; j < col; j++) cout << e[i][j] << " ";
    cout << endl;
  }
}
template <class T>
void debug(T e[], int row) {
  int i;
  for (i = 0; i < row; i++) cout << e[i] << " ";
  cout << endl;
}
template <class T>
string toString(T n) {
  ostringstream oss;
  oss << n;
  oss.flush();
  return oss.str();
}
int toInt(string s) {
  int r = 0;
  istringstream sin(s);
  sin >> r;
  return r;
}
long long toLl(string s) {
  long long r = 0;
  istringstream sin(s);
  sin >> r;
  return r;
}
bool IsVowel(char ch) {
  ch = tolower(ch);
  if (ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u')
    return true;
  return false;
}
long long Pow(int B, int P) {
  long long R = 1;
  while (P > 0) {
    if (P % 2 == 1) R = (R * B);
    P /= 2;
    B = (B * B);
  }
  return R;
}
int BigMod(long long B, long long P, long long M) {
  long long R = 1;
  while (P > 0) {
    if (P % 2 == 1) {
      R = (R * B) % M;
    }
    P /= 2;
    B = (B * B) % M;
  }
  return (int)R;
}
long long mulmod(long long a, long long b, long long c) {
  long long x = 0, y = a % c;
  while (b > 0) {
    if (b % 2 == 1) {
      x = (x + y) % c;
    }
    y = (y * 2) % c;
    b /= 2;
  }
  return x % c;
}
void binprint(int mask, int n) {
  int i;
  string s = "";
  do {
    s += (mask % 2 + '0');
    mask /= 2;
  } while (mask);
  reverse(s.begin(), s.end());
  s = string(max(n - (int)s.size(), 0), '0') + s;
  for (i = (int)s.size() - n; i < (int)s.size(); i++) printf("%c", s[i]);
  printf("\n");
}
void ASCII_Chart() {
  int i, j, k;
  printf("ASCII Chart:(30-129)\n");
  for (i = 30; i < 50; i++) {
    for (j = 0; j < 5; j++) {
      k = i + j * 20;
      printf("%3d---> '%c'   ", k, k);
    }
    printf("\n");
  }
}
int dx[] = {-1, -1};
int dy[] = {1, -1};
int row, col, dp[200][200][1000], K;
char board[200][200];
int rec(int x, int y, int sum) {
  int &ret = dp[x][y][sum], i, m, n, cost, ans;
  if (ret != -1) return ret;
  if (x == 0) {
    if (sum % (K + 1) == 0) return ret = sum;
    return ret = -1 << 28;
  }
  ret = -1 << 28;
  for (i = 0; i < 2; i++) {
    m = x + dx[i];
    n = y + dy[i];
    if (m >= 0 && m < row && n >= 0 && n < col) {
      cost = sum + (board[m][n] - '0');
      ret = max(ret, rec(m, n, cost));
    }
  }
  return ret;
}
string str;
void Print(int x, int y, int sum) {
  int ret = dp[x][y][sum], i, m, n, cost;
  if (x == 0) {
    return;
  }
  for (i = 0; i < 2; i++) {
    m = x + dx[i];
    n = y + dy[i];
    if (m >= 0 && m < row && n >= 0 && n < col) {
      cost = sum + board[m][n] - '0';
      int temp = rec(m, n, cost);
      if (rec(m, n, cost) == ret) {
        if (i == 0)
          str += "R";
        else
          str += "L";
        Print(m, n, cost);
        return;
      }
    }
  }
  return;
}
int main() {
  int i, j, test, Case = 1, res, ind, maxv;
  while (scanf("%d %d %d", &row, &col, &K) == 3) {
    for (i = 0; i < row; i++) {
      scanf("%s", board[i]);
    }
    maxv = -1;
    memset(dp, -1, sizeof(dp));
    for (i = 0; i < col; i++) {
      res = rec(row - 1, i, board[row - 1][i] - '0');
      if (res != -1 && res % (K + 1) == 0) {
        if (res > maxv) {
          maxv = res;
          ind = i;
        }
      }
    }
    if (maxv > -1) {
      res = rec(row - 1, ind, board[row - 1][ind] - '0');
      str.clear();
      printf("%d\n%d\n", maxv, ind + 1);
      Print(row - 1, ind, board[row - 1][ind] - '0');
      cout << str << endl;
    } else
      printf("-1\n");
  }
  return 0;
}
