#include <bits/stdc++.h>
using namespace std;
const int N = 18;
const int K = 10;
const int M = 1 << K;
const long long MOD = 998244353;
vector<int> s;
long long k;
long long pot[N];
bool done[N][2][2][M];
pair<long long, long long> dp[N][2][2][M];
long long Add(long long a, long long b) { return (a + b) % MOD; }
long long Sub(long long a, long long b) { return (a - b + MOD) % MOD; }
long long Mul(long long a, long long b) { return (a * b) % MOD; }
void TurnOn(int& mask, int bit) { mask = mask | (1 << bit); }
pair<long long, long long> DP(int pos, bool lower, bool all_zeroes, int mask) {
  if (__builtin_popcount(mask) > k) return {0LL, 0LL};
  if (pos == N) return {1LL, 0LL};
  if (done[pos][lower][all_zeroes][mask])
    return dp[pos][lower][all_zeroes][mask];
  dp[pos][lower][all_zeroes][mask] = {0, 0};
  int lim = (lower) ? 9 : s[pos];
  for (long long d = 0; d <= lim; d++) {
    int nxt_mask = mask;
    if (!all_zeroes || all_zeroes && d != 0) TurnOn(nxt_mask, d);
    pair<long long, long long> nxt =
        DP(pos + 1, lower || d < lim, all_zeroes && d == 0, nxt_mask);
    dp[pos][lower][all_zeroes][mask].first =
        Add(dp[pos][lower][all_zeroes][mask].first, nxt.first);
    dp[pos][lower][all_zeroes][mask].second =
        Add(dp[pos][lower][all_zeroes][mask].second, nxt.second);
    dp[pos][lower][all_zeroes][mask].second =
        Add(dp[pos][lower][all_zeroes][mask].second,
            Mul(Mul(d, pot[N - 1 - pos]), nxt.first));
  }
  done[pos][lower][all_zeroes][mask] = true;
  return dp[pos][lower][all_zeroes][mask];
}
long long Solve(long long n) {
  if (n <= 0) return 0LL;
  s.clear();
  for (int i = 0; i < N; i++) {
    s.push_back(n % 10);
    n /= 10;
  }
  reverse(s.begin(), s.end());
  for (int i = 0; i < N; i++)
    for (int j = 0; j < 2; j++)
      for (int l = 0; l < 2; l++)
        for (int m = 0; m < M; m++) done[i][j][l][m] = false;
  return DP(0, false, true, 0).second;
}
int main(void) {
  ios::sync_with_stdio(false);
  cin.tie(0);
  pot[0] = 1LL;
  for (int i = 1; i < N; i++) pot[i] = Mul(pot[i - 1], 10LL);
  long long l, r;
  cin >> l >> r >> k;
  long long ans = Sub(Solve(r), Solve(l - 1));
  cout << ans << '\n';
  return 0;
}

### Prompt

Generate 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 int N = 18;
const int K = 10;
const int M = 1 << K;
const long long MOD = 998244353;
vector<int> s;
long long k;
long long pot[N];
bool done[N][2][2][M];
pair<long long, long long> dp[N][2][2][M];
long long Add(long long a, long long b) { return (a + b) % MOD; }
long long Sub(long long a, long long b) { return (a - b + MOD) % MOD; }
long long Mul(long long a, long long b) { return (a * b) % MOD; }
void TurnOn(int& mask, int bit) { mask = mask | (1 << bit); }
pair<long long, long long> DP(int pos, bool lower, bool all_zeroes, int mask) {
  if (__builtin_popcount(mask) > k) return {0LL, 0LL};
  if (pos == N) return {1LL, 0LL};
  if (done[pos][lower][all_zeroes][mask])
    return dp[pos][lower][all_zeroes][mask];
  dp[pos][lower][all_zeroes][mask] = {0, 0};
  int lim = (lower) ? 9 : s[pos];
  for (long long d = 0; d <= lim; d++) {
    int nxt_mask = mask;
    if (!all_zeroes || all_zeroes && d != 0) TurnOn(nxt_mask, d);
    pair<long long, long long> nxt =
        DP(pos + 1, lower || d < lim, all_zeroes && d == 0, nxt_mask);
    dp[pos][lower][all_zeroes][mask].first =
        Add(dp[pos][lower][all_zeroes][mask].first, nxt.first);
    dp[pos][lower][all_zeroes][mask].second =
        Add(dp[pos][lower][all_zeroes][mask].second, nxt.second);
    dp[pos][lower][all_zeroes][mask].second =
        Add(dp[pos][lower][all_zeroes][mask].second,
            Mul(Mul(d, pot[N - 1 - pos]), nxt.first));
  }
  done[pos][lower][all_zeroes][mask] = true;
  return dp[pos][lower][all_zeroes][mask];
}
long long Solve(long long n) {
  if (n <= 0) return 0LL;
  s.clear();
  for (int i = 0; i < N; i++) {
    s.push_back(n % 10);
    n /= 10;
  }
  reverse(s.begin(), s.end());
  for (int i = 0; i < N; i++)
    for (int j = 0; j < 2; j++)
      for (int l = 0; l < 2; l++)
        for (int m = 0; m < M; m++) done[i][j][l][m] = false;
  return DP(0, false, true, 0).second;
}
int main(void) {
  ios::sync_with_stdio(false);
  cin.tie(0);
  pot[0] = 1LL;
  for (int i = 1; i < N; i++) pot[i] = Mul(pot[i - 1], 10LL);
  long long l, r;
  cin >> l >> r >> k;
  long long ans = Sub(Solve(r), Solve(l - 1));
  cout << ans << '\n';
  return 0;
}

```