#include <bits/stdc++.h>
using namespace std;
long long l, r;
int k, len;
int mod = 998244353;
int dp1[20][1 << 10][2];
int dp2[20][1 << 10][2];
char u1[20][1 << 10][2];
char u2[20][1 << 10][2];
int bt[1 << 10], num[20], pw[20];
int add(int a, int b) { return (a + b) % mod; }
int mult(int a, int b) { return (a * 1LL * b) % mod; }
int calcdp1(int pos, int mask, int f) {
  if (pos >= len) return 1;
  if (u1[pos][mask][f]) return dp1[pos][mask][f];
  int &res = dp1[pos][mask][f];
  u1[pos][mask][f] = 1;
  if (f) {
    for (int i = (pos == 0); i <= num[pos]; i++) {
      if (bt[mask | (1 << i)] <= k)
        res = add(res, calcdp1(pos + 1, mask | (1 << i), (i == num[pos])));
    }
  } else {
    for (int i = 0; i < 10; i++) {
      if (bt[mask | (1 << i)] <= k)
        res = add(res, calcdp1(pos + 1, mask | (1 << i), 0));
    }
  }
  return res;
}
int calcdp2(int pos, int mask, int f) {
  if (pos >= len) return 0;
  if (u2[pos][mask][f]) return dp2[pos][mask][f];
  int &res = dp2[pos][mask][f];
  res = 0;
  u2[pos][mask][f] = 1;
  if (f) {
    for (int i = (pos == 0); i <= num[pos]; i++) {
      if (bt[mask | (1 << i)] <= k) {
        res = add(res, mult(calcdp1(pos + 1, mask | (1 << i), (i == num[pos])),
                            mult(pw[len - pos - 1], i)));
        res = add(res, calcdp2(pos + 1, mask | (1 << i), (i == num[pos])));
      }
    }
  } else {
    for (int i = 0; i < 10; i++) {
      if (bt[mask | (1 << i)] <= k) {
        res = add(res, mult(calcdp1(pos + 1, mask | (1 << i), 0),
                            mult(pw[len - pos - 1], i)));
        res = add(res, calcdp2(pos + 1, mask | (1 << i), 0));
      }
    }
  }
  return res;
}
int binpow(int a, int n) {
  int res = 1;
  while (n) {
    if (n & 1) res = mult(res, a);
    a = mult(a, a);
    n >>= 1;
  }
  return res;
}
int get(long long x) {
  memset(dp1, 0, sizeof dp1);
  memset(dp2, 0, sizeof dp2);
  memset(u1, 0, sizeof u1);
  memset(u2, 0, sizeof u2);
  len = 0;
  while (x) {
    num[len] = x % 10;
    x /= 10;
    len++;
  }
  reverse(num, num + len);
  return calcdp2(0, 0, 1);
}
int solve(long long x) {
  int res = get(x);
  len--;
  x = 0;
  for (int i = 0; i < len; i++) {
    x *= 10;
    x += 9;
  }
  while (x > 0) {
    res = add(res, get(x));
    x /= 10;
  }
  return res;
}
int main() {
  for (int i = 0; i < (1 << 10); i++) {
    bt[i] = __builtin_popcount(i);
  }
  pw[0] = 1;
  for (int i = 1; i < 20; i++) {
    pw[i] = mult(pw[i - 1], 10);
  }
  scanf("%lld %lld %d", &l, &r, &k);
  printf("%d\n", add(solve(r), mod - solve(l - 1)));
}

### 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 l, r;
int k, len;
int mod = 998244353;
int dp1[20][1 << 10][2];
int dp2[20][1 << 10][2];
char u1[20][1 << 10][2];
char u2[20][1 << 10][2];
int bt[1 << 10], num[20], pw[20];
int add(int a, int b) { return (a + b) % mod; }
int mult(int a, int b) { return (a * 1LL * b) % mod; }
int calcdp1(int pos, int mask, int f) {
  if (pos >= len) return 1;
  if (u1[pos][mask][f]) return dp1[pos][mask][f];
  int &res = dp1[pos][mask][f];
  u1[pos][mask][f] = 1;
  if (f) {
    for (int i = (pos == 0); i <= num[pos]; i++) {
      if (bt[mask | (1 << i)] <= k)
        res = add(res, calcdp1(pos + 1, mask | (1 << i), (i == num[pos])));
    }
  } else {
    for (int i = 0; i < 10; i++) {
      if (bt[mask | (1 << i)] <= k)
        res = add(res, calcdp1(pos + 1, mask | (1 << i), 0));
    }
  }
  return res;
}
int calcdp2(int pos, int mask, int f) {
  if (pos >= len) return 0;
  if (u2[pos][mask][f]) return dp2[pos][mask][f];
  int &res = dp2[pos][mask][f];
  res = 0;
  u2[pos][mask][f] = 1;
  if (f) {
    for (int i = (pos == 0); i <= num[pos]; i++) {
      if (bt[mask | (1 << i)] <= k) {
        res = add(res, mult(calcdp1(pos + 1, mask | (1 << i), (i == num[pos])),
                            mult(pw[len - pos - 1], i)));
        res = add(res, calcdp2(pos + 1, mask | (1 << i), (i == num[pos])));
      }
    }
  } else {
    for (int i = 0; i < 10; i++) {
      if (bt[mask | (1 << i)] <= k) {
        res = add(res, mult(calcdp1(pos + 1, mask | (1 << i), 0),
                            mult(pw[len - pos - 1], i)));
        res = add(res, calcdp2(pos + 1, mask | (1 << i), 0));
      }
    }
  }
  return res;
}
int binpow(int a, int n) {
  int res = 1;
  while (n) {
    if (n & 1) res = mult(res, a);
    a = mult(a, a);
    n >>= 1;
  }
  return res;
}
int get(long long x) {
  memset(dp1, 0, sizeof dp1);
  memset(dp2, 0, sizeof dp2);
  memset(u1, 0, sizeof u1);
  memset(u2, 0, sizeof u2);
  len = 0;
  while (x) {
    num[len] = x % 10;
    x /= 10;
    len++;
  }
  reverse(num, num + len);
  return calcdp2(0, 0, 1);
}
int solve(long long x) {
  int res = get(x);
  len--;
  x = 0;
  for (int i = 0; i < len; i++) {
    x *= 10;
    x += 9;
  }
  while (x > 0) {
    res = add(res, get(x));
    x /= 10;
  }
  return res;
}
int main() {
  for (int i = 0; i < (1 << 10); i++) {
    bt[i] = __builtin_popcount(i);
  }
  pw[0] = 1;
  for (int i = 1; i < 20; i++) {
    pw[i] = mult(pw[i - 1], 10);
  }
  scanf("%lld %lld %d", &l, &r, &k);
  printf("%d\n", add(solve(r), mod - solve(l - 1)));
}

```