#include <bits/stdc++.h>
using namespace std;
const int MOD = 998244353, CANTD = 19, SIZE = 1 << 10;
long long dp[CANTD][SIZE][2], pot10[CANTD];
long long dps[CANTD][SIZE][2];
long long sum(long long a, long long b) { return (1LL * (a + b) + MOD) % MOD; }
long long mult(long long a, long long b) { return 1LL * a * b % MOD; }
string to_string2(long long n) {
  string ns = "";
  while (n) {
    ns += '0' + (n % 10);
    n /= 10;
  }
  ns += " ";
  reverse(ns.begin(), ns.end());
  return ns;
}
long long f(string n, int K) {
  for (int i = 1; i < n.size(); i++) {
    for (int j = 0; j < SIZE; j++) {
      dp[i][j][0] = dp[i][j][1] = dps[i][j][0] = dps[i][j][1] = 0;
    }
  }
  dp[0][0][1] = 1;
  for (int i = 1; i < n.size(); i++) {
    int dig = n[i] - '0';
    for (int mask = 0; mask < SIZE; mask++) {
      for (int k = (i == 1); k < 10; k++) {
        int new_mask = mask | (1 << k);
        dp[i][new_mask][0] =
            sum(dp[i - 1][mask][0] + (k < dig) * dp[i - 1][mask][1],
                dp[i][new_mask][0]);
        if (k == dig)
          dp[i][new_mask][1] = sum(dp[i][new_mask][1], dp[i - 1][mask][1]);
      }
      for (int k = (i == 1); k < 10; k++) {
        int new_mask = mask | (1 << k);
        dps[i][new_mask][0] =
            sum(dps[i][new_mask][0],
                dp[i - 1][mask][0] * k % MOD * pot10[n.size() - i - 1] % MOD +
                    dps[i - 1][mask][0]);
        dps[i][new_mask][0] = sum(
            dps[i][new_mask][0],
            (k < dig) *
                (dp[i - 1][mask][1] * k % MOD * pot10[n.size() - i - 1] % MOD +
                 dps[i - 1][mask][1]));
        if (k == dig)
          dps[i][new_mask][1] =
              sum(dps[i][new_mask][1],
                  dp[i - 1][mask][1] * k % MOD * pot10[n.size() - i - 1] % MOD +
                      dps[i - 1][mask][1]);
      }
    }
  }
  long long sol = 0;
  for (int mask = 0; mask < SIZE; mask++)
    if (__builtin_popcount(mask) <= K)
      sol =
          sum(sol, sum(dps[n.size() - 1][mask][0], dps[n.size() - 1][mask][1]));
  return sol;
}
long long f(long long n, int k) {
  if (n == 0) return 0;
  long long ret = f(to_string2(n), k);
  for (int i = 1; n > 9; i++, n /= 10)
    ret = sum(f(" " + string(i, '9'), k), ret);
  return ret;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  pot10[0] = 1;
  for (int i = 1; i < CANTD; i++) pot10[i] = pot10[i - 1] * 10 % MOD;
  long long l, r;
  short k;
  cin >> l >> r >> k;
  cout << sum(f(r, k), -f(l - 1, k)) << '\n';
  return 0;
}

### Prompt

In cpp, your task is to solve 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 MOD = 998244353, CANTD = 19, SIZE = 1 << 10;
long long dp[CANTD][SIZE][2], pot10[CANTD];
long long dps[CANTD][SIZE][2];
long long sum(long long a, long long b) { return (1LL * (a + b) + MOD) % MOD; }
long long mult(long long a, long long b) { return 1LL * a * b % MOD; }
string to_string2(long long n) {
  string ns = "";
  while (n) {
    ns += '0' + (n % 10);
    n /= 10;
  }
  ns += " ";
  reverse(ns.begin(), ns.end());
  return ns;
}
long long f(string n, int K) {
  for (int i = 1; i < n.size(); i++) {
    for (int j = 0; j < SIZE; j++) {
      dp[i][j][0] = dp[i][j][1] = dps[i][j][0] = dps[i][j][1] = 0;
    }
  }
  dp[0][0][1] = 1;
  for (int i = 1; i < n.size(); i++) {
    int dig = n[i] - '0';
    for (int mask = 0; mask < SIZE; mask++) {
      for (int k = (i == 1); k < 10; k++) {
        int new_mask = mask | (1 << k);
        dp[i][new_mask][0] =
            sum(dp[i - 1][mask][0] + (k < dig) * dp[i - 1][mask][1],
                dp[i][new_mask][0]);
        if (k == dig)
          dp[i][new_mask][1] = sum(dp[i][new_mask][1], dp[i - 1][mask][1]);
      }
      for (int k = (i == 1); k < 10; k++) {
        int new_mask = mask | (1 << k);
        dps[i][new_mask][0] =
            sum(dps[i][new_mask][0],
                dp[i - 1][mask][0] * k % MOD * pot10[n.size() - i - 1] % MOD +
                    dps[i - 1][mask][0]);
        dps[i][new_mask][0] = sum(
            dps[i][new_mask][0],
            (k < dig) *
                (dp[i - 1][mask][1] * k % MOD * pot10[n.size() - i - 1] % MOD +
                 dps[i - 1][mask][1]));
        if (k == dig)
          dps[i][new_mask][1] =
              sum(dps[i][new_mask][1],
                  dp[i - 1][mask][1] * k % MOD * pot10[n.size() - i - 1] % MOD +
                      dps[i - 1][mask][1]);
      }
    }
  }
  long long sol = 0;
  for (int mask = 0; mask < SIZE; mask++)
    if (__builtin_popcount(mask) <= K)
      sol =
          sum(sol, sum(dps[n.size() - 1][mask][0], dps[n.size() - 1][mask][1]));
  return sol;
}
long long f(long long n, int k) {
  if (n == 0) return 0;
  long long ret = f(to_string2(n), k);
  for (int i = 1; n > 9; i++, n /= 10)
    ret = sum(f(" " + string(i, '9'), k), ret);
  return ret;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  pot10[0] = 1;
  for (int i = 1; i < CANTD; i++) pot10[i] = pot10[i - 1] * 10 % MOD;
  long long l, r;
  short k;
  cin >> l >> r >> k;
  cout << sum(f(r, k), -f(l - 1, k)) << '\n';
  return 0;
}

```