#include <bits/stdc++.h>
using namespace std;
int f[20][2][1 << 10], g[20][2][2][1 << 10];
int cnt = 0;
int d[20], pw[20];
int add(int a, int b) {
  a += b;
  if (a >= 998244353) a -= 998244353;
  return a;
}
int mul(int a, int b) { return 1ll * a * b % 998244353; }
int k;
int fun(int id, int flag, int mask) {
  if (id == cnt + 1) return 1;
  if (~f[id][flag][mask]) return f[id][flag][mask];
  int maxd = (flag == 1 ? 9 : d[id]);
  f[id][flag][mask] = 0;
  int &ans = f[id][flag][mask];
  for (int i = 0; i <= maxd; ++i) {
    int nf = flag;
    if (nf == 0 && i < maxd) nf = 1;
    int nmask = mask | (1 << i);
    if (__builtin_popcount(nmask) > k) continue;
    ans = add(ans, fun(id + 1, nf, nmask));
  }
  return ans;
}
int dp(int id, int lead, int flag, int mask) {
  if (id == cnt + 1) return 0;
  if (~g[id][lead][flag][mask]) return g[id][lead][flag][mask];
  int maxd = (flag == 1 ? 9 : d[id]);
  g[id][lead][flag][mask] = 0;
  int &ans = g[id][lead][flag][mask];
  for (int i = 0; i <= maxd; ++i) {
    int nf = flag;
    if (nf == 0 && i < maxd) nf = 1;
    int nmask = mask;
    if (lead > 0 || i > 0) nmask = nmask | (1 << i);
    if (__builtin_popcount(nmask) > k) continue;
    int w = fun(id + 1, nf, nmask);
    ans = add(ans, add(mul(w, mul(i, pw[cnt - id])),
                       dp(id + 1, lead | (i > 0), nf, nmask)));
  }
  return ans;
}
int solve(long long x) {
  memset(f, 0xff, sizeof f);
  memset(g, 0xff, sizeof g);
  if (x == 0) return 0;
  cnt = 0;
  while (x) {
    d[++cnt] = x % 10;
    x /= 10;
  }
  reverse(d + 1, d + cnt + 1);
  return dp(1, 0, 0, 0);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long l, r;
  cin >> l >> r;
  cin >> k;
  pw[0] = 1;
  for (int i = 1; i < 20; ++i) pw[i] = mul(pw[i - 1], 10);
  cout << (solve(r) - solve(l - 1) + 998244353) % 998244353;
  return 0;
}

### Prompt

Construct a CPP code solution to the problem outlined:

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;
int f[20][2][1 << 10], g[20][2][2][1 << 10];
int cnt = 0;
int d[20], pw[20];
int add(int a, int b) {
  a += b;
  if (a >= 998244353) a -= 998244353;
  return a;
}
int mul(int a, int b) { return 1ll * a * b % 998244353; }
int k;
int fun(int id, int flag, int mask) {
  if (id == cnt + 1) return 1;
  if (~f[id][flag][mask]) return f[id][flag][mask];
  int maxd = (flag == 1 ? 9 : d[id]);
  f[id][flag][mask] = 0;
  int &ans = f[id][flag][mask];
  for (int i = 0; i <= maxd; ++i) {
    int nf = flag;
    if (nf == 0 && i < maxd) nf = 1;
    int nmask = mask | (1 << i);
    if (__builtin_popcount(nmask) > k) continue;
    ans = add(ans, fun(id + 1, nf, nmask));
  }
  return ans;
}
int dp(int id, int lead, int flag, int mask) {
  if (id == cnt + 1) return 0;
  if (~g[id][lead][flag][mask]) return g[id][lead][flag][mask];
  int maxd = (flag == 1 ? 9 : d[id]);
  g[id][lead][flag][mask] = 0;
  int &ans = g[id][lead][flag][mask];
  for (int i = 0; i <= maxd; ++i) {
    int nf = flag;
    if (nf == 0 && i < maxd) nf = 1;
    int nmask = mask;
    if (lead > 0 || i > 0) nmask = nmask | (1 << i);
    if (__builtin_popcount(nmask) > k) continue;
    int w = fun(id + 1, nf, nmask);
    ans = add(ans, add(mul(w, mul(i, pw[cnt - id])),
                       dp(id + 1, lead | (i > 0), nf, nmask)));
  }
  return ans;
}
int solve(long long x) {
  memset(f, 0xff, sizeof f);
  memset(g, 0xff, sizeof g);
  if (x == 0) return 0;
  cnt = 0;
  while (x) {
    d[++cnt] = x % 10;
    x /= 10;
  }
  reverse(d + 1, d + cnt + 1);
  return dp(1, 0, 0, 0);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long l, r;
  cin >> l >> r;
  cin >> k;
  pw[0] = 1;
  for (int i = 1; i < 20; ++i) pw[i] = mul(pw[i - 1], 10);
  cout << (solve(r) - solve(l - 1) + 998244353) % 998244353;
  return 0;
}

```