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;
template <typename T>
inline void read(T &x) {
  x = 0;
  char c = getchar();
  bool flag = false;
  while (!isdigit(c)) {
    if (c == '-') flag = true;
    c = getchar();
  }
  while (isdigit(c)) {
    x = (x << 1) + (x << 3) + (c ^ 48);
    c = getchar();
  }
  if (flag) x = -x;
}
int len1, len2, n, cnt, root, tot;
int ch[2010][10], fail[2010], sum[2010][10][2010], f[2010][2010];
char L[2010], R[2010];
void insert(char *s, int len) {
  if (s[1] == '0') return;
  for (int i = 1, p = root; i <= len; ++i) {
    int c = s[i] - '0';
    if (!ch[p][c]) ch[p][c] = ++tot;
    p = ch[p][c];
  }
}
void build() {
  queue<int> q;
  for (int i = 0; i <= 9; ++i)
    if (ch[root][i]) q.push(ch[root][i]);
  while (!q.empty()) {
    int x = q.front();
    q.pop();
    for (int i = 0; i <= 9; ++i) {
      int y = ch[x][i];
      if (y)
        fail[y] = ch[fail[x]][i], q.push(y);
      else
        ch[x][i] = ch[fail[x]][i];
    }
  }
}
void update(char *s, int len, int v) {
  if (s[1] == '0') return;
  for (int i = 1, p = root; i <= len; ++i) {
    int c = s[i] - '0';
    for (int j = p == root; j < c; ++j) sum[p][j][len - i + 1] += v;
    if (i == len) sum[p][c][1] += v;
    p = ch[p][c];
  }
}
int main() {
  scanf("%s%s", L + 1, R + 1), read(n);
  len1 = cnt = strlen(L + 1), len2 = strlen(R + 1), L[cnt]--;
  while (L[cnt] - '0' == -1) L[cnt] = 9 + '0', L[--cnt]--;
  if (L[1] == '0') {
    len1--;
    for (int i = 1; i <= len1; ++i) L[i] = L[i + 1];
  }
  insert(L, len1), insert(R, len2);
  build(), update(L, len1, -1), update(R, len2, 1);
  for (int p = 1; p <= tot; ++p)
    for (int c = 0; c <= 9; ++c)
      for (int i = 1; i <= n; ++i) sum[p][c][i] += sum[fail[p]][c][i];
  for (int p = root; p <= tot; ++p) {
    for (int c = 1; c <= 9; ++c) {
      for (int i = 1; i < len1; ++i) sum[p][c][i]--;
      for (int i = 1; i < len2; ++i) sum[p][c][i]++;
    }
  }
  for (int p = root; p <= tot; ++p)
    for (int c = 0; c <= 9; ++c)
      for (int i = 1; i <= n; ++i) sum[p][c][i] += sum[p][c][i - 1];
  for (int i = 0; i < n; ++i)
    for (int p = root; p <= tot; ++p) f[p][i] = -2000000000;
  for (int i = n - 1; i >= 0; --i)
    for (int p = root; p <= tot; ++p)
      for (int c = 0; c <= 9; ++c)
        f[p][i] = max(f[p][i], f[ch[p][c]][i + 1] + sum[p][c][n - i]);
  printf("%d\n", f[root][0]);
  for (int i = 0, p = root; i < n; ++i) {
    for (int c = 0; c <= 9; ++c) {
      if (f[p][i] == f[ch[p][c]][i + 1] + sum[p][c][n - i]) {
        printf("%d", c), p = ch[p][c];
        break;
      }
    }
  }
  return 0;
}