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.
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.
import os
import sys
from io import BytesIO, IOBase
from types import GeneratorType
from collections import defaultdict
BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")

sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")


n,m,k=map(int,input().split())
k=k+1
b=[]
for i in range(n):
    s=input()
    c=[]
    for j in s:
        c.append(int(j))
    b.append(c)
dp=[[[False for h in range(910)] for j in range(m+1)] for i in range(n)]
for j in range(m):
    dp[n-1][j][b[n-1][j]]=True

i=n-1
while(i>=1):
    for j in range(m):
        for h in range(901):
            if dp[i][j][h]:
                if j==(m-1):
                    dp[i - 1][j - 1][h + b[i - 1][j - 1]] = True

                elif j==0:
                    dp[i - 1][j + 1][h + b[i - 1][j + 1]]=True
                else:
                    dp[i - 1][j + 1][h + b[i - 1][j + 1]] = True
                    dp[i - 1][j - 1][h + b[i - 1][j - 1]] = True





    i+=-1

poss=-1
curr=900
while(curr>=0):
    if (curr)%k==0:

        for j in range(m):
            if dp[0][j][curr]:
                poss=j
                break
    if (poss)!=-1:
        break
    curr+=-1

if poss==-1:
    print(-1)
else:
    print(curr)
    ans=[]
    i=0
    while(i<(n-1)):

        curr -= b[i][poss]
        if dp[i+1][poss+1][curr]:
            ans.append("L")

            poss+=1
        else:
            ans.append("R")

            poss-=1


        i+=1
    print(poss+1)
    ans.reverse()
    print("".join(ans))











