Problem: Friday is Polycarpus' favourite day of the week. Not because it is followed by the weekend, but because the lessons on Friday are 2 IT lessons, 2 math lessons and 2 literature lessons. Of course, Polycarpus has prepared to all of them, unlike his buddy Innocentius. Innocentius spent all evening playing his favourite game Fur2 and didn't have enough time to do the literature task. As Innocentius didn't want to get an F, he decided to do the task and read the book called "Storm and Calm" during the IT and Math lessons (he never used to have problems with these subjects). When the IT teacher Mr. Watkins saw this, he decided to give Innocentius another task so that the boy concentrated more on the lesson and less — on the staff that has nothing to do with IT. 

Mr. Watkins said that a palindrome is a string that can be read the same way in either direction, from the left to the right and from the right to the left. A concatenation of strings a, b is a string ab that results from consecutive adding of string b to string a. Of course, Innocentius knew it all but the task was much harder than he could have imagined. Mr. Watkins asked change in the "Storm and Calm" the minimum number of characters so that the text of the book would also be a concatenation of no more than k palindromes. Innocentius can't complete the task and therefore asks you to help him.

Input

The first input line contains a non-empty string s which is the text of "Storm and Calm" (without spaces). The length of the string s does not exceed 500 characters. String s consists of uppercase and lowercase Latin letters. The second line contains a single number k (1 ≤ k ≤ |s|, where |s| represents the length of the string s).

Output

Print on the first line the minimum number of changes that Innocentius will have to make. Print on the second line the string consisting of no more than k palindromes. Each palindrome should be non-empty and consist of uppercase and lowercase Latin letters. Use the character "+" (ASCII-code 43) to separate consecutive palindromes. If there exist several solutions, print any of them.

The letters' case does matter, that is an uppercase letter is not considered equivalent to the corresponding lowercase letter.

Examples

Input

abacaba
1


Output

0
abacaba


Input

abdcaba
2


Output

1
abdcdba


Input

abdcaba
5


Output

0
a+b+d+c+aba


Input

abacababababbcbabcd
3


Output

1
abacaba+babab+bcbabcb

Solution (in JAVA):

Solution:
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;

public class ProblemD {
    public static String _line;
    public static int len;
    
    public static int INVALID = 99999999;

    public static int[][] memo = new int[501][501];
    public static int[][] mxarg = new int[501][501];
    public static int[][] precomp_needs = new int[501][501];
    public static String[][] precomp_pd = new String[501][501];
    
    public static int dfspre(int from, int to) {
        
        
        
        return 0;
    }
    
    public static int dfs(int k, int from) {
        if (k <= -1) {
            return INVALID;
        }
        if (memo[k][from] != -1){
            return memo[k][from];
        }
        
        int min = precomp_needs[from][len];
        mxarg[k][from] = len;
        for (int t = from + 1 ; t < len ; t++) {
            int val = precomp_needs[from][t] + dfs(k-1, t);
            if (val < min) {
                min = val;
                mxarg[k][from] = t;
            }
        }
        
        memo[k][from] = min;
                
        return min;
    }
    
    
    public static void main(String[] args) throws IOException {
        BufferedReader s = new BufferedReader(new InputStreamReader(System.in));
        String line = s.readLine();
        int num = Integer.valueOf(s.readLine());
        _line = line;
        
        len = line.length();
        
        for (int i = 0 ; i <= 500 ; i++) {
            for (int j = 0 ; j <= 500 ; j++) {
                memo[i][j] = -1;
                precomp_needs[i][j] = -1;
            }           
        }
        
        
        for (int from = 0 ; from < len ; from++) {
            for (int to = from ; to <= Math.min(len, from+1) ; to++) {
                precomp_needs[from][to] = 0;
                precomp_pd[from][to] = line.substring(from, to);
                int left = from;
                int right = to-1;
                while(true) {
                    int nl = left - 1;
                    int nr = right + 1;
                    if (nl < 0 || nr >= len) {
                        break;
                    }

                    char nc = line.charAt(nl);
                    precomp_needs[nl][nr+1] = precomp_needs[left][right+1];
                    if (line.charAt(nl) != line.charAt(nr)) {
                        precomp_needs[nl][nr+1] += 1; 
                    }
                    precomp_pd[nl][nr+1] = nc + precomp_pd[left][right+1] + nc;
                    left = nl;
                    right = nr;
                }
            }
        }
        

        int x = dfs(num-1, 0);
        System.out.println(x);
        
        int f = 0;
        String ans = "";
        int k = num-1;
        while (f < len && k >= 0) {
            int t = mxarg[k][f];  
            ans = ans + "+" + precomp_pd[f][t];
            f = t;
            k--;
        }
        
        System.out.println(ans.substring(1));

    }
}