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;
inline void MAX(int &a, int b) {
  if (b > a) a = b;
}
int n;
char L[2010], R[2010];
int llen, rlen;
inline void init_L() {
  int ptr = llen;
  while (L[ptr] == '0') L[ptr] = '9', --ptr;
  --L[ptr];
  if (ptr == 1 && L[ptr] == '0') {
    --llen;
    for (int i = 1; i <= llen; ++i) L[i] = L[i + 1];
    L[llen + 1] = 0;
  }
}
int trie[2010][11], fail[2010], ttot;
inline void ins(char *s, int len) {
  int p = 0;
  for (int i = 1; i <= len; ++i) {
    int c = s[i] - '0';
    if (!trie[p][c]) trie[p][c] = ++ttot;
    p = trie[p][c];
  }
}
int dep[2010];
int que[2010 * 30], front, rear;
inline void build_acam() {
  for (int i = 0; i < 10; ++i)
    if (trie[0][i]) que[++rear] = trie[0][i];
  while (front < rear) {
    int p = que[++front];
    dep[p] = dep[fail[p]] + 1;
    for (int c = 0; c < 10; ++c) {
      if (!trie[p][c])
        trie[p][c] = trie[fail[p]][c];
      else
        fail[trie[p][c]] = trie[fail[p]][c], que[++rear] = trie[p][c];
    }
  }
}
int sum[2010][11][2010];
inline void push_tag(char *s, int len, int v) {
  int p = 0;
  for (int i = 1; i <= len; ++i) {
    int c = s[i] - '0';
    for (int cc = p == 0; cc < c; ++cc) sum[p][cc][len - i + 1] += v;
    if (i == len) sum[p][c][1] += v;
    p = trie[p][c];
  }
}
int id[2010];
bool cmp(const int x, const int y) { return dep[x] < dep[y]; }
inline void push_down_and_init() {
  for (int i = 1; i <= ttot; ++i) id[i] = i;
  sort(id + 1, id + 1 + ttot, cmp);
  for (int i = 1; i <= ttot; ++i) {
    int p = id[i];
    for (int c = 0; c < 10; ++c)
      for (int l = 1; l <= n; ++l) sum[p][c][l] += sum[fail[p]][c][l];
  }
  for (int p = 0; p <= ttot; ++p) {
    for (int c = 1; c < 10; ++c) {
      for (int l = 1; l < llen; ++l) --sum[p][c][l];
      for (int l = 1; l < rlen; ++l) ++sum[p][c][l];
    }
  }
  for (int p = 0; p <= ttot; ++p)
    for (int c = 0; c < 10; ++c)
      for (int l = 1; l <= n; ++l) sum[p][c][l] += sum[p][c][l - 1];
}
int f[2010][2010];
inline void DP() {
  memset(f, 0xc0, sizeof(f));
  for (int p = 0; p <= ttot; ++p) f[p][n] = 0;
  for (int i = n - 1; ~i; --i) {
    for (int p = 0; p <= ttot; ++p) {
      for (int c = 0; c < 10; ++c) {
        MAX(f[p][i], f[trie[p][c]][i + 1] + sum[p][c][n - i]);
      }
    }
  }
  printf("%d\n", f[0][0]);
  int p = 0;
  for (int i = 0; i < n; ++i) {
    int ch = 0;
    for (int c = 0; c < 10; ++c) {
      int q = trie[p][c];
      if (f[p][i] == f[q][i + 1] + sum[p][c][n - i]) {
        ch = c;
        break;
      }
    }
    putchar(ch ^ 48);
    p = trie[p][ch];
  }
  puts("");
}
int main() {
  scanf("%s", L + 1), scanf("%s", R + 1);
  scanf("%d", &n);
  llen = strlen(L + 1), rlen = strlen(R + 1);
  init_L();
  ins(L, llen), ins(R, rlen);
  build_acam();
  push_tag(L, llen, -1), push_tag(R, rlen, 1);
  push_down_and_init();
  DP();
  return 0;
}