#include <bits/stdc++.h>
using namespace std;
long long int XpowerY(long long int x, long long int y, long long int m) {
  long long int ans = 1;
  x = x % m;
  while (y > 0) {
    if (y % 2 == 1) ans = (ans * x) % m;
    x = ((x % m) * (x % m)) % m;
    y = y >> 1;
  }
  return ans % m;
}
long long int dp[20][2048][3], dp2[20][2048][3];
long long int pw[30];
long long int l, r, k;
long long int digs(long long int n) {
  long long int ans = 0;
  while (n) ans++, n /= 10;
  return ans;
}
string numbers(long long int n) {
  string s = to_string(n);
  reverse(s.begin(), s.end());
  return s;
}
string to_bin(long long int n) {
  string ans = "";
  while (n) {
    if (n % 2)
      ans += '1';
    else
      ans += '0';
    n /= 2;
  }
  return ans;
}
long long int bits_count(long long int n) {
  long long int ans = 0;
  while (n) ans += (n % 2), n /= 2;
  return ans;
}
void init() {
  long long int temp = 10;
  pw[0] = 1;
  for (long long int i = 1; i <= 18; i++) {
    pw[i] = temp % 998244353, temp = (temp * 10) % 998244353;
  }
}
long long int dfs(long long int index, long long int small, long long int k1,
                  string number) {
  if (index == -1) return 1;
  if (dp2[index][k1][small] != -1) return (dp2[index][k1][small]) % 998244353;
  dp[index][k1][small] = 0;
  long long int lim = 9;
  if (small) lim = number[index] - '0';
  long long int no = 0, ret;
  for (long long int i = 0; i <= lim; i++) {
    long long int small2 = 0;
    if (small and i == lim) small2 = 1;
    long long int bits;
    if (k1 == 0 and i == 0)
      bits = 0;
    else
      bits = (k1 | (1 << i));
    if (bits_count(bits) <= k) {
      long long int ret = dfs(index - 1, small2, bits, number) % 998244353, add;
      no = (no + ret) % 998244353;
      if (index == 0)
        add = 0;
      else
        add = dp[index - 1][bits][small2] % 998244353;
      dp[index][k1][small] =
          (dp[index][k1][small] % 998244353 +
           (((i * pw[index]) % 998244353) * ret) % 998244353 +
           add % 998244353) %
          998244353;
      ;
    }
  }
  return dp2[index][k1][small] = no % 998244353;
}
int main() {
  init();
  cin >> l >> r >> k;
  memset(dp, -1, sizeof(dp));
  memset(dp2, -1, sizeof(dp2));
  string num1 = numbers(r);
  long long int r1;
  dfs(num1.size() - 1, 1, 0, num1);
  r1 = dp[num1.size() - 1][0][1];
  memset(dp2, -1, sizeof(dp2));
  memset(dp, -1, sizeof(dp));
  string num2 = numbers(l - 1);
  long long int l1;
  dfs(num2.size() - 1, 1, 0, num2);
  l1 = dp[num2.size() - 1][0][1];
  ;
  cout << (r1 - l1 + 998244353) % 998244353 << endl;
  return 0;
}

### Prompt

Please provide a CPP coded solution to the problem described below:

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 int XpowerY(long long int x, long long int y, long long int m) {
  long long int ans = 1;
  x = x % m;
  while (y > 0) {
    if (y % 2 == 1) ans = (ans * x) % m;
    x = ((x % m) * (x % m)) % m;
    y = y >> 1;
  }
  return ans % m;
}
long long int dp[20][2048][3], dp2[20][2048][3];
long long int pw[30];
long long int l, r, k;
long long int digs(long long int n) {
  long long int ans = 0;
  while (n) ans++, n /= 10;
  return ans;
}
string numbers(long long int n) {
  string s = to_string(n);
  reverse(s.begin(), s.end());
  return s;
}
string to_bin(long long int n) {
  string ans = "";
  while (n) {
    if (n % 2)
      ans += '1';
    else
      ans += '0';
    n /= 2;
  }
  return ans;
}
long long int bits_count(long long int n) {
  long long int ans = 0;
  while (n) ans += (n % 2), n /= 2;
  return ans;
}
void init() {
  long long int temp = 10;
  pw[0] = 1;
  for (long long int i = 1; i <= 18; i++) {
    pw[i] = temp % 998244353, temp = (temp * 10) % 998244353;
  }
}
long long int dfs(long long int index, long long int small, long long int k1,
                  string number) {
  if (index == -1) return 1;
  if (dp2[index][k1][small] != -1) return (dp2[index][k1][small]) % 998244353;
  dp[index][k1][small] = 0;
  long long int lim = 9;
  if (small) lim = number[index] - '0';
  long long int no = 0, ret;
  for (long long int i = 0; i <= lim; i++) {
    long long int small2 = 0;
    if (small and i == lim) small2 = 1;
    long long int bits;
    if (k1 == 0 and i == 0)
      bits = 0;
    else
      bits = (k1 | (1 << i));
    if (bits_count(bits) <= k) {
      long long int ret = dfs(index - 1, small2, bits, number) % 998244353, add;
      no = (no + ret) % 998244353;
      if (index == 0)
        add = 0;
      else
        add = dp[index - 1][bits][small2] % 998244353;
      dp[index][k1][small] =
          (dp[index][k1][small] % 998244353 +
           (((i * pw[index]) % 998244353) * ret) % 998244353 +
           add % 998244353) %
          998244353;
      ;
    }
  }
  return dp2[index][k1][small] = no % 998244353;
}
int main() {
  init();
  cin >> l >> r >> k;
  memset(dp, -1, sizeof(dp));
  memset(dp2, -1, sizeof(dp2));
  string num1 = numbers(r);
  long long int r1;
  dfs(num1.size() - 1, 1, 0, num1);
  r1 = dp[num1.size() - 1][0][1];
  memset(dp2, -1, sizeof(dp2));
  memset(dp, -1, sizeof(dp));
  string num2 = numbers(l - 1);
  long long int l1;
  dfs(num2.size() - 1, 1, 0, num2);
  l1 = dp[num2.size() - 1][0][1];
  ;
  cout << (r1 - l1 + 998244353) % 998244353 << endl;
  return 0;
}

```