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 N = 16100;
int n, m;
int ne[N][10], fail[N], cnt, h[N][2003];
inline int get_next(int x, int k) {
  if (!ne[x][k]) ne[x][k] = ++cnt;
  return ne[x][k];
}
queue<int> q;
void getfail() {
  for (int i = (0), end_i = (9); i <= end_i; i++)
    if (ne[0][i]) q.push(ne[0][i]);
  for (int u; !q.empty();) {
    u = q.front();
    q.pop();
    for (int i = (0), end_i = (m); i <= end_i; i++) h[u][i] += h[fail[u]][i];
    for (int i = (0), end_i = (9); i <= end_i; i++) {
      int v = ne[u][i];
      if (!v)
        ne[u][i] = ne[fail[u]][i];
      else
        fail[v] = ne[fail[u]][i], q.push(v);
    }
  }
}
int init() {
  int n1, n2;
  static char s1[805], s2[805];
  scanf("%s%s", s1, s2);
  n1 = strlen(s1);
  n2 = strlen(s2);
  int u1 = 0, u2 = 0;
  if (n1 == n2) {
    for (int i = (0), end_i = (n1); i < end_i; i++) {
      if (u1 == u2) {
        for (int j = (s1[i] - '0' + 1), end_i = (s2[i] - '0' - 1); j <= end_i;
             j++)
          h[get_next(u1, j)][n1 - i - 1]++;
      } else {
        for (int j = (s1[i] - '0' + 1), end_i = (9); j <= end_i; j++)
          h[get_next(u1, j)][n1 - i - 1]++;
        for (int j = ((!i) ? 1 : 0), end_i = (s2[i] - '0' - 1); j <= end_i; j++)
          h[get_next(u2, j)][n2 - i - 1]++;
      }
      u1 = get_next(u1, s1[i] - '0');
      u2 = get_next(u2, s2[i] - '0');
    }
    h[u1][0]++;
    if (u1 ^ u2) h[u2][0]++;
  } else {
    for (int i = (0), end_i = (n1); i < end_i; i++) {
      for (int j = (s1[i] - '0' + 1), end_i = (9); j <= end_i; j++)
        h[get_next(u1, j)][n1 - i - 1]++;
      u1 = get_next(u1, s1[i] - '0');
    }
    for (int i = (0), end_i = (n2); i < end_i; i++) {
      for (int j = ((!i) ? 1 : 0), end_i = (s2[i] - '0' - 1); j <= end_i; j++)
        h[get_next(u2, j)][n2 - i - 1]++;
      u2 = get_next(u2, s2[i] - '0');
    }
    h[u1][0]++;
    h[u2][0]++;
    for (int i = (n1 + 1), end_i = (n2 - 1); i <= end_i; i++)
      for (int j = (1), end_i = (9); j <= end_i; j++)
        h[get_next(0, j)][i - 1]++;
  }
  return n2 - 1;
}
int f[2005][N];
bool vis[2005][N];
void solve() {
  getfail();
  scanf("%d", &n);
  for (int i = (0), end_i = (cnt); i <= end_i; i++)
    for (int j = (1), end_i = (n); j <= end_i; j++) h[i][j] += h[i][j - 1];
  memset(f, 128, sizeof(f));
  f[0][0] = 0;
  for (int i = (1), end_i = (n); i <= end_i; i++)
    for (int j = (0), end_i = (cnt); j <= end_i; j++)
      if (f[i - 1][j] >= 0)
        for (int k = (0), end_i = (9); k <= end_i; k++)
          f[i][ne[j][k]] =
              max(f[i][ne[j][k]], f[i - 1][j] + h[ne[j][k]][n - i]);
  int mx = 0;
  for (int i = (0), end_i = (cnt); i <= end_i; i++) mx = max(mx, f[n][i]);
  printf("%d\n", mx);
  for (int i = (0), end_i = (cnt); i <= end_i; i++)
    if (f[n][i] == mx) vis[n][i] = 1;
  for (int i = (n - 1), end_i = (0); i >= end_i; i--)
    for (int j = (0), end_i = (cnt); j <= end_i; j++)
      if (f[i][j] >= 0)
        for (int k = (0), end_i = (9); k <= end_i; k++)
          if (vis[i + 1][ne[j][k]] &&
              f[i][j] + h[ne[j][k]][n - i - 1] == f[i + 1][ne[j][k]])
            vis[i][j] = 1;
  int u = 0;
  for (int i = (1), end_i = (n); i <= end_i; i++)
    for (int k = (0), end_i = (9); k <= end_i; k++)
      if (vis[i][ne[u][k]] &&
          f[i - 1][u] + h[ne[u][k]][n - i] == f[i][ne[u][k]]) {
        putchar(k ^ 48);
        u = ne[u][k];
        break;
      }
}
int main() {
  m = init();
  solve();
  return 0;
}