Problem: You are given two integers l and r.

Let's call an integer x modest, if l ≤ x ≤ r.

Find a string of length n, consisting of digits, which has the largest possible number of substrings, which make a modest integer. Substring having leading zeros are not counted. If there are many answers, find lexicographically smallest one.

If some number occurs multiple times as a substring, then in the counting of the number of modest substrings it is counted multiple times as well.

Input

The first line contains one integer l (1 ≤ l ≤ 10^{800}).

The second line contains one integer r (l ≤ r ≤ 10^{800}).

The third line contains one integer n (1 ≤ n ≤ 2 000).

Output

In the first line, print the maximum possible number of modest substrings.

In the second line, print a string of length n having exactly that number of modest substrings.

If there are multiple such strings, print the lexicographically smallest of them.

Examples

Input


1
10
3


Output


3
101


Input


1
11
3


Output


5
111


Input


12345
12346
6


Output


1
012345

Note

In the first example, string «101» has modest substrings «1», «10», «1».

In the second example, string «111» has modest substrings «1» (3 times) and «11» (2 times).

Solution (in JAVA):

Solution:
//package globalround1;
import java.util.*;


public class ProblemH {
    public static void main(String[] args) {
        new ProblemH().solve();
    }

    int N = 1111, M=20111;
    Scanner in = new Scanner(System.in);
    char[] l = new char[N];
    char[] r = new char[N];
    int n, nl, nr, rt, tot, fr, rr;
    int[][] go = new int[M][10];
    int[][] wild = new int[M][811];
    int[] q = new int[M];
    int[] fail = new int[M];
    int[][] dp = new int[2111][M];

    void solve() {
        String tl = in.next();
        String tr = in.next();
        n = in.nextInt();
        nl = tl.length();
        nr = tr.length();
        for(int i = 0 ; i < nl ; i++){
            l[i] = tl.charAt(i);
        }
        for(int i = 0 ; i < nr ; i++){
            r[i] = tr.charAt(i);
        }
        rt = ++tot;
        insert(l);
        insert(r);
        if(nl == nr){
            int k1 = rt, k2 = rt;
            for(int i = 0 ; i < nl ; i++){
                if(k1 == k2 && l[i] !=r[i]){
                    for(int c = l[i]+1 ; c < r[i] ; c++){
                        if(go[k1][c-'0'] == 0){
                            go[k1][c-'0'] = ++tot;
                        }
                        wild[go[k1][c-'0']][nl-i-1]++;
                    }
                }
                else if(k1 != k2){
                    for(int c = l[i]+1 ; c < '0'+10 ; c++){
                        if(go[k1][c-'0'] == 0){
                            go[k1][c-'0'] = ++tot;
                        }
                        wild[go[k1][c-'0']][nl-i-1]++;
                    }
                    for(int c = '0'+ (i == 0 ? 1 : 0) ; c < r[i] ; c++){
                        if(go[k2][c-'0'] == 0){
                            go[k2][c-'0'] = ++tot;
                        }
                        wild[go[k2][c-'0']][nl-i-1]++;
                    }
                }
                k1 = go[k1][l[i]-'0'];
                k2 = go[k2][r[i]-'0'];
            }
            wild[k1][0]++;
            if(k1 != k2){
                wild[k2][0]++;
            }
        }
        else{
            int k1 = rt,k2 = rt;
            for(int i = 0 ; i < nl ; i++){
                for(int c = l[i]+1 ; c < '0'+10 ; c++){
                    if(go[k1][c-'0'] == 0){
                        go[k1][c-'0'] = ++tot;
                    }
                    wild[go[k1][c-'0']][nl-i-1]++;
                }
                k1 = go[k1][l[i]-'0'];
            }
            for(int i = 0 ; i < nr ; i++){
                for(int c = '0'+ (i == 0 ? 1 : 0) ; c < r[i] ; c++){
                    if(go[k2][c-'0'] == 0){
                        go[k2][c-'0'] = ++tot;
                    }
                    wild[go[k2][c-'0']][nr-i-1]++;
                }
                k2 = go[k2][r[i]-'0'];
            }
            wild[k1][0]++;
            wild[k2][0]++;
            for(int i = 1 ; i < 10 ; i++){
                if(go[rt][i] == 0){
                    go[rt][i] = ++tot;
                }
                for(int j = nl+1 ; j < nr ; j++){
                    wild[go[rt][i]][j-1]++;
                }
            }
        }
        construct();
        for(int i = 1 ; i < rr ; i++){
            int x = q[i];
            for(int j = 0 ; j < nr ; j++){
                wild[x][j] += wild[fail[x]][j];
            }
        }
        for(int i = 1 ; i <= tot ; i++){
            for(int j = 1 ; j < nr ; j++){
                wild[i][j] += wild[i][j-1];
            }
        }
        DP();
        in.close();
    }

    void insert(char s[]){
        int cur = rt;
        for(int i = 0 ; s[i] != 0  ; i++){
            if(go[cur][s[i]-'0'] == 0){
                go[cur][s[i]-'0'] = ++tot;
            }
            cur = go[cur][s[i]-'0'];
        }
    }

    void construct(){
        fr = rr = 0;
        q[rr++] = rt;
        for(; fr < rr ; fr++){
            int x = q[fr];
            for(int i = 0 ; i < 10 ; i++){
                if(go[x][i] != 0){
                    if(x == rt){
                        fail[go[x][i]] = x;
                    }
                    else{
                        fail[go[x][i]] = fail[x];
                        while(fail[go[x][i]] != rt && go[fail[go[x][i]]][i] == 0){
                            fail[go[x][i]] = fail[fail[go[x][i]]];
                        }
                        if(go[fail[go[x][i]]][i] != 0){
                            fail[go[x][i]] = go[fail[go[x][i]]][i];
                        }
                    }
                    q[rr++] = go[x][i];
                }
            }
        }
        for(int i = 0 ; i < 10 ; i++){
            if(go[rt][i] == 0){
                go[rt][i] = rt;
            }
        } 
        for(int j = 1 ; j < rr ; j++){
            int x = q[j];
            for(int i = 0 ; i < 10 ; i++){
                if(go[x][i] == 0){
                    go[x][i] = go[fail[x]][i];
                }
            }
        }
    }
    
    void DP(){
        for(int i = 1 ; i <= tot ; i++){
            dp[0][i] = wild[i][0];
        }
        for(int i = 1 ; i <= n ; i++){
            for(int j = 1 ; j <= tot ; j++){
                for(int k = 0 ; k < 10 ; k++){
                    dp[i][j] = Math.max(dp[i][j], dp[i-1][go[j][k]]);
                }
                dp[i][j] += wild[j][Math.min(i, nr-1)];
            }
        }
        System.out.println(dp[n][rt]);
        int cur = rt;
        for(int i = n ; i >= 1 ; i--){
            int val = dp[i][cur]-wild[cur][Math.min(i, nr-1)];
            for(int next = 0 ; next < 10 ; next++){
                if(dp[i-1][go[cur][next]]==val){
                    System.out.print(next);
                    cur = go[cur][next];
                    break;
                }
            }
        }
    }
}