#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vpii = vector<pii>;
using vl = vector<ll>;
using ld = long double;
using vs = vector<string>;
const int MAX_LEN = 20;
const int MAX_K = 12;
const int MOD = 998244353;
int cc[MAX_LEN][(1 << (MAX_K))][2];
int ss[MAX_LEN][(1 << (MAX_K))][2];
int K;
vi num;
ll pw[20];
void add(int &x, int y) {
  x += y;
  while (x >= MOD) x -= MOD;
  while (x < 0) x += MOD;
}
int go(int n, int mask, bool pref) {
  auto &cnt = cc[n][mask][pref];
  auto &sum = ss[n][mask][pref];
  if (cnt != -1) return cnt;
  cnt = 0;
  sum = 0;
  if (n == (int)num.size()) {
    return cnt = 1;
  }
  int nsz = (int)num.size();
  for (int d = 0; d <= (pref ? num[n] : 9); d++) {
    int n_mask = (mask | (1 << (d)));
    if (mask == 0 && d == 0) n_mask = 0;
    if (__builtin_popcount(n_mask) <= K) {
      int cc_to = go(n + 1, n_mask, pref & (d == num[n]));
      int ss_to = ss[n + 1][n_mask][pref & (d == num[n])];
      int ss_x = (((cc_to * 1LL * pw[nsz - n - 1]) % MOD) * 1LL * d) % MOD;
      add(ss_x, ss_to);
      add(sum, ss_x);
      add(cnt, cc_to);
    }
  }
  return cnt;
}
void precalc() {
  pw[0] = 1;
  for (int i = 1; i < 20; i++) pw[i] = (pw[i - 1] * 10LL) % MOD;
}
int calc(ll x) {
  memset(cc, -1, sizeof(cc));
  memset(ss, -1, sizeof(ss));
  num.clear();
  while (x) {
    num.push_back(x % 10);
    x /= 10;
  }
  if (num.empty()) num.push_back(0);
  reverse((num).begin(), (num).end());
  go(0, 0, 1);
  int sum = ss[0][0][1];
  return sum;
}
void solve() {
  precalc();
  ll L, R;
  cin >> L >> R >> K;
  int vx = calc(R);
  int vy = calc(L - 1);
  int ans = 0;
  add(ans, vx);
  add(ans, -vy);
  cout << ans;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  clock_t start = clock();
  solve();
  cerr << ((double)clock() - start) / CLOCKS_PER_SEC << " sec.";
  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;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vpii = vector<pii>;
using vl = vector<ll>;
using ld = long double;
using vs = vector<string>;
const int MAX_LEN = 20;
const int MAX_K = 12;
const int MOD = 998244353;
int cc[MAX_LEN][(1 << (MAX_K))][2];
int ss[MAX_LEN][(1 << (MAX_K))][2];
int K;
vi num;
ll pw[20];
void add(int &x, int y) {
  x += y;
  while (x >= MOD) x -= MOD;
  while (x < 0) x += MOD;
}
int go(int n, int mask, bool pref) {
  auto &cnt = cc[n][mask][pref];
  auto &sum = ss[n][mask][pref];
  if (cnt != -1) return cnt;
  cnt = 0;
  sum = 0;
  if (n == (int)num.size()) {
    return cnt = 1;
  }
  int nsz = (int)num.size();
  for (int d = 0; d <= (pref ? num[n] : 9); d++) {
    int n_mask = (mask | (1 << (d)));
    if (mask == 0 && d == 0) n_mask = 0;
    if (__builtin_popcount(n_mask) <= K) {
      int cc_to = go(n + 1, n_mask, pref & (d == num[n]));
      int ss_to = ss[n + 1][n_mask][pref & (d == num[n])];
      int ss_x = (((cc_to * 1LL * pw[nsz - n - 1]) % MOD) * 1LL * d) % MOD;
      add(ss_x, ss_to);
      add(sum, ss_x);
      add(cnt, cc_to);
    }
  }
  return cnt;
}
void precalc() {
  pw[0] = 1;
  for (int i = 1; i < 20; i++) pw[i] = (pw[i - 1] * 10LL) % MOD;
}
int calc(ll x) {
  memset(cc, -1, sizeof(cc));
  memset(ss, -1, sizeof(ss));
  num.clear();
  while (x) {
    num.push_back(x % 10);
    x /= 10;
  }
  if (num.empty()) num.push_back(0);
  reverse((num).begin(), (num).end());
  go(0, 0, 1);
  int sum = ss[0][0][1];
  return sum;
}
void solve() {
  precalc();
  ll L, R;
  cin >> L >> R >> K;
  int vx = calc(R);
  int vy = calc(L - 1);
  int ans = 0;
  add(ans, vx);
  add(ans, -vy);
  cout << ans;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  clock_t start = clock();
  solve();
  cerr << ((double)clock() - start) / CLOCKS_PER_SEC << " sec.";
  return 0;
}

```