#include <bits/stdc++.h>
using namespace std;
const long long int mod = 998244353ll;
int n, k;
long long int count_mem[20][2][2][1 << 10], sum_mem[20][2][2][1 << 10], l, r,
    pot[22];
long long int count_dp(int i, bool canUse, bool hasPreffixOfZeroes, int msk,
                       const vector<int>& dig) {
  if (i == n) return __builtin_popcount(msk) <= k;
  long long int& ans = count_mem[i][canUse][hasPreffixOfZeroes][msk];
  if (ans != -1) return ans;
  int lim = canUse ? 9 : dig[i];
  ans = 0;
  for (int d = 0; d <= lim; d++) {
    if (d == 0) {
      if (!hasPreffixOfZeroes)
        ans += count_dp(i + 1, canUse | (d < lim), 0, msk | (1 << d), dig);
      else
        ans += count_dp(i + 1, canUse | (d < lim), 1, msk, dig);
    } else
      ans += count_dp(i + 1, canUse | (d < lim), false, msk | (1 << d), dig);
    if (ans >= mod) ans -= mod;
  }
  return ans;
}
long long int sum_dp(int i, bool canUse, bool hasPreffixOfZeroes, int msk,
                     const vector<int>& dig) {
  if (i == n) return 0;
  long long int& ans = sum_mem[i][canUse][hasPreffixOfZeroes][msk];
  if (ans != -1) return ans;
  ans = 0;
  int lim = canUse ? 9 : dig[i];
  for (int d = 0; d <= lim; d++) {
    if (d == 0) {
      if (hasPreffixOfZeroes)
        ans += sum_dp(i + 1, canUse | (d < lim), 1, msk, dig);
      else
        ans +=
            ((d * pot[n - i - 1]) % mod *
                 count_dp(i + 1, canUse | (d < lim), 0, msk | (1 << d), dig) %
                 mod +
             sum_dp(i + 1, canUse | (d < lim), 0, msk | (1 << d), dig)) %
            mod;
    } else
      ans += ((d * pot[n - i - 1]) % mod *
                  count_dp(i + 1, canUse | (d < lim), 0, msk | (1 << d), dig) %
                  mod +
              sum_dp(i + 1, canUse | (d < lim), 0, msk | (1 << d), dig)) %
             mod;
    if (ans > mod) ans -= mod;
  }
  return ans;
}
long long int f(long long int x) {
  memset(count_mem, -1, sizeof(count_mem));
  memset(sum_mem, -1, sizeof(sum_mem));
  if (x == 0) return 0;
  vector<int> dig;
  while (x) {
    dig.push_back(x % 10);
    x /= 10;
  }
  reverse(dig.begin(), dig.end());
  n = dig.size();
  return sum_dp(0, 0, 1, 0, dig);
}
int main() {
  ;
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  pot[0] = 1;
  for (int i = 1; i <= 21; i++) pot[i] = (pot[i - 1] * 10ll) % mod;
  long long int ans = 0;
  cin >> l >> r >> k;
  ans = f(r) - f(l - 1);
  if (ans < 0) ans += mod;
  cout << ans << '\n';
  return 0;
}

### Prompt

Please formulate a Cpp solution to the following problem:

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;
const long long int mod = 998244353ll;
int n, k;
long long int count_mem[20][2][2][1 << 10], sum_mem[20][2][2][1 << 10], l, r,
    pot[22];
long long int count_dp(int i, bool canUse, bool hasPreffixOfZeroes, int msk,
                       const vector<int>& dig) {
  if (i == n) return __builtin_popcount(msk) <= k;
  long long int& ans = count_mem[i][canUse][hasPreffixOfZeroes][msk];
  if (ans != -1) return ans;
  int lim = canUse ? 9 : dig[i];
  ans = 0;
  for (int d = 0; d <= lim; d++) {
    if (d == 0) {
      if (!hasPreffixOfZeroes)
        ans += count_dp(i + 1, canUse | (d < lim), 0, msk | (1 << d), dig);
      else
        ans += count_dp(i + 1, canUse | (d < lim), 1, msk, dig);
    } else
      ans += count_dp(i + 1, canUse | (d < lim), false, msk | (1 << d), dig);
    if (ans >= mod) ans -= mod;
  }
  return ans;
}
long long int sum_dp(int i, bool canUse, bool hasPreffixOfZeroes, int msk,
                     const vector<int>& dig) {
  if (i == n) return 0;
  long long int& ans = sum_mem[i][canUse][hasPreffixOfZeroes][msk];
  if (ans != -1) return ans;
  ans = 0;
  int lim = canUse ? 9 : dig[i];
  for (int d = 0; d <= lim; d++) {
    if (d == 0) {
      if (hasPreffixOfZeroes)
        ans += sum_dp(i + 1, canUse | (d < lim), 1, msk, dig);
      else
        ans +=
            ((d * pot[n - i - 1]) % mod *
                 count_dp(i + 1, canUse | (d < lim), 0, msk | (1 << d), dig) %
                 mod +
             sum_dp(i + 1, canUse | (d < lim), 0, msk | (1 << d), dig)) %
            mod;
    } else
      ans += ((d * pot[n - i - 1]) % mod *
                  count_dp(i + 1, canUse | (d < lim), 0, msk | (1 << d), dig) %
                  mod +
              sum_dp(i + 1, canUse | (d < lim), 0, msk | (1 << d), dig)) %
             mod;
    if (ans > mod) ans -= mod;
  }
  return ans;
}
long long int f(long long int x) {
  memset(count_mem, -1, sizeof(count_mem));
  memset(sum_mem, -1, sizeof(sum_mem));
  if (x == 0) return 0;
  vector<int> dig;
  while (x) {
    dig.push_back(x % 10);
    x /= 10;
  }
  reverse(dig.begin(), dig.end());
  n = dig.size();
  return sum_dp(0, 0, 1, 0, dig);
}
int main() {
  ;
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  pot[0] = 1;
  for (int i = 1; i <= 21; i++) pot[i] = (pot[i - 1] * 10ll) % mod;
  long long int ans = 0;
  cin >> l >> r >> k;
  ans = f(r) - f(l - 1);
  if (ans < 0) ans += mod;
  cout << ans << '\n';
  return 0;
}

```