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;
int nl, nr, n, c[10010][15], v[10010][810], rt, cnt, fail[10010], t,
    dp[2010][10010], tg[2010][10010], mx, nw;
char l[810], r[810];
queue<int> q;
void Build(int& x, char* second, const int& id, const int& len, const int& op) {
  if (!x) x = ++cnt;
  if (id > len) return;
  for (int i = 0; i < second[id] - '0'; ++i)
    v[c[x][i] ? c[x][i] : c[x][i] = ++cnt][len - id] += op;
  Build(c[x][second[id] - '0'], second, id + 1, len, op);
}
void GetFail() {
  q.push(1), fail[1] = 1;
  while (!q.empty()) {
    t = q.front(), q.pop();
    for (int i = 0; i < 10; ++i)
      if (c[t][i])
        fail[c[t][i]] = (t == 1 ? 1 : c[fail[t]][i]), q.push(c[t][i]);
      else
        c[t][i] = (t == 1 ? 1 : c[fail[t]][i]);
    for (int i = 0; i <= nr; ++i) v[t][i] += v[fail[t]][i];
  }
}
int main() {
  scanf("%s%s%d", l + 1, r + 1, &n), nl = strlen(l + 1), nr = strlen(r + 1);
  for (int i = nr; i >= 1; --i)
    if (r[i] != '9') {
      ++r[i];
      break;
    } else {
      if (i == 1) {
        r[i] = 1, r[++nr] = '0';
        break;
      }
      r[i] = 0;
    }
  Build(rt, r, 1, nr, 1), Build(rt, l, 1, nl, -1);
  for (int i = 1; i <= cnt; ++i)
    for (int j = 1; j <= nr; ++j) v[i][j] += v[i][j - 1];
  GetFail();
  for (int i = 0; i <= n; ++i)
    for (int j = 1; j <= cnt; ++j) dp[i][j] = -1e9;
  dp[0][1] = 0;
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= cnt; ++j)
      if (dp[i - 1][j] >= 0)
        for (int k = 0; k < 10; ++k)
          dp[i][c[j][k]] = max(
              dp[i][c[j][k]],
              dp[i - 1][j] +
                  (k ? min(nr - 1, n - i + 1) - min(nl - 1, n - i + 1) : 0) +
                  v[c[j][k]][min(nr, n - i)]);
  for (int i = 1; i <= cnt; ++i) mx = max(mx, dp[n][i]);
  for (int i = 1; i <= cnt; ++i) tg[n][i] = (dp[n][i] == mx);
  for (int i = n; i >= 1; --i)
    for (int j = 1; j <= cnt; ++j)
      if (dp[i - 1][j] >= 0)
        for (int k = 0; k < 10; ++k)
          if (tg[i][c[j][k]] &&
              dp[i - 1][j] +
                      (k ? min(nr - 1, n - i + 1) - min(nl - 1, n - i + 1)
                         : 0) +
                      v[c[j][k]][min(nr, n - i)] ==
                  dp[i][c[j][k]])
            tg[i - 1][j] = 1;
  printf("%d\n", mx), nw = 1;
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < 10; ++j)
      if (tg[i + 1][c[nw][j]]) {
        putchar(j + '0'), nw = c[nw][j];
        break;
      }
  return 0;
}