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 cm(int &x, int v) { x = max(x, v); }
int n, lmx, tot = 1, rt = 1, ch[16012][10], su[16012][802], fa[16012];
char sl[802], sr[802];
void Ins(char *s, int v) {
  int i, j, len = strlen(s + 1), p = rt, x;
  for (i = 1; i <= len; i++) {
    x = s[i] ^ 48;
    for (j = 0; j <= x; j++)
      if (!ch[p][j]) ch[p][j] = ++tot;
    for (j = 0; j < x; j++)
      if ((j > 0) || (i > 1)) su[ch[p][j]][len - i] += v;
    p = ch[p][x];
  }
  if (v > 0) su[p][0] += v;
  for (i = 1; i < 10; i++) {
    if (!ch[rt][i]) ch[rt][i] = ++tot;
    p = ch[rt][i];
    for (j = 1; j < len; j++) su[p][j - 1] += v;
  }
  lmx = max(lmx, len);
}
queue<int> q;
void bu() {
  int i, j, x, y;
  for (i = 0; i < 10; i++)
    if (!ch[rt][i])
      ch[rt][i] = rt;
    else {
      q.push(y = ch[rt][i]);
      fa[y] = rt;
    }
  while (!q.empty()) {
    x = q.front();
    q.pop();
    for (i = 0; i < 10; i++)
      if (y = ch[x][i]) {
        fa[y] = ch[fa[x]][i];
        q.push(y);
      } else
        ch[x][i] = ch[fa[x]][i];
  }
  for (i = 2; i <= tot; i++)
    for (j = 0; j <= lmx; j++) su[i][j] += su[fa[i]][j];
  for (i = 1; i <= tot; i++)
    for (j = 1; j <= lmx; j++) su[i][j] += su[i][j - 1];
}
int f[2012][16012], ans;
int main() {
  scanf("%s%s%d", sl + 1, sr + 1, &n);
  Ins(sr, 1);
  Ins(sl, -1);
  bu();
  int i, j, k, x, p;
  for (i = n - 1; i >= 0; i--)
    for (j = 1; j <= tot; j++)
      for (k = 0; k < 10; k++)
        x = ch[j][k], cm(f[i][j], f[i + 1][x] + su[x][min(lmx, n - i - 1)]);
  printf("%d\n", ans = f[0][1]);
  p = 1;
  for (i = 0; i < n; i++)
    for (k = 0; k < 10; k++) {
      x = ch[p][k];
      if ((f[i + 1][x] + su[x][min(lmx, n - i - 1)]) == ans) {
        printf("%d", k);
        ans = f[i + 1][p = x];
        break;
      }
    }
  return 0;
}