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;
char L[1010], R[1010];
int ll, lr;
int n;
struct AC_AM {
  int s[20020][11], tot;
  int sum[16006][2020];
  int nxt(int x, char c) {
    c -= '0';
    return s[x][c] ? s[x][c] : s[x][c] = ++tot;
  }
  void build() {
    int u = 0, v = 0;
    if (ll == lr) {
      for (int i = 1; i <= ll; ++i) {
        if (u == v)
          for (char c = L[i] + 1; c < R[i]; ++c) sum[nxt(u, c)][ll - i]++;
        else {
          for (char c = L[i] + 1; c <= '9'; ++c) sum[nxt(u, c)][ll - i]++;
          for (char c = '0' + (i == 1); c < R[i]; ++c) sum[nxt(v, c)][ll - i]++;
        }
        u = nxt(u, L[i]), v = nxt(v, R[i]);
      }
      sum[u][0]++;
      if (u != v) sum[v][0]++;
      return;
    } else {
      for (int i = 1; i <= ll; ++i) {
        for (char c = L[i] + 1; c <= '9'; ++c) sum[nxt(u, c)][ll - i]++;
        u = nxt(u, L[i]);
      }
      sum[u][0]++;
      v = 0;
      for (int i = 1; i <= lr; ++i) {
        for (char c = '0' + (i == 1); c < R[i]; ++c) sum[nxt(v, c)][lr - i]++;
        v = nxt(v, R[i]);
      }
      sum[v][0]++;
      for (int i = ll + 1; i < lr; ++i)
        for (char c = '1'; c <= '9'; ++c) sum[nxt(0, c)][i - 1]++;
    }
  }
  int fa[16006];
  void getfail() {
    queue<int> q;
    for (int i = 0; i <= 9; ++i)
      if (s[0][i]) q.push(s[0][i]);
    int u, v;
    while (!q.empty()) {
      u = q.front();
      q.pop();
      for (int l = 0; l <= lr; ++l) sum[u][l] += sum[fa[u]][l];
      for (int c = 0; c <= 9; ++c)
        if (s[u][c]) {
          v = s[u][c];
          fa[v] = s[fa[u]][c];
          q.push(v);
        } else
          s[u][c] = s[fa[u]][c];
    }
    for (int i = 0; i <= tot; ++i)
      for (int j = 1; j <= n; ++j) sum[i][j] += sum[i][j - 1];
  }
  int f[2020][16006];
  bool on[2020][16006];
  void solve() {
    memset(f, -1, sizeof(f));
    f[0][0] = 0;
    int v;
    for (int i = 0; i < n; ++i)
      for (int x = 0; x <= tot; ++x)
        if (f[i][x] >= 0)
          for (int c = 0; c <= 9; ++c) {
            v = s[x][c];
            f[i + 1][v] = max(f[i + 1][v], f[i][x] + sum[v][n - i - 1]);
          }
    int ans = 0;
    for (int i = 0; i <= tot; ++i) ans = max(ans, f[n][i]);
    for (int i = 0; i <= tot; ++i)
      if (f[n][i] == ans) on[n][i] = 1;
    for (int i = n - 1; i >= 0; --i)
      for (int x = 0; x <= tot; ++x) {
        if (f[i][x] < 0) continue;
        for (int c = 0; c <= 9; ++c) {
          v = s[x][c];
          if (on[i + 1][v] && f[i][x] + sum[v][n - i - 1] == f[i + 1][v])
            on[i][x] = 1;
        }
      }
    int u = 0;
    printf("%d\n", ans);
    for (int i = 1; i <= n; ++i) {
      for (int c = 0; c <= 9; ++c) {
        v = s[u][c];
        if (on[i][s[u][c]] && f[i - 1][u] + sum[v][n - i] == f[i][v]) {
          printf("%d", c);
          u = v;
          break;
        }
      }
    }
    puts("");
  }
} AC;
int main() {
  scanf("%s", L + 1);
  ll = strlen(L + 1);
  scanf("%s", R + 1);
  lr = strlen(R + 1);
  scanf("%d", &n);
  AC.build();
  AC.getfail();
  AC.solve();
  return 0;
}