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 main() {
  do {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
  } while (false);
  string L, R;
  cin >> L >> R;
  reverse(L.begin(), L.end());
  L.resize(R.size(), '0');
  reverse(L.begin(), L.end());
  int n, m = 0;
  cin >> n;
  const int sigma = 10, M = 3 * R.size() * sigma + 100;
  vector<vector<int> > son(M, vector<int>(sigma)),
      sum(M, vector<int>(R.size()));
  function<void(int, int, bool, bool, bool)> gen = [&](int idx, int u, bool big,
                                                       bool small, bool start) {
    if (idx >= R.size() || (big && small)) {
      sum[u][R.size() - idx]++;
    } else {
      for (int i = (big ? 0 : L[idx] - '0'); i <= (small ? 9 : R[idx] - '0');
           i++) {
        int v = u;
        if (start || i) {
          if (!son[u][i]) {
            son[u][i] = m++;
          }
          v = son[u][i];
        }
        gen(idx + 1, v, big || L[idx] - '0' < i, small || R[idx] - '0' > i,
            start || i);
      }
    }
  };
  gen(0, m++, false, false, false);
  vector<int> fail(m);
  auto build = [&]() {
    queue<int> que;
    que.push(0);
    while (!que.empty()) {
      int u = que.front();
      que.pop();
      for (int i = 0; i < sigma; i++) {
        if (!son[u][i]) {
          son[u][i] = son[fail[u]][i];
        } else {
          int v = fail[u];
          while (v && !son[v][i]) {
            v = fail[v];
          }
          if (son[v][i] && son[v][i] != son[u][i]) {
            fail[son[u][i]] = son[v][i];
            for (int j = 0; j < R.size(); j++) {
              sum[son[u][i]][j] += sum[son[v][i]][j];
            }
          }
          que.push(son[u][i]);
        }
      }
    }
  };
  build();
  vector<vector<int> > trans(m, vector<int>(sigma));
  for (int u = 0; u < m; u++) {
    for (int i = 1; i < R.size(); i++) {
      sum[u][i] += sum[u][i - 1];
    }
    for (int i = 0; i < sigma; i++) {
      int v = u;
      while (v && !son[v][i]) {
        v = fail[v];
      }
      trans[u][i] = son[v][i];
    }
  }
  vector<vector<int> > dp(n + 1, vector<int>(m, -1e9));
  dp[0][0] = 0;
  for (int i = 0; i < n; i++) {
    for (int u = 0; u < m; u++) {
      if (dp[i][u] >= 0) {
        for (int j = 0; j < sigma; j++) {
          int v = trans[u][j];
          dp[i + 1][v] = max(dp[i + 1][v],
                             dp[i][u] + sum[v][min((int)R.size(), n - i) - 1]);
        }
      }
    }
  }
  int goal = *max_element(dp[n].begin(), dp[n].end());
  cout << goal << endl;
  vector<vector<bool> > on(n + 1, vector<bool>(m));
  for (int i = 0; i < m; i++) {
    on[n][i] = dp[n][i] == goal;
  }
  for (int i = n - 1; i >= 0; i--) {
    for (int u = 0; u < m; u++) {
      if (dp[i][u] >= 0) {
        bool ok = false;
        for (int j = 0; j < sigma; j++) {
          int v = trans[u][j];
          ok |=
              on[i + 1][v] &&
              dp[i][u] + sum[v][min((int)R.size(), n - i) - 1] == dp[i + 1][v];
        }
        on[i][u] = ok;
      }
    }
  }
  int u = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < sigma; j++) {
      int v = trans[u][j];
      if (on[i + 1][v] &&
          dp[i][u] + sum[v][min((int)R.size(), n - i) - 1] == dp[i + 1][v]) {
        cout << j;
        u = v;
        break;
      }
    }
  }
  cout << endl;
  return 0;
}