On some square in the lowest row of a chessboard a stands a pawn. It has only two variants of moving: upwards and leftwards or upwards and rightwards. The pawn can choose from which square of the lowest row it can start its journey. On each square lay from 0 to 9 peas. The pawn wants to reach the uppermost row having collected as many peas as possible. As there it will have to divide the peas between itself and its k brothers, the number of peas must be divisible by k + 1. Find the maximal number of peas it will be able to collect and which moves it should make to do it.

The pawn cannot throw peas away or leave the board. When a pawn appears in some square of the board (including the first and last square of the way), it necessarily takes all the peas.

Input

The first line contains three integers n, m, k (2 ≤ n, m ≤ 100, 0 ≤ k ≤ 10) — the number of rows and columns on the chessboard, the number of the pawn's brothers. Then follow n lines containing each m numbers from 0 to 9 without spaces — the chessboard's description. Each square is described by one number — the number of peas in it. The first line corresponds to the uppermost row and the last line — to the lowest row.

Output

If it is impossible to reach the highest row having collected the number of peas divisible by k + 1, print -1. 

Otherwise, the first line must contain a single number — the maximal number of peas the pawn can collect given that the number must be divisible by k + 1. The second line must contain a single number — the number of the square's column in the lowest row, from which the pawn must start its journey. The columns are numbered from the left to the right with integral numbers starting from 1. The third line must contain a line consisting of n - 1 symbols — the description of the pawn's moves. If the pawn must move upwards and leftwards, print L, if it must move upwards and rightwards, print R. If there are several solutions to that problem, print any of them.

Examples

Input

3 3 1
123
456
789


Output

16
2
RL


Input

3 3 0
123
456
789


Output

17
3
LR


Input

2 2 10
98
75


Output

-1
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.Arrays;
import java.util.Stack;
import java.util.StringTokenizer;

public class _41D {

  static int n, m, k;
  static int[][] a;
  static int[][][] f;
  static char[][][] dir;

  public static void main(String[] args) throws Exception {
    Reader.init(System.in);
    BufferedWriter cout = new BufferedWriter(new OutputStreamWriter(System.out));

    n = Reader.nextInt();
    m = Reader.nextInt();
    k = Reader.nextInt();
    a = new int[n][m];
    for (int i = 0; i < n; i++) {
      char[] str = Reader.next().toCharArray();
      for (int j = 0; j < m; j++)
        a[i][j] = str[j] - '0';
    }

    f = new int[n][m][k + 1];
    dir = new char[n][m][k + 1];
    for (int i = 0; i < n; i++)
      for (int j = 0; j < m; j++)
        Arrays.fill(f[i][j], -1);

    for (int j = 0; j < m; j++) {
      int val = a[n - 1][j];
      f[n - 1][j][val % (k + 1)] = val;
    }

    for (int i = n - 1; i > 0; i--)
      for (int j = 0; j < m; j++)
        for (int r = 0; r < k + 1; r++) {
          if (f[i][j][r] == -1)
            continue;
          if (j - 1 >= 0) {
            int newR = (a[i - 1][j - 1] + r) % (k + 1);
            if (f[i - 1][j - 1][newR] == -1 || f[i - 1][j - 1][newR] < a[i - 1][j - 1] + f[i][j][r]) {
              f[i - 1][j - 1][newR] = a[i - 1][j - 1] + f[i][j][r];
              dir[i - 1][j - 1][newR] = 'L';
            }
          }
          if (j + 1 < m) {
            int newR = (a[i - 1][j + 1] + r) % (k + 1);
            if (f[i - 1][j + 1][newR] == -1 || f[i - 1][j + 1][newR] < a[i - 1][j + 1] + f[i][j][r]) {
              f[i - 1][j + 1][newR] = a[i - 1][j + 1] + f[i][j][r];
              dir[i - 1][j + 1][newR] = 'R';
            }
          }
        }

    int i = 0, j = 0, r = 0;
    int max = -1;
    for (int jj = 0; jj < m; jj++)
      if (f[0][jj][0] > max) {
        max = f[0][jj][0];
        j = jj;
      }
    System.out.println(max);
    if (max > -1) {
      Stack<Character> stack = new Stack<Character>();
      while (i < n - 1) {
        stack.push(dir[i][j][r]);
        int newR = (r - a[i][j] % (k + 1) + (k + 1)) % (k + 1);
        if (dir[i][j][r] == 'L')
          j++;
        else
          j--;
        i++;
        r = newR;
      }
      System.out.println(j + 1);
      while (!stack.isEmpty())
        System.out.print(stack.pop());
    }

    cout.close();
  }

