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 maxn = 2005;
const int maxnode = 16005;
const int inf = 0x3f3f3f3f;
int n, ch[maxnode][10], fa[maxnode], g[maxnode][maxn], f[maxn][maxnode], sz;
char a[maxn], b[maxn], ok[maxn][maxnode];
inline int son(int i, int j) {
  if (!ch[i][j]) ch[i][j] = ++sz;
  return ch[i][j];
}
inline void buildtrie() {
  int la = strlen(a + 1), lb = strlen(b + 1), u = 0, v = 0, l = 0, r = 0;
  if (la == lb) {
    for (int i = 1; i <= la; i++) {
      l = a[i] - '0', r = b[i] - '0';
      if (u == v) {
        for (int j = l + 1; j < r; j++) g[son(u, j)][la - i]++;
      } else {
        for (int j = l + 1; j <= 9; j++) g[son(u, j)][la - i]++;
        for (int j = (i == 1) ? 1 : 0; j < r; j++) g[son(v, j)][lb - i]++;
      }
      u = son(u, l), v = son(v, r);
    }
    g[u][0]++;
    if (u != v) g[v][0]++;
  } else {
    for (int i = 1; i <= la; i++) {
      l = a[i] - '0';
      for (int j = l + 1; j <= 9; j++) g[son(u, j)][la - i]++;
      u = son(u, l);
    }
    for (int i = 1; i <= lb; i++) {
      r = b[i] - '0';
      for (int j = (i == 1) ? 1 : 0; j < r; j++) g[son(v, j)][lb - i]++;
      v = son(v, r);
    }
    g[u][0]++, g[v][0]++;
    for (int i = la + 1; i < lb; i++)
      for (int j = 1; j <= 9; j++) g[son(0, j)][i - 1]++;
  }
}
inline void buildac() {
  queue<int> q;
  for (int c = 0; c < 10; c++)
    if (ch[0][c]) q.push(ch[0][c]);
  while (!q.empty()) {
    int p = q.front();
    q.pop();
    for (int c = 0; c < 10; c++) {
      if (ch[p][c])
        fa[ch[p][c]] = ch[fa[p]][c], q.push(ch[p][c]);
      else
        ch[p][c] = ch[fa[p]][c];
    }
    for (int i = 0; i <= n; i++) g[p][i] += g[fa[p]][i];
  }
}
int main() {
  scanf("%s%s%d", a + 1, b + 1, &n);
  buildtrie(), buildac();
  for (int i = 1; i <= sz; i++)
    for (int j = 1; j <= n; j++) g[i][j] += g[i][j - 1];
  memset(f, -inf, sizeof(f));
  f[0][0] = 0;
  for (int i = 0; i < n; i++)
    for (int j = 0; j <= sz; j++)
      if (f[i][j] >= 0)
        for (int k = 0; k < 10; k++)
          f[i + 1][ch[j][k]] =
              max(f[i + 1][ch[j][k]], f[i][j] + g[ch[j][k]][n - i - 1]);
  int ans = 0;
  for (int i = 0; i <= sz; i++) ans = max(ans, f[n][i]);
  printf("%d\n", ans);
  for (int i = 0; i <= sz; i++)
    if (f[n][i] == ans) ok[n][i] = 1;
  for (int i = n - 1; i >= 0; i--)
    for (int j = 0; j <= sz; j++)
      if (f[i][j] >= 0)
        for (int k = 0; k < 10; k++)
          ok[i][j] |= (f[i + 1][ch[j][k]] == f[i][j] + g[ch[j][k]][n - i - 1])
                          ? ok[i + 1][ch[j][k]]
                          : 0;
  for (int i = 0, j = 0; i < n; i++)
    for (int k = 0; k < 10; k++)
      if (ok[i + 1][ch[j][k]] &&
          f[i + 1][ch[j][k]] == f[i][j] + g[ch[j][k]][n - i - 1]) {
        putchar(k + '0'), j = ch[j][k];
        break;
      }
  putchar('\n');
  return 0;
}