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;
char L[maxn], R[maxn];
int n, rt = 1, tot = rt, ch[maxn][10], fail[maxn];
int f[maxn][maxn], g[maxn][maxn][10];
void insert(char *s, int len, int v) {
  int nw = rt;
  for (int i = 1; i <= len; i++) {
    int nxt = s[i] - '0';
    if (!ch[nw][nxt]) ch[nw][nxt] = ++tot;
    for (int j = (nw == rt); j < nxt; j++) g[nw][len - i + 1][j] += v;
    if (i == len) g[nw][1][nxt] += v;
    nw = ch[nw][nxt];
  }
}
queue<int> Q;
void getfail() {
  for (int i = 0; i < 10; i++) {
    if (ch[rt][i]) {
      fail[ch[rt][i]] = rt;
      Q.push(ch[rt][i]);
    } else
      ch[rt][i] = rt;
  }
  while (!Q.empty()) {
    int u = Q.front();
    Q.pop();
    for (int i = 0; i < 10; i++) {
      if (ch[u][i]) {
        fail[ch[u][i]] = ch[fail[u]][i];
        Q.push(ch[u][i]);
      } else
        ch[u][i] = ch[fail[u]][i];
    }
  }
}
int main() {
  scanf("%s", L + 1);
  int lenl = strlen(L + 1), nw = lenl;
  while (L[nw] == '0') L[nw] = '9', nw--;
  L[nw]--;
  if (L[1] == '0') {
    lenl--;
    for (int i = 1; i <= lenl; i++) L[i] = L[i + 1];
  }
  if (lenl) insert(L, lenl, -1);
  scanf("%s", R + 1);
  int lenr = strlen(R + 1);
  insert(R, lenr, 1);
  getfail();
  scanf("%d", &n);
  for (int i = 2; i <= tot; i++)
    for (int j = 1; j <= n; j++)
      for (int k = 0; k < 10; k++) g[i][j][k] += g[fail[i]][j][k];
  for (int i = 1; i <= tot; i++)
    for (int j = max(lenl, 1); j < lenr; j++)
      for (int k = 1; k < 10; k++) g[i][j][k]++;
  for (int i = 1; i <= tot; i++)
    for (int j = 1; j <= n; j++)
      for (int k = 0; k < 10; k++) g[i][j][k] += g[i][j - 1][k];
  for (int i = n - 1; i >= 0; i--)
    for (int j = 1; j <= tot; j++) {
      f[i][j] = -0x3f3f3f3f;
      for (int k = 0; k < 10; k++)
        f[i][j] = max(f[i][j], f[i + 1][ch[j][k]] + g[j][n - i][k]);
    }
  printf("%d\n", f[0][rt]);
  nw = rt;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < 10; j++)
      if (f[i][nw] == f[i + 1][ch[nw][j]] + g[nw][n - i][j]) {
        putchar(j + '0');
        nw = ch[nw][j];
        break;
      }
  return 0;
}