func_code_string: #include <bits/stdc++.h>   using namespace std;   int dp[141][141][12];   int peas[141][141];   char track[141][141][12];   int main() {     int n, m, k;     cin >> n >> m >> k;     string str;     for (int i = 0; i < 141; i++)       for (int j = 0; j < 141; j++)         for (int p = 0; p < 12; p++) dp[i][j][p] = -111111111;     for (int i = 0; i < n; i++) {       cin >> str;       for (int j = 0; j < m; j++) {         peas[n - i][j + 1] = str[j] -  0 ;       }     }     for (int j = 1; j <= m; j++) dp[1][j][peas[1][j] % (k + 1)] = peas[1][j];     for (int i = 2; i <= n; i++)       for (int j = 1; j <= m; j++)         for (int r = 0; r < k + 1; r++) {           int pr = (r - peas[i][j] + 1000 * k + 1000) % (k + 1);           dp[i][j][r] =               max(dp[i - 1][j - 1][pr], dp[i - 1][j + 1][pr]) + peas[i][j];           track[i][j][r] =               (dp[i - 1][j - 1][pr] > dp[i - 1][j + 1][pr]) ?  R  :  L ;         }     int sol = -1, idx = 0;     for (int j = 1; j <= m; j++) {       if (sol < dp[n][j][0]) {         sol = dp[n][j][0];         idx = j;       }     }     if (sol < 0) {       cout <<  -1  << endl;       return 0;     }     int starting = 0;     string ans =   ;     int rem = 0;     for (int i = n; i >= 1; i--) {       if (i == 1) break;       if (track[i][idx][rem] ==  R ) {         rem = (rem + 1000 * k + 1000 - peas[i][idx]) % (k + 1);         idx = idx - 1;         ans +=  R ;       } else {         rem = (rem + 1000 * k + 1000 - peas[i][idx]) % (k + 1);         idx = idx + 1;         ans +=  L ;       }     }     cout << sol << endl;     cout << idx << endl;     reverse(ans.begin(), ans.end());     cout << ans << endl;     return 0;   }   