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 <class T>
inline T read() {
  T x = 0, w = 1;
  char c = getchar();
  for (; !isdigit(c); c = getchar())
    if (c == '-') w = -w;
  for (; isdigit(c); c = getchar()) x = x * 10 + c - '0';
  return x * w;
}
template <class T>
inline T read(T& x) {
  return x = read<T>();
}
const int N = 2e3 + 10;
char L[N], R[N];
int tot;
int ch[N][10], fa[N], val[N][10][N];
void insert(char str[], int n) {
  int x = 0;
  for (int i = 1; i <= n; ++i) {
    int c = str[i] - '0';
    if (!ch[x][c]) ch[x][c] = ++tot;
    x = ch[x][c];
  }
}
void build(char str[], int n, int v) {
  int x = 0;
  for (int i = 1; i <= n; ++i) {
    int c = str[i] - '0';
    for (int d = x == 0; d < c; ++d) val[x][d][n - i + 1] += v;
    if (i == n) val[x][c][1] += v;
    x = ch[x][c];
  }
}
int F[N][N];
int main() {
  scanf("%s", L + 1);
  int lenL = strlen(L + 1);
  if (L[lenL] > '0')
    --L[lenL];
  else {
    int p = lenL;
    while (p > 1 and L[p] == '0') --p;
    --L[p], fill(L + p + 1, L + lenL + 1, '9');
  }
  if (L[1] == '0' and lenL > 1) copy(L + 2, L + lenL + 1, L + 1), L[lenL--] = 0;
  if (L[1] > '0') insert(L, lenL);
  scanf("%s", R + 1);
  int lenR = strlen(R + 1);
  insert(R, lenR);
  deque<int> que;
  for (int c = 0; c <= 9; ++c)
    if (ch[0][c]) que.push_back(ch[0][c]);
  while (que.size()) {
    int x = que.front();
    que.pop_front();
    for (int c = 0; c <= 9; ++c) {
      if (!ch[x][c]) {
        ch[x][c] = ch[fa[x]][c];
        continue;
      }
      fa[ch[x][c]] = ch[fa[x]][c], que.push_back(ch[x][c]);
    }
  }
  if (L[1] > '0') build(L, lenL, -1);
  build(R, lenR, 1);
  int n = read<int>();
  for (int x = 1; x <= tot; ++x)
    for (int c = 0; c <= 9; ++c)
      for (int i = 1; i <= n; ++i) val[x][c][i] += val[fa[x]][c][i];
  for (int x = 0; x <= tot; ++x)
    for (int c = 1; c <= 9; ++c)
      for (int i = 1; i < lenL; ++i) val[x][c][i] += -1;
  for (int x = 0; x <= tot; ++x)
    for (int c = 1; c <= 9; ++c)
      for (int i = 1; i < lenR; ++i) val[x][c][i] += 1;
  for (int x = 0; x <= tot; ++x)
    for (int c = 0; c <= 9; ++c)
      for (int i = 1; i <= n; ++i) val[x][c][i] += val[x][c][i - 1];
  for (int i = n - 1; i >= 0; --i)
    for (int x = 0; x <= tot; ++x) {
      F[i][x] = -1e9;
      for (int c = 0; c <= 9; ++c)
        F[i][x] = max(F[i][x], F[i + 1][ch[x][c]] + val[x][c][n - i]);
    }
  printf("%d\n", F[0][0]);
  for (int i = 0, x = 0; i < n; ++i) {
    int c = -1;
    for (int d = 0; d <= 9; ++d)
      if (F[i][x] == F[i + 1][ch[x][d]] + val[x][d][n - i]) {
        c = d;
        break;
      }
    printf("%d", c);
    x = ch[x][c];
  }
  return 0;
}