#include <bits/stdc++.h>
using namespace std;
const int MAXN = 30;
const int MOD = 998244353;
int add(int x, int v) {
  x += v;
  if (x >= MOD) x -= MOD;
  return x;
}
int K, S, A[MAXN], F[MAXN][1 << 10][2], G[MAXN][1 << 10][2];
long long L, R;
bool f[1 << 10];
bool check(int s) {
  int v = 0;
  for (; s; s >>= 1)
    if (s & 1) ++v;
  return v <= K;
}
int Cal(long long v) {
  if (v == 0) return 0;
  memset(F, 0, sizeof F);
  memset(G, 0, sizeof G);
  int n = 0;
  while (v) A[++n] = v % 10, v /= 10;
  for (int i = 1, j = n; i < j; ++i, --j) swap(A[i], A[j]);
  F[1][0][0] = 1;
  for (int i = 1; i <= A[1]; ++i) {
    F[1][1 << i][i == A[1]] = 1;
    G[1][1 << i][i == A[1]] = i;
  }
  for (int i = 2; i <= n; ++i) {
    F[i][0][0] = F[i - 1][0][0];
    for (int s = 0; s < S; ++s) {
      int ss, v;
      for (int j = 0; j < 10; ++j) {
        if (s == 0 && j == 0) continue;
        ss = s | (1 << j);
        if (!f[ss]) continue;
        if (j < A[i]) {
          v = add(F[i - 1][s][0], F[i - 1][s][1]);
          F[i][ss][0] = add(F[i][ss][0], v);
          G[i][ss][0] =
              add(G[i][ss][0],
                  1LL * add(G[i - 1][s][0], G[i - 1][s][1]) * 10 % MOD);
          G[i][ss][0] = add(G[i][ss][0], 1LL * v * j % MOD);
        } else if (j == A[i]) {
          F[i][ss][1] = add(F[i][ss][1], F[i - 1][s][1]);
          G[i][ss][1] = add(G[i][ss][1], add(1LL * G[i - 1][s][1] * 10 % MOD,
                                             1LL * F[i - 1][s][1] * j % MOD));
          F[i][ss][0] = add(F[i][ss][0], F[i - 1][s][0]);
          G[i][ss][0] = add(G[i][ss][0], add(1LL * G[i - 1][s][0] * 10 % MOD,
                                             1LL * F[i - 1][s][0] * j % MOD));
        } else {
          F[i][ss][0] = add(F[i][ss][0], F[i - 1][s][0]);
          G[i][ss][0] = add(G[i][ss][0], add(1LL * G[i - 1][s][0] * 10 % MOD,
                                             1LL * F[i - 1][s][0] * j % MOD));
        }
      }
    }
  }
  int Ans = 0;
  for (int s = 0; s < S; ++s)
    if (f[s]) {
      Ans = add(Ans, G[n][s][0]);
      Ans = add(Ans, G[n][s][1]);
    }
  return Ans;
}
int main() {
  cin >> L >> R >> K;
  S = 1 << 10;
  for (int i = 0; i < S; ++i) f[i] = check(i);
  int v = Cal(R) - Cal(L - 1);
  if (v < 0) v += MOD;
  printf("%d\n", v);
  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 MAXN = 30;
const int MOD = 998244353;
int add(int x, int v) {
  x += v;
  if (x >= MOD) x -= MOD;
  return x;
}
int K, S, A[MAXN], F[MAXN][1 << 10][2], G[MAXN][1 << 10][2];
long long L, R;
bool f[1 << 10];
bool check(int s) {
  int v = 0;
  for (; s; s >>= 1)
    if (s & 1) ++v;
  return v <= K;
}
int Cal(long long v) {
  if (v == 0) return 0;
  memset(F, 0, sizeof F);
  memset(G, 0, sizeof G);
  int n = 0;
  while (v) A[++n] = v % 10, v /= 10;
  for (int i = 1, j = n; i < j; ++i, --j) swap(A[i], A[j]);
  F[1][0][0] = 1;
  for (int i = 1; i <= A[1]; ++i) {
    F[1][1 << i][i == A[1]] = 1;
    G[1][1 << i][i == A[1]] = i;
  }
  for (int i = 2; i <= n; ++i) {
    F[i][0][0] = F[i - 1][0][0];
    for (int s = 0; s < S; ++s) {
      int ss, v;
      for (int j = 0; j < 10; ++j) {
        if (s == 0 && j == 0) continue;
        ss = s | (1 << j);
        if (!f[ss]) continue;
        if (j < A[i]) {
          v = add(F[i - 1][s][0], F[i - 1][s][1]);
          F[i][ss][0] = add(F[i][ss][0], v);
          G[i][ss][0] =
              add(G[i][ss][0],
                  1LL * add(G[i - 1][s][0], G[i - 1][s][1]) * 10 % MOD);
          G[i][ss][0] = add(G[i][ss][0], 1LL * v * j % MOD);
        } else if (j == A[i]) {
          F[i][ss][1] = add(F[i][ss][1], F[i - 1][s][1]);
          G[i][ss][1] = add(G[i][ss][1], add(1LL * G[i - 1][s][1] * 10 % MOD,
                                             1LL * F[i - 1][s][1] * j % MOD));
          F[i][ss][0] = add(F[i][ss][0], F[i - 1][s][0]);
          G[i][ss][0] = add(G[i][ss][0], add(1LL * G[i - 1][s][0] * 10 % MOD,
                                             1LL * F[i - 1][s][0] * j % MOD));
        } else {
          F[i][ss][0] = add(F[i][ss][0], F[i - 1][s][0]);
          G[i][ss][0] = add(G[i][ss][0], add(1LL * G[i - 1][s][0] * 10 % MOD,
                                             1LL * F[i - 1][s][0] * j % MOD));
        }
      }
    }
  }
  int Ans = 0;
  for (int s = 0; s < S; ++s)
    if (f[s]) {
      Ans = add(Ans, G[n][s][0]);
      Ans = add(Ans, G[n][s][1]);
    }
  return Ans;
}
int main() {
  cin >> L >> R >> K;
  S = 1 << 10;
  for (int i = 0; i < S; ++i) f[i] = check(i);
  int v = Cal(R) - Cal(L - 1);
  if (v < 0) v += MOD;
  printf("%d\n", v);
  return 0;
}

```