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 inf = 0x3f3f3f3f;
const long long Linf = 1ll << 61;
const double pi = acos(-1.0);
const int maxn = 20111;
const int N = 10;
int go[maxn][10], tot, rt;
int q[maxn], fr, rr, fail[maxn], n, m, l;
int wild[maxn][811];
void construct() {
  fr = rr = 0;
  q[rr++] = rt;
  for (; fr < rr; fr++) {
    int x = q[fr];
    for (int i = 0; i < N; i++)
      if (go[x][i]) {
        int& f = fail[go[x][i]];
        if (x == rt)
          f = x;
        else {
          f = fail[x];
          while (f != rt && !go[f][i]) f = fail[f];
          if (go[f][i]) f = go[f][i];
        }
        q[rr++] = go[x][i];
      }
  }
  for (int i = 0; i < N; i++)
    if (!go[rt][i]) go[rt][i] = rt;
  for (int _ = 1; _ < rr; _++) {
    int x = q[_];
    for (int i = 0; i < N; i++)
      if (!go[x][i]) go[x][i] = go[fail[x]][i];
  }
}
void insert(char* s) {
  int cur = rt;
  for (int i = 0; s[i]; i++) {
    if (!go[cur][s[i] - '0']) go[cur][s[i] - '0'] = ++tot;
    cur = go[cur][s[i] - '0'];
  }
}
char s[1111], t[1111];
int dp[2111][maxn];
void do_dp() {
  for (int i = 1; i <= tot; i++) dp[0][i] = wild[i][0];
  for (int i = 1; i <= l; i++) {
    for (int j = 1; j <= tot; j++) {
      for (int k = 0; k < N; k++) dp[i][j] = max(dp[i][j], dp[i - 1][go[j][k]]);
      dp[i][j] += wild[j][min(i, m - 1)];
    }
  }
  printf("%d\n", dp[l][rt]);
  int cur = rt;
  for (int i = l; i >= 1; i--) {
    int val = dp[i][cur] - wild[cur][min(i, m - 1)];
    for (int nxt = 0; nxt < N; nxt++)
      if (dp[i - 1][go[cur][nxt]] == val) {
        putchar(nxt + '0');
        cur = go[cur][nxt];
        break;
      }
  }
  puts("");
}
int main() {
  scanf("%s%s%d", s, t, &l);
  n = strlen(s);
  m = strlen(t);
  rt = ++tot;
  insert(s);
  insert(t);
  if (n == m) {
    int k1 = rt, k2 = rt;
    for (int i = 0; i < n; i++) {
      if (k1 == k2 && s[i] != t[i]) {
        for (int c = s[i] + 1; c < t[i]; c++) {
          if (!go[k1][c - '0']) go[k1][c - '0'] = ++tot;
          wild[go[k1][c - '0']][n - i - 1]++;
        }
      } else if (k1 != k2) {
        for (int c = s[i] + 1; c < '0' + N; c++) {
          if (!go[k1][c - '0']) go[k1][c - '0'] = ++tot;
          wild[go[k1][c - '0']][n - i - 1]++;
        }
        for (int c = '0' + (i == 0); c < t[i]; c++) {
          if (!go[k2][c - '0']) go[k2][c - '0'] = ++tot;
          wild[go[k2][c - '0']][n - i - 1]++;
        }
      }
      k1 = go[k1][s[i] - '0'];
      k2 = go[k2][t[i] - '0'];
    }
    wild[k1][0]++;
    if (k1 != k2) wild[k2][0]++;
  } else {
    int k1 = rt, k2 = rt;
    for (int i = 0; i < n; i++) {
      for (int c = s[i] + 1; c < '0' + N; c++) {
        if (!go[k1][c - '0']) go[k1][c - '0'] = ++tot;
        wild[go[k1][c - '0']][n - i - 1]++;
      }
      k1 = go[k1][s[i] - '0'];
    }
    for (int i = 0; i < m; i++) {
      for (int c = '0' + (i == 0); c < t[i]; c++) {
        if (!go[k2][c - '0']) go[k2][c - '0'] = ++tot;
        wild[go[k2][c - '0']][m - i - 1]++;
      }
      k2 = go[k2][t[i] - '0'];
    }
    wild[k1][0]++;
    wild[k2][0]++;
    for (int i = 1; i < N; i++) {
      int& k = go[rt][i];
      if (!k) k = ++tot;
      for (int j = n + 1; j < m; j++) {
        wild[k][j - 1]++;
      }
    }
  }
  construct();
  for (int i = 1; i < rr; i++) {
    int x = q[i];
    for (int j = 0; j < m; j++) wild[x][j] += wild[fail[x]][j];
  }
  for (int i = 1; i <= tot; i++)
    for (int j = 1; j < m; j++) wild[i][j] += wild[i][j - 1];
  do_dp();
  return 0;
}