#include <bits/stdc++.h>
using namespace std;
const long long MOD = 998244353;
long long l, r;
int k;
long long pot[20];
long long ways[20][1 << 10][2][2];
long long ans[20][1 << 10][2][2];
int obits(int x) {
  int ret = 0;
  while (x != 0) {
    ret += x & 1;
    x /= 2;
  }
  return ret;
}
int dig(int pos, long long x) { return (x / pot[pos]) % 10; }
long long gnum = 0;
long long f(int pos, int mk, bool ls, bool pc, long long x) {
  if (pos == -1) return (obits(mk) <= k && pc);
  if (ways[pos][mk][ls][pc] != -1) return ways[pos][mk][ls][pc];
  long long ret = 0;
  if (ls)
    for (int i = 0; i <= 9; i++) {
      if (!pc && i == 0)
        ret += f(pos - 1, mk, ls, pc | (i != 0), x);
      else
        ret += f(pos - 1, mk | (1 << i), ls, pc | (i != 0), x);
      ret %= MOD;
    }
  else
    for (int i = 0; i <= dig(pos, x); i++) {
      if (!pc && i == 0)
        ret += f(pos - 1, mk, i < dig(pos, x), pc | (i != 0), x);
      else
        ret += f(pos - 1, mk | (1 << i), i < dig(pos, x), pc | (i != 0), x);
      ret %= MOD;
    }
  return ways[pos][mk][ls][pc] = ret;
}
long long g(int pos, int mk, bool ls, bool pc, long long x) {
  if (pos == -1) return 0;
  if (ans[pos][mk][ls][pc] != -1) return ans[pos][mk][ls][pc];
  long long ret = 0;
  if (ls)
    for (int i = 0; i <= 9; i++) {
      if (!pc && i == 0)
        ret += g(pos - 1, mk, ls, pc | (i != 0), x) +
               pot[pos] % MOD * i * f(pos - 1, mk, ls, pc | (i != 0), x);
      else
        ret += g(pos - 1, mk | (1 << i), ls, pc | (i != 0), x) +
               pot[pos] % MOD * i *
                   f(pos - 1, mk | (1 << i), ls, pc | (i != 0), x);
      ret %= MOD;
    }
  else
    for (int i = 0; i <= dig(pos, x); i++) {
      if (!pc && i == 0)
        ret += g(pos - 1, mk, i < dig(pos, x), pc | (i != 0), x) +
               pot[pos] % MOD * i *
                   f(pos - 1, mk, i < dig(pos, x), pc | (i != 0), x);
      else
        ret += g(pos - 1, mk | (1 << i), i < dig(pos, x), pc | (i != 0), x) +
               pot[pos] % MOD * i *
                   f(pos - 1, mk | (1 << i), i < dig(pos, x), pc | (i != 0), x);
      ret %= MOD;
    }
  return ans[pos][mk][ls][pc] = ret;
}
int main() {
  cout << setprecision(10);
  ios::sync_with_stdio(0);
  cin.tie(0);
  pot[0] = 1;
  for (int i = 1; i < 19; i++) pot[i] = pot[i - 1] * 10;
  cin >> l >> r >> k;
  memset(ways, -1, sizeof ways);
  memset(ans, -1, sizeof ans);
  long long A = g(18, 0, 0, 0, r);
  memset(ways, -1, sizeof ways);
  memset(ans, -1, sizeof ans);
  long long B;
  if (l == 1)
    B = 0;
  else
    B = g(18, 0, 0, 0, l - 1);
  cout << (A - B + MOD) % MOD << '\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 long long MOD = 998244353;
long long l, r;
int k;
long long pot[20];
long long ways[20][1 << 10][2][2];
long long ans[20][1 << 10][2][2];
int obits(int x) {
  int ret = 0;
  while (x != 0) {
    ret += x & 1;
    x /= 2;
  }
  return ret;
}
int dig(int pos, long long x) { return (x / pot[pos]) % 10; }
long long gnum = 0;
long long f(int pos, int mk, bool ls, bool pc, long long x) {
  if (pos == -1) return (obits(mk) <= k && pc);
  if (ways[pos][mk][ls][pc] != -1) return ways[pos][mk][ls][pc];
  long long ret = 0;
  if (ls)
    for (int i = 0; i <= 9; i++) {
      if (!pc && i == 0)
        ret += f(pos - 1, mk, ls, pc | (i != 0), x);
      else
        ret += f(pos - 1, mk | (1 << i), ls, pc | (i != 0), x);
      ret %= MOD;
    }
  else
    for (int i = 0; i <= dig(pos, x); i++) {
      if (!pc && i == 0)
        ret += f(pos - 1, mk, i < dig(pos, x), pc | (i != 0), x);
      else
        ret += f(pos - 1, mk | (1 << i), i < dig(pos, x), pc | (i != 0), x);
      ret %= MOD;
    }
  return ways[pos][mk][ls][pc] = ret;
}
long long g(int pos, int mk, bool ls, bool pc, long long x) {
  if (pos == -1) return 0;
  if (ans[pos][mk][ls][pc] != -1) return ans[pos][mk][ls][pc];
  long long ret = 0;
  if (ls)
    for (int i = 0; i <= 9; i++) {
      if (!pc && i == 0)
        ret += g(pos - 1, mk, ls, pc | (i != 0), x) +
               pot[pos] % MOD * i * f(pos - 1, mk, ls, pc | (i != 0), x);
      else
        ret += g(pos - 1, mk | (1 << i), ls, pc | (i != 0), x) +
               pot[pos] % MOD * i *
                   f(pos - 1, mk | (1 << i), ls, pc | (i != 0), x);
      ret %= MOD;
    }
  else
    for (int i = 0; i <= dig(pos, x); i++) {
      if (!pc && i == 0)
        ret += g(pos - 1, mk, i < dig(pos, x), pc | (i != 0), x) +
               pot[pos] % MOD * i *
                   f(pos - 1, mk, i < dig(pos, x), pc | (i != 0), x);
      else
        ret += g(pos - 1, mk | (1 << i), i < dig(pos, x), pc | (i != 0), x) +
               pot[pos] % MOD * i *
                   f(pos - 1, mk | (1 << i), i < dig(pos, x), pc | (i != 0), x);
      ret %= MOD;
    }
  return ans[pos][mk][ls][pc] = ret;
}
int main() {
  cout << setprecision(10);
  ios::sync_with_stdio(0);
  cin.tie(0);
  pot[0] = 1;
  for (int i = 1; i < 19; i++) pot[i] = pot[i - 1] * 10;
  cin >> l >> r >> k;
  memset(ways, -1, sizeof ways);
  memset(ans, -1, sizeof ans);
  long long A = g(18, 0, 0, 0, r);
  memset(ways, -1, sizeof ways);
  memset(ans, -1, sizeof ans);
  long long B;
  if (l == 1)
    B = 0;
  else
    B = g(18, 0, 0, 0, l - 1);
  cout << (A - B + MOD) % MOD << '\n';
  return 0;
}

```