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 subestaçõesmodestas;

/**
 *
 * @author Eduardo M
 */
import java.util.Scanner;

public class SubestacoesModestas {
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
    public static void main(String[] args) {
        new SubestacoesModestas().solucao();
    }


    Scanner sc = new Scanner(System.in);
    int l, y, n, cont, tt, aux, cont1,i,j,k;
    char[] vet = new char[810];
    char[] vet1 = new char[810];
    int[] vet2 = new int[21000];
    int[] vet3 = new int[21000];
    int[][] mat = new int[21000][810];
    int[][] mat1 = new int[21000][10];
    int[][] met2 = new int[2100][21000];

    void solucao(){
        String ent= sc.next();
        String ent1 = sc.next();
        l= sc.nextInt();
        y = ent.length();
        n = ent1.length();
        for( i = 0 ; i < y ; i++){
            vet[i] = ent.charAt(i);
        }
        for( i = 0 ; i < n ; i++){
            vet1[i] = ent1.charAt(i);
        }
        cont = ++tt;
        add(vet);
        add(vet1);
        if(y == n){
            int veri = cont, veri1 = cont;
            for( i = 0 ; i < y ; i++){
                if(veri == veri1 && vet[i] != vet1[i]){
                    for(int c = vet[i]+1 ; c < vet1[i] ; c++){
                        if(mat1[veri][c-'0'] == 0){
                            mat1[veri][c-'0'] = ++tt;
                        }
                        mat[mat1[veri][c-'0']][y-i-1]++;
                    }
                }
                else if(veri != veri1){
                    for(int temp = vet[i]+1 ; temp < '0'+10 ; temp++){
                        if(mat1[veri][temp-'0'] == 0){
                            mat1[veri][temp-'0'] = ++tt;
                        }
                        mat[mat1[veri][temp-'0']][y-i-1]++;
                    }
                    for(int temp = '0'+ (i == 0 ? 1 : 0) ; temp < vet1[i] ; temp++){
                        if(mat1[veri1][temp-'0'] == 0){
                            mat1[veri1][temp-'0'] = ++tt;
                        }
                        mat[mat1[veri1][temp-'0']][y-i-1]++;
                    }
                }
                veri = mat1[veri][vet[i]-'0'];
                veri1 = mat1[veri1][vet1[i]-'0'];
            }
            mat[veri][0]++;
            if(veri != veri1){
                mat[veri1][0]++;
            }
        }
        else{
            int veri = cont,veri1 = cont;
            for(i = 0 ; i < y ; i++){
                for(int temp = vet[i]+1 ; temp < '0'+10 ; temp++){
                    if(mat1[veri][temp-'0'] == 0){
                        mat1[veri][temp-'0'] = ++tt;
                    }
                    mat[mat1[veri][temp-'0']][y-i-1]++;
                }
                veri = mat1[veri][vet[i]-'0'];
            }
            for(i = 0 ; i < n ; i++){
                for(int temp = '0'+ (i == 0 ? 1 : 0) ; temp < vet1[i] ; temp++){
                    if(mat1[veri1][temp-'0'] == 0){
                        mat1[veri1][temp-'0'] = ++tt;
                    }
                    mat[mat1[veri1][temp-'0']][n-i-1]++;
                }
                veri1 = mat1[veri1][vet1[i]-'0'];
            }
            mat[veri][0]++;
            mat[veri1][0]++;
            for( i = 1 ; i < 10 ; i++){
                if(mat1[cont][i] == 0){
                    mat1[cont][i] = ++tt;
                }
                for( j = y+1 ; j < n ; j++){
                    mat[mat1[cont][i]][j-1]++;
                }
            }
        }
        resolver();
        for( i = 1 ; i < cont1 ; i++){
             int x = vet2[i];
            for( j = 0 ; j < n ; j++){
                mat[x][j] += mat[vet3[x]][j];
            }
        }
        for( i = 1 ; i <= tt ; i++){
            for( j = 1 ; j < n ; j++){
                mat[i][j] += mat[i][j-1];
            }
        }
        Resultado();
        sc.close();
    }

    void add(char g[]){
        int tempAdd = cont;
        for( i = 0 ; g[i] != 0  ; i++){
            if(mat1[tempAdd][g[i]-'0'] == 0){
                mat1[tempAdd][g[i]-'0'] = ++tt;
            }
            tempAdd = mat1[tempAdd][g[i]-'0'];
        }
    }

    void resolver(){
        aux = cont1 = 0;
        vet2[cont1++] = cont;
        for(; aux < cont1 ; aux++){
            int x = vet2[aux];
            for( i = 0 ; i < 10 ; i++){
                if(mat1[x][i] != 0){
                    if(x == cont){
                        vet3[mat1[x][i]] = x;
                    }
                    else{
                        vet3[mat1[x][i]] = vet3[x];
                        while(vet3[mat1[x][i]] != cont && mat1[vet3[mat1[x][i]]][i] == 0){
                            vet3[mat1[x][i]] = vet3[vet3[mat1[x][i]]];
                        }
                        if(mat1[vet3[mat1[x][i]]][i] != 0){
                            vet3[mat1[x][i]] = mat1[vet3[mat1[x][i]]][i];
                        }
                    }
                    vet2[cont1++] = mat1[x][i];
                }
            }
        }
        for( i = 0 ; i < 10 ; i++){
            if(mat1[cont][i] == 0){
                mat1[cont][i] = cont;
            }
        } 
        for( j = 1 ; j < cont1 ; j++){
            int  x = vet2[j];
            for( i = 0 ; i < 10 ; i++){
                if(mat1[x][i] == 0){
                    mat1[x][i] = mat1[vet3[x]][i];
                }
            }
        }
    }
    
    void Resultado(){
        for(i = 1 ; i <= tt ; i++){
            met2[0][i] = mat[i][0];
        }
        for( i = 1 ; i <= l; i++){
            for( j = 1 ; j <= tt ; j++){
                for( k = 0 ; k < 10 ; k++){
                    met2[i][j] = Math.max(met2[i][j], met2[i-1][mat1[j][k]]);
                }
                met2[i][j] += mat[j][Math.min(i, n-1)];
            }
        }
        System.out.println(met2[l][cont]);
        int TempResu = cont;
        for( i = l; i >= 1 ; i--){
            int val = met2[i][TempResu]-mat[TempResu][Math.min(i, n-1)];
            for(int lext = 0 ; lext < 10 ; lext++){
                if(met2[i-1][mat1[TempResu][lext]]==val){
                    System.out.print(lext);
                    TempResu = mat1[TempResu][lext];
                    break;
                }
            }
        }
    }
}