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;
string l, r;
int trie[20000][10], leaf[20000][805], fail[20000], nxt[20000][10], num = 0;
queue<int> Q;
int insert(string s, int l) {
  int i, u = 0, f = 0;
  for (i = 0; i < s.size(); i++) {
    if ((s[i] == '0') && !f)
      continue;
    else
      f = 1;
    if (trie[u][s[i] - '0'] == -1) trie[u][s[i] - '0'] = ++num;
    u = trie[u][s[i] - '0'];
  }
  leaf[u][l]++;
  return 0;
}
int insertAll(string c, int x, int y) {
  if (x && y) {
    insert(c, l.size() - c.size());
    return 0;
  }
  if (c.size() == l.size()) return 0;
  int i;
  c += '0';
  for (i = 0; i < 10; i++) {
    c.back() = '0' + i;
    if (!x && (i < l[c.size() - 1] - '0')) continue;
    if (!y && (i > r[c.size() - 1] - '0')) continue;
    insertAll(c, x | (i > l[c.size() - 1] - '0'),
              y | (i < r[c.size() - 1] - '0'));
  }
  return 0;
}
int dp[2001][20000];
int main() {
  int n;
  cin >> l >> r >> n;
  r = "0" + r;
  int i, j, k;
  for (i = l.size() - 1; i >= 0; i--) {
    if (l[i] == '0')
      l[i] = '9';
    else {
      l[i]--;
      break;
    }
  }
  for (i = r.size() - 1; i >= 0; i--) {
    if (r[i] == '9')
      r[i] = '0';
    else {
      r[i]++;
      break;
    }
  }
  while (l.size() < r.size()) l = "0" + l;
  memset(trie, -1, sizeof(trie));
  insertAll("", 0, 0);
  for (i = 0; i < 10; i++) {
    if (trie[0][i] != -1)
      nxt[0][i] = trie[0][i], fail[trie[0][i]] = 0, Q.push(trie[0][i]);
    else
      nxt[0][i] = trie[0][i] = 0;
  }
  while (!Q.empty()) {
    int u = Q.front();
    Q.pop();
    for (i = 0; i < 10; i++) {
      if (trie[u][i] != -1) {
        int v = fail[u];
        while (trie[v][i] == -1) v = fail[v];
        v = trie[v][i];
        fail[trie[u][i]] = v;
        for (j = 0; j < 805; j++) leaf[trie[u][i]][j] += leaf[v][j];
        nxt[u][i] = trie[u][i], Q.push(trie[u][i]);
      } else
        nxt[u][i] = nxt[fail[u]][i];
    }
  }
  num++;
  for (i = 0; i < num; i++) {
    for (j = 1; j < 805; j++) leaf[i][j] += leaf[i][j - 1];
  }
  for (i = n - 1; i >= 0; i--) {
    for (j = 0; j < num; j++) {
      for (k = 0; k < 10; k++)
        dp[i][j] = max(dp[i][j], dp[i + 1][nxt[j][k]] +
                                     leaf[nxt[j][k]][min(n - i - 1, 804)]);
    }
  }
  printf("%d\n", dp[0][0]);
  int u = 0;
  for (i = 0; i < n; i++) {
    for (j = 0; j < 10; j++) {
      if (dp[i][u] ==
          dp[i + 1][nxt[u][j]] + leaf[nxt[u][j]][min(n - i - 1, 804)]) {
        printf("%d", j), u = nxt[u][j];
        break;
      }
    }
  }
  printf("\n");
  return 0;
}