#include <bits/stdc++.h>
using namespace std;
long long l, r, k;
long long d[20], m, dp[20][2000], down[20][2000], dp1[20][2000];
long long qpow(long long a, long long b) {
  long long ans = 1;
  while (b) {
    if (b & 1) ans = ans * a % 998244353;
    a = a * a % 998244353;
    b >>= 1;
  }
  return ans;
}
long long DP1(long long i, long long j) {
  if (dp1[i][j] != -1) return dp1[i][j];
  if (!i) return __builtin_popcount(j) <= k ? dp1[i][j] = 1 : dp1[i][j] = 0;
  long long ans = 0;
  for (int dg = 0; dg <= 9; dg++) {
    ans = (ans + DP1(i - 1, j | (1 << dg))) % 998244353;
  }
  return dp1[i][j] = ans;
}
pair<long long, long long> DP(long long i, long long j) {
  if (dp[i][j] != -1) return make_pair(dp[i][j], down[i][j]);
  if (!i) {
    if (__builtin_popcount(j) <= k)
      down[i][j] = 1;
    else
      down[i][j] = -1;
    dp[i][j] = 0;
    return make_pair(dp[i][j], down[i][j]);
  }
  long long ans = 0, ok = 0, pos = -1;
  for (int dg = 0; dg <= 9; dg++) {
    pair<long long, long long> dg1 = DP(i - 1, j | (1 << dg));
    if (dg1.second == 1)
      pos = 1, ans = (ans +
                      dg * qpow(10, i - 1) % 998244353 *
                          DP1(i - 1, j | (1 << dg)) % 998244353 +
                      dg1.first) %
                     998244353;
  }
  dp[i][j] = ans;
  down[i][j] = pos;
  return make_pair(dp[i][j], down[i][j]);
}
long long calc(long long t) {
  m = 0;
  while (t) {
    d[m++] = t % 10;
    t /= 10;
  }
  long long ans = 0;
  for (int i = m - 1; i >= 1; i--)
    for (int j = 1; j <= 9; j++) {
      if (DP(i - 1, (1 << j)).second)
        ans += (j * qpow(10, i - 1) % 998244353 * DP1(i - 1, (1 << j)) %
                    998244353 +
                DP(i - 1, (1 << j)).first) %
               998244353,
            ans %= 998244353;
    }
  int pre = 0;
  long long previous = 0;
  for (int i = m - 1; i >= 0; i--) {
    for (int j = (i == m - 1) ? 1 : 0; j < d[i]; j++) {
      if (DP(i, pre | (1 << j)).second)
        ans += ((previous * 10 + j) % 998244353 * qpow(10, i) % 998244353 *
                    DP1(i, pre | (1 << j)) % 998244353 +
                DP(i, pre | (1 << j)).first) %
               998244353,
            ans %= 998244353;
    }
    pre |= (1 << (d[i]));
    previous = previous * 10 + d[i];
    previous %= 998244353;
    if (__builtin_popcount(pre) > k) break;
  }
  return ans;
}
int main() {
  memset(down, -1, sizeof(down));
  memset(dp, -1, sizeof(dp));
  memset(dp1, -1, sizeof(dp1));
  cin >> l >> r >> k;
  cout << (calc(r + 1) - calc(l) + 998244353) % 998244353 << endl;
  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;
long long l, r, k;
long long d[20], m, dp[20][2000], down[20][2000], dp1[20][2000];
long long qpow(long long a, long long b) {
  long long ans = 1;
  while (b) {
    if (b & 1) ans = ans * a % 998244353;
    a = a * a % 998244353;
    b >>= 1;
  }
  return ans;
}
long long DP1(long long i, long long j) {
  if (dp1[i][j] != -1) return dp1[i][j];
  if (!i) return __builtin_popcount(j) <= k ? dp1[i][j] = 1 : dp1[i][j] = 0;
  long long ans = 0;
  for (int dg = 0; dg <= 9; dg++) {
    ans = (ans + DP1(i - 1, j | (1 << dg))) % 998244353;
  }
  return dp1[i][j] = ans;
}
pair<long long, long long> DP(long long i, long long j) {
  if (dp[i][j] != -1) return make_pair(dp[i][j], down[i][j]);
  if (!i) {
    if (__builtin_popcount(j) <= k)
      down[i][j] = 1;
    else
      down[i][j] = -1;
    dp[i][j] = 0;
    return make_pair(dp[i][j], down[i][j]);
  }
  long long ans = 0, ok = 0, pos = -1;
  for (int dg = 0; dg <= 9; dg++) {
    pair<long long, long long> dg1 = DP(i - 1, j | (1 << dg));
    if (dg1.second == 1)
      pos = 1, ans = (ans +
                      dg * qpow(10, i - 1) % 998244353 *
                          DP1(i - 1, j | (1 << dg)) % 998244353 +
                      dg1.first) %
                     998244353;
  }
  dp[i][j] = ans;
  down[i][j] = pos;
  return make_pair(dp[i][j], down[i][j]);
}
long long calc(long long t) {
  m = 0;
  while (t) {
    d[m++] = t % 10;
    t /= 10;
  }
  long long ans = 0;
  for (int i = m - 1; i >= 1; i--)
    for (int j = 1; j <= 9; j++) {
      if (DP(i - 1, (1 << j)).second)
        ans += (j * qpow(10, i - 1) % 998244353 * DP1(i - 1, (1 << j)) %
                    998244353 +
                DP(i - 1, (1 << j)).first) %
               998244353,
            ans %= 998244353;
    }
  int pre = 0;
  long long previous = 0;
  for (int i = m - 1; i >= 0; i--) {
    for (int j = (i == m - 1) ? 1 : 0; j < d[i]; j++) {
      if (DP(i, pre | (1 << j)).second)
        ans += ((previous * 10 + j) % 998244353 * qpow(10, i) % 998244353 *
                    DP1(i, pre | (1 << j)) % 998244353 +
                DP(i, pre | (1 << j)).first) %
               998244353,
            ans %= 998244353;
    }
    pre |= (1 << (d[i]));
    previous = previous * 10 + d[i];
    previous %= 998244353;
    if (__builtin_popcount(pre) > k) break;
  }
  return ans;
}
int main() {
  memset(down, -1, sizeof(down));
  memset(dp, -1, sizeof(dp));
  memset(dp1, -1, sizeof(dp1));
  cin >> l >> r >> k;
  cout << (calc(r + 1) - calc(l) + 998244353) % 998244353 << endl;
  return 0;
}

```