#include <bits/stdc++.h>
using namespace std;
long long k;
pair<long long, long long> dp[2][20][(1 << 11)];
long long pow1[30];
void pre() {
  pow1[0] = 1;
  for (long long i = 1; i < 30; i++) pow1[i] = (pow1[i - 1] * 10) % 998244353;
}
pair<long long, long long> solverem(long long zeroflag, long long rem,
                                    long long mask) {
  pair<long long, long long> &w = dp[zeroflag][rem][mask];
  if (__builtin_popcount(mask) > k) return {0, 0};
  if (w.first != -1) return w;
  if (rem == 0 && (__builtin_popcount(mask) <= k)) return {1, 0};
  w = {0, 0};
  if (zeroflag) {
    w = solverem(zeroflag, rem - 1, mask);
    for (long long j = 1; j < 10; j++) {
      pair<long long, long long> res = solverem(0, rem - 1, mask | (1 << j));
      w.second = ((w.second +
                   ((pow1[rem - 1] * j) % 998244353 * res.first) % 998244353) %
                      998244353 +
                  res.second) %
                 998244353;
      w.first = (w.first + res.first) % 998244353;
    }
  } else {
    for (long long j = 0; j < 10; j++) {
      pair<long long, long long> res = solverem(0, rem - 1, mask | (1 << j));
      w.second = ((w.second +
                   ((pow1[rem - 1] * j) % 998244353 * res.first) % 998244353) %
                      998244353 +
                  res.second) %
                 998244353;
      w.first = (w.first + res.first) % 998244353;
    }
  }
  w.first = w.first % 998244353;
  w.second = w.second % 998244353;
  return w;
}
string getString(long long x) {
  stack<long long> st;
  while (x >= 1) {
    st.push(x % 10);
    x /= 10;
  }
  string str = "";
  while (!st.empty()) {
    long long temp = st.top();
    str += to_string(temp);
    st.pop();
  }
  return str;
}
long long solve(long long x) {
  memset(dp, -1, sizeof(dp));
  string a = getString(x);
  long long len = a.length();
  pair<long long, long long> ans = {0, 0};
  long long mask = 0;
  long long prev1 = 0;
  long long flag2 = 0;
  for (long long i = 0; i < len; i++) {
    if (__builtin_popcount(mask) > k) break;
    for (long long j = 0; j < (a[i] - '0'); j++) {
      long long tempmask = (j == 0 && flag2 == 0) ? mask : (mask | (1 << (j)));
      pair<long long, long long> res =
          solverem((j == 0 && flag2 == 0), len - i - 1, tempmask);
      ans.second = ((ans.second + res.second) % 998244353 +
                    ((res.first * pow1[len - i - 1]) % 998244353 *
                     ((prev1 * 10LL) % 998244353 + j) % 998244353) %
                        998244353) %
                   998244353;
    }
    mask = mask | (1 << (a[i] - '0'));
    prev1 = (((prev1 * 10) % 998244353 + (a[i] - '0'))) % 998244353;
    flag2 = 1;
  }
  if (__builtin_popcount(mask) <= k) ans.second = (ans.second + x) % 998244353;
  return ans.second;
}
int main() {
  pre();
  pair<long long, long long> dp[2][20][(1 << 11)];
  for (long long i = 0; i < 2; i++) {
    for (long long j = 0; j < 20; j++) {
      for (long long k1 = 0; k1 < (1 << 11); k1++) dp[i][j][k] = {-1, -1};
    }
  }
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long l, r;
  cin >> l >> r >> k;
  cout << (solve(r) % 998244353 + (998244353 - solve(l - 1)) % 998244353) %
              998244353
       << endl;
}

### Prompt

Your challenge is to write 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 k;
pair<long long, long long> dp[2][20][(1 << 11)];
long long pow1[30];
void pre() {
  pow1[0] = 1;
  for (long long i = 1; i < 30; i++) pow1[i] = (pow1[i - 1] * 10) % 998244353;
}
pair<long long, long long> solverem(long long zeroflag, long long rem,
                                    long long mask) {
  pair<long long, long long> &w = dp[zeroflag][rem][mask];
  if (__builtin_popcount(mask) > k) return {0, 0};
  if (w.first != -1) return w;
  if (rem == 0 && (__builtin_popcount(mask) <= k)) return {1, 0};
  w = {0, 0};
  if (zeroflag) {
    w = solverem(zeroflag, rem - 1, mask);
    for (long long j = 1; j < 10; j++) {
      pair<long long, long long> res = solverem(0, rem - 1, mask | (1 << j));
      w.second = ((w.second +
                   ((pow1[rem - 1] * j) % 998244353 * res.first) % 998244353) %
                      998244353 +
                  res.second) %
                 998244353;
      w.first = (w.first + res.first) % 998244353;
    }
  } else {
    for (long long j = 0; j < 10; j++) {
      pair<long long, long long> res = solverem(0, rem - 1, mask | (1 << j));
      w.second = ((w.second +
                   ((pow1[rem - 1] * j) % 998244353 * res.first) % 998244353) %
                      998244353 +
                  res.second) %
                 998244353;
      w.first = (w.first + res.first) % 998244353;
    }
  }
  w.first = w.first % 998244353;
  w.second = w.second % 998244353;
  return w;
}
string getString(long long x) {
  stack<long long> st;
  while (x >= 1) {
    st.push(x % 10);
    x /= 10;
  }
  string str = "";
  while (!st.empty()) {
    long long temp = st.top();
    str += to_string(temp);
    st.pop();
  }
  return str;
}
long long solve(long long x) {
  memset(dp, -1, sizeof(dp));
  string a = getString(x);
  long long len = a.length();
  pair<long long, long long> ans = {0, 0};
  long long mask = 0;
  long long prev1 = 0;
  long long flag2 = 0;
  for (long long i = 0; i < len; i++) {
    if (__builtin_popcount(mask) > k) break;
    for (long long j = 0; j < (a[i] - '0'); j++) {
      long long tempmask = (j == 0 && flag2 == 0) ? mask : (mask | (1 << (j)));
      pair<long long, long long> res =
          solverem((j == 0 && flag2 == 0), len - i - 1, tempmask);
      ans.second = ((ans.second + res.second) % 998244353 +
                    ((res.first * pow1[len - i - 1]) % 998244353 *
                     ((prev1 * 10LL) % 998244353 + j) % 998244353) %
                        998244353) %
                   998244353;
    }
    mask = mask | (1 << (a[i] - '0'));
    prev1 = (((prev1 * 10) % 998244353 + (a[i] - '0'))) % 998244353;
    flag2 = 1;
  }
  if (__builtin_popcount(mask) <= k) ans.second = (ans.second + x) % 998244353;
  return ans.second;
}
int main() {
  pre();
  pair<long long, long long> dp[2][20][(1 << 11)];
  for (long long i = 0; i < 2; i++) {
    for (long long j = 0; j < 20; j++) {
      for (long long k1 = 0; k1 < (1 << 11); k1++) dp[i][j][k] = {-1, -1};
    }
  }
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long l, r;
  cin >> l >> r >> k;
  cout << (solve(r) % 998244353 + (998244353 - solve(l - 1)) % 998244353) %
              998244353
       << endl;
}

```