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 maxn = 2005;
const int maxz = 16005;
int l[maxn], r[maxn], n, l1, l2;
int dp[maxn][maxz], q[maxz];
bool lt[maxn][maxz];
char s[maxn];
struct ac_machine {
  int ch[maxz][10], cnt;
  int fail[maxz];
  int tp[maxz][maxn];
  void init() {
    int x = 0, y = 0;
    if (l1 == l2) {
      for (int i = 1; i <= l1; ++i) {
        if (x == y) {
          for (int j = l[i] + 1; j < r[i]; ++j) {
            if (!ch[x][j]) ch[x][j] = ++cnt;
            tp[ch[x][j]][l1 - i]++;
          }
        } else {
          for (int j = l[i] + 1; j <= 9; ++j) {
            if (!ch[x][j]) ch[x][j] = ++cnt;
            tp[ch[x][j]][l1 - i]++;
          }
          for (int j = (i == 1); j < r[i]; ++j) {
            if (!ch[y][j]) ch[y][j] = ++cnt;
            tp[ch[y][j]][l2 - i]++;
          }
        }
        if (!ch[x][l[i]]) ch[x][l[i]] = ++cnt;
        x = ch[x][l[i]];
        if (!ch[y][r[i]]) ch[y][r[i]] = ++cnt;
        y = ch[y][r[i]];
      }
      tp[x][0]++;
      if (x != y) tp[y][0]++;
    } else {
      for (int i = 1; i <= l1; ++i) {
        for (int j = l[i] + 1; j <= 9; ++j) {
          if (!ch[x][j]) ch[x][j] = ++cnt;
          tp[ch[x][j]][l1 - i]++;
        }
        if (!ch[x][l[i]]) ch[x][l[i]] = ++cnt;
        x = ch[x][l[i]];
      }
      for (int i = 1; i <= l2; ++i) {
        for (int j = (i == 1); j < r[i]; ++j) {
          if (!ch[y][j]) ch[y][j] = ++cnt;
          tp[ch[y][j]][l2 - i]++;
        }
        if (!ch[y][r[i]]) ch[y][r[i]] = ++cnt;
        y = ch[y][r[i]];
      }
      for (int i = l1 + 1; i < l2; ++i)
        for (int j = 1; j <= 9; ++j) {
          if (!ch[0][j]) ch[0][j] = ++cnt;
          tp[ch[0][j]][i - 1]++;
        }
      tp[x][0]++;
      tp[y][0]++;
    }
  }
  void build() {
    int h = 1, t = 0;
    for (int i = 0; i <= 9; ++i)
      if (ch[0][i]) q[++t] = ch[0][i];
    int x;
    while (h <= t) {
      x = q[h++];
      for (int i = 0; i <= 9; ++i)
        if (!ch[x][i])
          ch[x][i] = ch[fail[x]][i];
        else
          fail[ch[x][i]] = ch[fail[x]][i], q[++t] = ch[x][i];
    }
    for (int i = 1; i <= t; ++i) {
      x = q[i];
      for (int j = 0; j <= n; ++j) tp[x][j] += tp[fail[x]][j];
    }
    for (int i = 1; i <= cnt; ++i)
      for (int j = 1; j <= n; ++j) tp[i][j] += tp[i][j - 1];
  }
} t;
int main() {
  t.cnt = 0;
  scanf("%s", s + 1);
  l1 = strlen(s + 1);
  for (int i = 1; i <= l1; i++) l[i] = s[i] - '0';
  scanf("%s", s + 1);
  l2 = strlen(s + 1);
  for (int i = 1; i <= l2; i++) r[i] = s[i] - '0';
  scanf("%d", &n);
  memset(dp, -1, sizeof(dp));
  dp[0][0] = 0;
  t.init();
  t.build();
  for (int i = 0; i < n; ++i)
    for (int j = 0; j <= t.cnt; ++j) {
      if (dp[i][j] == -1) continue;
      for (int k = 0; k <= 9; ++k) {
        int x = t.ch[j][k];
        dp[i + 1][x] = max(dp[i + 1][x], dp[i][j] + t.tp[x][n - i - 1]);
      }
    }
  int ans = 0;
  for (int i = 0; i <= t.cnt; ++i) ans = max(ans, dp[n][i]);
  printf("%d\n", ans);
  for (int i = 0; i <= t.cnt; ++i)
    if (dp[n][i] == ans) lt[n][i] = 1;
  for (int i = n - 1; i >= 0; --i) {
    for (int j = 0; j <= t.cnt; ++j) {
      if (dp[i][j] == -1) continue;
      for (int k = 0; k <= 9; ++k) {
        int x = t.ch[j][k];
        lt[i][j] |=
            lt[i + 1][x] && (dp[i + 1][x] == dp[i][j] + t.tp[x][n - i - 1]);
      }
    }
  }
  int x = 0;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j <= 9; ++j) {
      int y = t.ch[x][j];
      if (lt[i + 1][y] && (dp[i + 1][y] == dp[i][x] + t.tp[y][n - i - 1])) {
        putchar(j + '0');
        x = y;
        break;
      }
    }
  }
  return 0;
}