  static class Pair<U extends Comparable<U>, V extends Comparable<V>> implements Comparable<Pair<U, V>> {
    final U _1;
    final V _2;

    private Pair(U key, V val) {
      this._1 = key;
      this._2 = val;
    }

    public static <U extends Comparable<U>, V extends Comparable<V>> Pair<U, V> instanceOf(U _1, V _2) {
      return new Pair<U, V>(_1, _2);
    }

    @Override
    public String toString() {
      return _1 + " " + _2;
    }

    @Override
    public int hashCode() {
      int res = 17;
      res = res * 31 + _1.hashCode();
      res = res * 31 + _2.hashCode();
      return res;
    }

    @Override
    public int compareTo(Pair<U, V> that) {
      int res = this._1.compareTo(that._1);
      if (res < 0 || res > 0)
        return res;
      else
        return this._2.compareTo(that._2);
    }

    @Override
    public boolean equals(Object obj) {
      if (this == obj)
        return true;
      if (!(obj instanceof Pair))
        return false;
      Pair<?, ?> that = (Pair<?, ?>) obj;
      return _1.equals(that._1) && _2.equals(that._2);
    }
  }

  /** Class for buffered reading int and double values */
  static class Reader {
    static BufferedReader reader;
    static StringTokenizer tokenizer;

    /** call this method to initialize reader for InputStream */
    static void init(InputStream input) {
      reader = new BufferedReader(new InputStreamReader(input));
      tokenizer = new StringTokenizer("");
    }

    /** get next word */
    static String next() throws IOException {
      while (!tokenizer.hasMoreTokens()) {
        // TODO add check for eof if necessary
        tokenizer = new StringTokenizer(reader.readLine());
      }
      return tokenizer.nextToken();
    }

    static int nextInt() throws IOException {
      return Integer.parseInt(next());
    }

    static double nextDouble() throws IOException {
      return Double.parseDouble(next());
    }
  }

  static class ArrayUtil {
    static void swap(int[] a, int i, int j) {
      int tmp = a[i];
      a[i] = a[j];
      a[j] = tmp;
    }

    static void swap(long[] a, int i, int j) {
      long tmp = a[i];
      a[i] = a[j];
      a[j] = tmp;
    }

    static void swap(double[] a, int i, int j) {
      double tmp = a[i];
      a[i] = a[j];
      a[j] = tmp;
    }

    static void swap(char[] a, int i, int j) {
      char tmp = a[i];
      a[i] = a[j];
      a[j] = tmp;
    }

    static void swap(boolean[] a, int i, int j) {
      boolean tmp = a[i];
      a[i] = a[j];
      a[j] = tmp;
    }

    static void reverse(int[] a, int i, int j) {
      for (; i < j; i++, j--)
        swap(a, i, j);
    }

    static void reverse(long[] a, int i, int j) {
      for (; i < j; i++, j--)
        swap(a, i, j);
    }

    static void reverse(double[] a, int i, int j) {
      for (; i < j; i++, j--)
        swap(a, i, j);
    }

    static void reverse(char[] a, int i, int j) {
      for (; i < j; i++, j--)
        swap(a, i, j);
    }

    static void reverse(boolean[] a, int i, int j) {
      for (; i < j; i++, j--)
        swap(a, i, j);
    }

    static long sum(int[] a) {
      int sum = 0;
      for (int i : a)
        sum += i;
      return sum;
    }

    static long sum(long[] a) {
      long sum = 0;
      for (long i : a)
        sum += i;
      return sum;
    }

    static double sum(double[] a) {
      double sum = 0;
      for (double i : a)
        sum += i;
      return sum;
    }

    static int max(int[] a) {
      int max = Integer.MIN_VALUE;
      for (int i : a)
        if (i > max)
          max = i;
      return max;
    }

    static int min(int[] a) {
      int min = Integer.MAX_VALUE;
      for (int i : a)
        if (i < min)
          min = i;
      return min;
    }

    static long max(long[] a) {
      long max = Long.MIN_VALUE;
      for (long i : a)
        if (i > max)
          max = i;
      return max;
    }

    static long min(long[] a) {
      long min = Long.MAX_VALUE;
      for (long i : a)
        if (i < min)
          min = i;
      return min;
    }
  }
}
