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 CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const int Max_N(2050);
const int Max_n(805);
const int Max_size(805 * 10 * 2);
int Len, N, L[Max_n], R[Max_n], LCP, Sum[Max_size][Max_n];
void input(int V[Max_n]) {
  char inp[Max_n];
  scanf("%s", inp + 1);
  int len = strlen(inp + 1);
  for (int i = 1; i <= len; ++i) V[len - i + 1] = inp[i] - '0';
  Len = max(Len, len);
}
int size, ch[Max_size][10], Fail[Max_size];
void insertL(int u) {
  for (int i = LCP - 1, c, flag = (LCP <= Len); i >= 1; --i) {
    c = L[i];
    if (flag || c) {
      if (!ch[u][c]) ch[u][c] = ++size;
      u = ch[u][c];
      flag = 1;
    }
    if (i == 1)
      ++Sum[u][0];
    else
      for (c = L[i - 1] + 1; c <= 9; ++c) {
        if (!ch[u][c]) ch[u][c] = ++size;
        ++Sum[ch[u][c]][i - 2];
      }
  }
}
void insertR(int u) {
  for (int i = LCP - 1, c; i >= 1; --i) {
    c = R[i];
    if (!ch[u][c]) ch[u][c] = ++size;
    u = ch[u][c];
    if (i == 1)
      ++Sum[u][0];
    else
      for (c = 0; c <= R[i - 1] - 1; ++c) {
        if (!ch[u][c]) ch[u][c] = ++size;
        ++Sum[ch[u][c]][i - 2];
      }
  }
}
void buildFail() {
  int r, u, v;
  queue<int> Q;
  for (int c = 0; c <= 9; ++c)
    if (u = ch[0][c]) Q.push(u), Fail[u] = 0;
  while (Q.empty() == false) {
    r = Q.front(), Q.pop();
    for (int c = 0; c <= 9; ++c)
      if (u = ch[r][c]) {
        v = Fail[r];
        while (v && !ch[v][c]) v = Fail[v];
        Fail[u] = ch[v][c], Q.push(u);
        for (int i = 0; i <= Len; ++i) Sum[u][i] += Sum[Fail[u]][i];
      } else
        ch[r][c] = ch[Fail[r]][c];
  }
}
void insert() {
  int u = 0;
  for (int i = Len, c; i >= LCP; --i) {
    c = L[i];
    if (!ch[u][c]) ch[u][c] = ++size;
    u = ch[u][c];
  }
  if (LCP == 1) {
    ++Sum[u][0];
    goto loop;
  }
  for (int c = L[LCP - 1] + 1; c <= R[LCP - 1] - 1; ++c) {
    if (!ch[u][c]) ch[u][c] = ++size;
    ++Sum[ch[u][c]][LCP - 2];
  }
  insertL(u), insertR(u);
loop:
  for (int u = 1; u <= size; ++u)
    for (int i = 1; i <= Len; ++i) Sum[u][i] += Sum[u][i - 1];
  buildFail();
}
int F[Max_N][Max_size];
void dp() {
  for (int u = 0; u <= size; ++u) F[N][u] = Sum[u][0];
  for (int i = N - 1; i >= 0; --i)
    for (int u = 0, v; u <= size; ++u) {
      F[i][u] = -0X3F3F3F3F;
      for (int c = 0; c <= 9; ++c)
        F[i][u] = max(F[i][u], F[i + 1][ch[u][c]] + Sum[u][min(N - i, Len)]);
    }
  printf("%d\n", F[0][0]);
  for (int i = 0, u = 0; i <= N - 1; ++i)
    for (int c = 0; c <= 9; ++c)
      if (F[i][u] == F[i + 1][ch[u][c]] + Sum[u][min(N - i, Len)]) {
        printf("%d", c), u = ch[u][c];
        break;
      }
}
int main() {
  input(L), input(R), scanf("%d", &N);
  for (LCP = Len; LCP >= 0; --LCP)
    if (LCP == 0 || L[LCP] != R[LCP]) {
      ++LCP;
      break;
    }
  insert();
  dp();
  return 0;
}