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 = 2005;
const int M = 805;
const int NODE = M * 20;
const int INF = ~0u >> 1;
int trans[NODE][10], fail[NODE], tot;
int val[NODE][M];
int f[N][NODE];
bool way[N][NODE];
string l, r;
int n, m;
void depth(int now, int p, bool dlim, bool ulim) {
  if (now >= m) {
    ++val[p][0];
    return;
  }
  if (!dlim && !ulim) {
    ++val[p][m - now];
    return;
  }
  int llim = (dlim ? l[now] - '0' : 0);
  int rlim = (ulim ? r[now] - '0' : 9);
  for (int i = max(llim, (int)!now); i <= rlim; ++i) {
    int to = (trans[p][i] ? trans[p][i] : trans[p][i] = ++tot);
    depth(now + 1, to, dlim && i == llim, ulim && i == rlim);
  }
}
void build_fail() {
  queue<int> q;
  q.push(0);
  while (!q.empty()) {
    int x = q.front();
    q.pop();
    for (int i = 0; i <= 9; ++i) {
      int v = trans[x][i];
      if (v) {
        q.push(v);
        if (x) {
          fail[v] = trans[fail[x]][i];
        }
        for (int i = 0; i <= m; ++i) val[v][i] += val[fail[v]][i];
      } else
        trans[x][i] = trans[fail[x]][i];
    }
  }
  for (int i = 0; i <= tot; ++i) {
    for (int j = 1; j <= m; ++j) val[i][j] += val[i][j - 1];
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin >> l >> r >> n;
  if (l.size() == r.size()) {
    m = r.size();
    depth(0, 0, 1, 1);
  } else {
    int p = m = l.size();
    depth(0, 0, 1, 0);
    m = r.size();
    while (l.size() < m) l = "0" + l;
    depth(0, 0, 0, 1);
    for (int i = p + 1; i < m; ++i) ++val[0][i];
  }
  build_fail();
  for (int i = 0; i <= n; ++i)
    for (int j = 0; j <= tot; ++j) f[i][j] = -INF;
  f[0][0] = val[0][min(n, m)];
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j <= tot; ++j) {
      for (int k = 0; k <= 9; ++k) {
        int v = trans[j][k];
        f[i + 1][v] = max(f[i + 1][v], f[i][j] + val[v][min(n - i - 1, m)]);
      }
    }
  }
  int ans = 0;
  for (int i = 0; i <= tot; ++i) ans = max(ans, f[n][i]);
  cout << ans << '\n';
  for (int i = 0; i <= tot; ++i) way[n][i] = (f[n][i] == ans);
  for (int i = n - 1; i >= 0; --i)
    for (int j = 0; j <= tot; ++j) {
      for (int k = 0; k <= 9; ++k) {
        int v = trans[j][k];
        if (way[i + 1][v] &&
            f[i + 1][v] == f[i][j] + val[v][min(n - i - 1, m)]) {
          way[i][j] = 1;
          break;
        }
      }
    }
  int now = 0, len = 0;
  while (len < n) {
    for (int k = 0; k <= 9; ++k) {
      int v = trans[now][k];
      if (way[len + 1][v] &&
          f[len + 1][v] == f[len][now] + val[v][min(n - len - 1, m)]) {
        now = v;
        cout << k;
        break;
      }
    }
    ++len;
  }
}