#include <bits/stdc++.h>
using namespace std;
long long dp1[20][1 << 11][2], dp2[20][1 << 11][2];
vector<int> num;
int n, k;
long long pow(long long a, int b) {
  long long ans = 1LL;
  while (b) {
    if (b & 1) ans = (ans * a) % (long long)998244353;
    a = (a * a) % (long long)998244353;
    b >>= 1;
  }
  return ans;
}
long long ways(int idx, int mask, int less) {
  if (__builtin_popcountll(mask) > k) return 0;
  if (idx == n + 1) return 1;
  if (dp1[idx][mask][less] != -1) return dp1[idx][mask][less];
  long long ans = 0;
  int lim = less ? 9 : num[idx];
  for (int i = 0; i <= lim; i++) {
    ans += ways(idx + 1, mask | (1 << i), less | (i < num[idx]));
    ans %= (long long)998244353;
  }
  return dp1[idx][mask][less] = ans;
}
long long sum(int idx, int mask, int less, int strt) {
  if (idx == n + 1) return 0;
  if (__builtin_popcountll(mask) > k) return 0;
  if (dp2[idx][mask][less] != -1) return dp2[idx][mask][less];
  long long ans = 0;
  int lim = less ? 9 : num[idx];
  if (strt) {
    for (int i = 0; i <= lim; i++) {
      long long way = ways(idx + 1, mask | (1 << i), less | (i < num[idx]));
      long long sum1 = (pow(10LL, n - idx) * i) % (long long)998244353;
      sum1 *= way;
      sum1 %= (long long)998244353;
      ans += sum1;
      ans %= (long long)998244353;
      ans += sum(idx + 1, mask | (1 << i), less | (i < num[idx]), 1);
      ans %= (long long)998244353;
    }
  } else {
    for (int i = 1; i <= lim; i++) {
      long long way = ways(idx + 1, mask | (1 << i), less | (i < num[idx]));
      long long sum1 = (pow(10LL, n - idx) * i) % (long long)998244353;
      sum1 *= way;
      sum1 %= (long long)998244353;
      ans += sum1;
      ans %= (long long)998244353;
      ans += sum(idx + 1, mask | (1 << i), less | (i < num[idx]), 1);
      ans %= (long long)998244353;
    }
    ans += sum(idx + 1, mask, 1, 0);
    ans %= (long long)998244353;
  }
  return dp2[idx][mask][less] = ans;
}
long long solve(long long x) {
  memset(dp1, -1, sizeof dp1);
  memset(dp2, -1, sizeof dp2);
  num.clear();
  while (x) {
    num.push_back(x % 10LL);
    x /= 10LL;
  }
  num.push_back(0);
  reverse(num.begin(), num.end());
  n = num.size() - 1;
  return sum(1, 0, 0, 0);
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  long long l, r;
  cin >> l >> r >> k;
  cout << (solve(r) - solve(l - 1) + (long long)998244353) %
              (long long)998244353;
  return 0;
}

### Prompt

Construct a Cpp code solution to the problem outlined:

You are given two integers l and r (l ≤ r). Your task is to calculate the sum of numbers from l to r (including l and r) such that each number contains at most k different digits, and print this sum modulo 998244353.

For example, if k = 1 then you have to calculate all numbers from l to r such that each number is formed using only one digit. For l = 10, r = 50 the answer is 11 + 22 + 33 + 44 = 110.

Input

The only line of the input contains three integers l, r and k (1 ≤ l ≤ r < 10^{18}, 1 ≤ k ≤ 10) — the borders of the segment and the maximum number of different digits.

Output

Print one integer — the sum of numbers from l to r such that each number contains at most k different digits, modulo 998244353.

Examples

Input

10 50 2


Output

1230


Input

1 2345 10


Output

2750685


Input

101 154 2


Output

2189

Note

For the first example the answer is just the sum of numbers from l to r which equals to (50 ⋅ 51)/(2) - (9 ⋅ 10)/(2) = 1230. This example also explained in the problem statement but for k = 1.

For the second example the answer is just the sum of numbers from l to r which equals to (2345 ⋅ 2346)/(2) = 2750685.

For the third example the answer is 101 + 110 + 111 + 112 + 113 + 114 + 115 + 116 + 117 + 118 + 119 + 121 + 122 + 131 + 133 + 141 + 144 + 151 = 2189.

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
long long dp1[20][1 << 11][2], dp2[20][1 << 11][2];
vector<int> num;
int n, k;
long long pow(long long a, int b) {
  long long ans = 1LL;
  while (b) {
    if (b & 1) ans = (ans * a) % (long long)998244353;
    a = (a * a) % (long long)998244353;
    b >>= 1;
  }
  return ans;
}
long long ways(int idx, int mask, int less) {
  if (__builtin_popcountll(mask) > k) return 0;
  if (idx == n + 1) return 1;
  if (dp1[idx][mask][less] != -1) return dp1[idx][mask][less];
  long long ans = 0;
  int lim = less ? 9 : num[idx];
  for (int i = 0; i <= lim; i++) {
    ans += ways(idx + 1, mask | (1 << i), less | (i < num[idx]));
    ans %= (long long)998244353;
  }
  return dp1[idx][mask][less] = ans;
}
long long sum(int idx, int mask, int less, int strt) {
  if (idx == n + 1) return 0;
  if (__builtin_popcountll(mask) > k) return 0;
  if (dp2[idx][mask][less] != -1) return dp2[idx][mask][less];
  long long ans = 0;
  int lim = less ? 9 : num[idx];
  if (strt) {
    for (int i = 0; i <= lim; i++) {
      long long way = ways(idx + 1, mask | (1 << i), less | (i < num[idx]));
      long long sum1 = (pow(10LL, n - idx) * i) % (long long)998244353;
      sum1 *= way;
      sum1 %= (long long)998244353;
      ans += sum1;
      ans %= (long long)998244353;
      ans += sum(idx + 1, mask | (1 << i), less | (i < num[idx]), 1);
      ans %= (long long)998244353;
    }
  } else {
    for (int i = 1; i <= lim; i++) {
      long long way = ways(idx + 1, mask | (1 << i), less | (i < num[idx]));
      long long sum1 = (pow(10LL, n - idx) * i) % (long long)998244353;
      sum1 *= way;
      sum1 %= (long long)998244353;
      ans += sum1;
      ans %= (long long)998244353;
      ans += sum(idx + 1, mask | (1 << i), less | (i < num[idx]), 1);
      ans %= (long long)998244353;
    }
    ans += sum(idx + 1, mask, 1, 0);
    ans %= (long long)998244353;
  }
  return dp2[idx][mask][less] = ans;
}
long long solve(long long x) {
  memset(dp1, -1, sizeof dp1);
  memset(dp2, -1, sizeof dp2);
  num.clear();
  while (x) {
    num.push_back(x % 10LL);
    x /= 10LL;
  }
  num.push_back(0);
  reverse(num.begin(), num.end());
  n = num.size() - 1;
  return sum(1, 0, 0, 0);
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  long long l, r;
  cin >> l >> r >> k;
  cout << (solve(r) - solve(l - 1) + (long long)998244353) %
              (long long)998244353;
  return 0;
}

```