#include <iostream>
#include <bits\stdc++.h>
#define fi first
#define se second
using namespace std;
long long l, r;
const long long md = 998244353;
long long k;
vector<int> modify1(long long v)
{
    vector<int> dg;
    long long c = v;
    while(c){dg.push_back(c % 10); c /= 10;}
    reverse(dg.begin(), dg.end());
    return dg;
}
vector<int> modify2(long long v)
{
    vector<int> dg = modify1(v);
    vector<int> z(dg.size() + 1);
    z[0] = 0;
    for(int i = 0; i < dg.size(); i++)
    {
        z[i + 1] = z[i] | (1 << dg[i]);
    }
    return z;
}
long long solve(long long v)
{
    pair<long long,long long> dp[25][1100];
    vector<int> dg = modify1(v);
    vector<int> z = modify2(v);
    z = modify2(v);
    int cur = 0;
    int di = dg.size();
    for(int i = 0; i < di; i++)
    {
        for(int l = 0; l < dg[i]; l++)
        {
            int z0 = z[i] | (1 << l);
            if(__builtin_popcount(z0) <= k)
            {
                dp[i + 1][z0].fi += cur * 10 + l;
                dp[i + 1][z0].fi %= md;
                dp[i + 1][z0].se++;
            }
        }
        cur *= 10;
        cur += dg[i];
        for(int t = 1; t < 1 << 10; t++)
        {
            for(int v = 0; v <= 9; v++)
            {
                if(__builtin_popcount(t | (1 << v)) <= k)
                {
                long long u = dp[i][t].se % md;
                u *= v;
                u %= md;
                dp[i + 1][t | (1 << v)].fi += ((10 * dp[i][t].fi + u) % md);
                dp[i + 1][t | (1 << v)].fi %= md;
                dp[i + 1][t | (1 << v)].se += dp[i][t].se;
                }
            }
        }
    }
    long long res = 0;
    for(int i = 1; i < 1 << 10; i++)
    {
        res += dp[di][i].fi;
        res %= md;
    }
    return res;
}

int main()
{
    scanf("%lld%lld%lld", &l, &r, &k);
    vector<int> z = modify2(r);
    long long res;
    res = solve(r) - solve(l);
    res %= md;
    if(res < 0) res += md;
    if (__builtin_popcount(z.back()) <= k){res += r; res %= md;}
    printf("%lld", res);

    return 0;
}


#include <iostream>
#include <bits\stdc++.h>
#define fi first
#define se second
using namespace std;
long long l, r;
const long long md = 998244353;
long long k;
vector<long long> modify1(long long v)
{
    vector<long long> dg;
    long long c = v;
    long long dex = 10;
    while(c){dg.push_back(c % dex); c /= dex;}
    reverse(dg.begin(), dg.end());
    return dg;
}
vector<long long> modify2(long long v)
{
    vector<long long> dg = modify1(v);
    vector<long long> z(dg.size() + 1);
    z[0] = 0;
    for(long long i = 0; i < dg.size(); i++)
    {
        z[i + 1] = z[i] | (1 << dg[i]);
    }
    return z;
}
long long solve(long long v)
{
    pair<long long,long long> dp[25][1100];
    vector<long long> dg = modify1(v);
    vector<long long> z = modify2(v);
    z = modify2(v);
    long long cur = 0;
    long long di = dg.size();
    for(long long i = 0; i < di; i++)
    {
        for(long long l = 0; l < dg[i]; l++)
        {
            long long z0 = z[i] | (1 << l);
            if(__builtin_popcount(z0) <= k)
            {
                dp[i + 1][z0].fi += cur * 10 + l;
                dp[i + 1][z0].fi %= md;
                dp[i + 1][z0].se++;
            }
        }
        cur *= 10;
        cur += dg[i];
        for(long long t = 1; t < 1 << 10; t++)
        {
            for(long long v = 0; v <= 9; v++)
            {
                if(__builtin_popcount(t | (1 << v)) <= k)
                {
                long long u = dp[i][t].se % md;
                u *= v;
                u %= md;
                dp[i + 1][t | (1 << v)].fi += ((10 * dp[i][t].fi + u) % md);
                dp[i + 1][t | (1 << v)].fi %= md;
                dp[i + 1][t | (1 << v)].se += dp[i][t].se;
                }
            }
        }
    }
    long long res = 0;
    for(long long i = 1; i < 1 << 10; i++)
    {
        res += dp[di][i].fi;
        res %= md;
    }
    return res;
}

int main()
{
    scanf("%lld%lld%lld", &l, &r, &k);
    vector<long long> z = modify2(r);
    long long res;
    res = solve(r) - solve(l);
    res %= md;
    if(res < 0) res += md;
    if (__builtin_popcount(z.back()) <= k){res += r; res %= md;}
    printf("%lld", res);

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod = 998244353;

struct Res{
    ll sum, cnt;
}dp[21][2000];
Res tp;
ll ten[101];
int a[21];
int K;

Res dfs(int pos, int sta, bool limit, bool lead){
    if(__builtin_popcount(sta) > K){
        tp.sum = tp.cnt = 0;
        return tp;
    }
    if(pos == -1){
        tp.sum = 0; tp.cnt = 1;
        return tp;
    }
    if(!limit && !lead && dp[pos][sta].cnt != -1) return dp[pos][sta];
    int up = limit ? a[pos] : 9;
    ll ans = 0, cnt = 0;
    for(int i = 0; i <= up; i++){
        tp = dfs(pos-1, (lead&&i==0)?0:(sta|(1<<i)), limit&&i==up, lead&&i==0);
        cnt += tp.cnt;
        ans = (ans + tp.sum + tp.cnt%mod*i%mod*ten[pos]%mod)%mod;
    }
    tp.sum = ans; tp.cnt = cnt;
    if(!limit && !lead) dp[pos][sta] = tp;
    return tp;
}

ll solve(ll x){
    int pos = 0;
    while(x){
        a[pos++] = x % 10;
        x /= 10;
    }
    return dfs(pos-1, 0, 1, 1).sum;
}

int main(){
    ten[0] = 1;
    for(int i = 1; i <= 100; i++) ten[i] = ten[i-1]*10%mod;
    ll x, y;
    while(~scanf("%lld%lld%d", &x, &y, &K)){
        memset(dp, -1, sizeof(dp));
        printf("%lld\n", (solve(y)-solve(x-1)+mod)%mod);
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod = 998244353;

struct Res{
    ll sum, cnt;
}dp[21][2000];
Res tp;
ll ten[101];
int a[21];
int K;

Res dfs(int pos, int sta, bool limit, bool lead){
    if(__builtin_popcount(sta) > K){
        tp.sum = tp.cnt = 0;
        return tp;
    }
    if(pos == -1){
        tp.sum = 0; tp.cnt = 1;
        return tp;
    }
    if(!limit && !lead && dp[pos][sta].cnt != -1) return dp[pos][sta];
    int up = limit ? a[pos] : 9;
    ll ans = 0, cnt = 0;
    for(int i = 0; i <= up; i++){
        if(sta & (1<<i)){
            tp = dfs(pos-1, sta, limit && i == up, lead && i == 0);
            cnt += tp.cnt;
            ans = (ans + tp.sum + tp.cnt%mod*i%mod*ten[pos]%mod)%mod;
        }
        else{
            if(lead && i == 0){
                tp = dfs(pos-1, sta, limit && i == up, 1);
                cnt += tp.cnt;
                ans = (ans + tp.sum + tp.cnt%mod*i%mod*ten[pos]%mod)%mod;
            }
            else{
                tp = dfs(pos-1, sta|(1<<i), limit && i == up, 0);
                cnt += tp.cnt;
                ans = (ans + tp.sum + tp.cnt%mod*i%mod*ten[pos]%mod)%mod;
            }
        }
    }
    tp.sum = ans; tp.cnt = cnt;
    if(!limit && !lead) dp[pos][sta] = tp;
    return tp;
}

ll solve(ll x){
    int pos = 0;
    while(x){
        a[pos++] = x % 10;
        x /= 10;
    }
    return dfs(pos-1, 0, 1, 1).sum;
}

int main(){
    ten[0] = 1;
    for(int i = 1; i <= 100; i++) ten[i] = ten[i-1]*10%mod;
    ll x, y;
    while(~scanf("%lld%lld%d", &x, &y, &K)){
        memset(dp, -1, sizeof(dp));
        printf("%lld\n", (solve(y)-solve(x-1)+mod)%mod);
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod = 998244353;

struct Res{
    ll sum, cnt;
}dp[20][1025];
Res tp;
ll ten[101];
int a[20];
int K;

Res dfs(int pos, int sta, bool limit, bool lead){
    if(__builtin_popcount(sta) > K){
        tp.sum = tp.cnt = 0;
        return tp;
    }
    if(pos == -1){
        tp.sum = 0; tp.cnt = 1;
        return tp;
    }
    if(!limit && !lead && dp[pos][sta].cnt != -1) return dp[pos][sta];
    int up = limit ? a[pos] : 9;
    ll a1 = 0, a2 = 0;
    for(int i = 0; i <= up; i++){
        tp = dfs(pos-1, sta|(1<<i), limit && i == up, lead && i == 0);
        a1 = (a1 + tp.sum + tp.cnt%mod*i%mod*ten[pos]%mod) % mod;
        a2 = (a2 + tp.cnt) % mod;
    }
    tp.sum = a1; tp.cnt = a2;
    if(!limit && !lead) dp[pos][sta] = tp;
    return tp;
}

ll solve(ll x){
    int pos = 0;
    while(x){
        a[pos++] = x % 10;
        x /= 10;
    }
    return dfs(pos-1, 0, 1, 1).sum;
}

int main(){
    ten[0] = 1;
    for(int i = 1; i <= 100; i++) ten[i] = ten[i-1]*10%mod;
    ll x, y;
    while(~scanf("%lld%lld%d", &x, &y, &K)){
        memset(dp, -1, sizeof(dp));
        printf("%lld\n", (solve(y)-solve(x-1)+mod)%mod);
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod = 998244353;

struct Res{
    ll sum, cnt;
}dp[21][2000];
Res tp;
ll ten[101];
int a[21];
int K;

Res dfs(int pos, int sta, bool limit, bool lead){
    if(__builtin_popcount(sta) > K){
        tp.sum = tp.cnt = 0;
        return tp;
    }
    if(pos == -1){
        tp.sum = 0; tp.cnt = 1;
        return tp;
    }
    if(!limit && !lead && dp[pos][sta].cnt != -1) return dp[pos][sta];
    int up = limit ? a[pos] : 9;
    ll ans = 0, cnt = 0;
    for(int i = 0; i <= up; i++){
        if(sta & (1<<i)){
            tp = dfs(pos-1, sta, limit && i == up, lead && i == 0);
            cnt += tp.cnt;
            ans = (ans + tp.sum + tp.cnt%mod*i%mod*ten[pos]%mod)%mod;
        }
        else{
            if(lead && i == 0){
                tp = dfs(pos-1, sta, limit && i == up, 1);
                cnt += tp.cnt;
                ans = (ans + tp.sum) % mod;
            }
            else{
                tp = dfs(pos-1, sta|(1<<i), limit && i == up, 0);
                cnt += tp.cnt;
                ans = (ans + tp.sum + tp.cnt%mod*i%mod*ten[pos]%mod)%mod;
            }
        }
    }
    tp.sum = ans; tp.cnt = cnt;
    if(!limit && !lead) dp[pos][sta] = tp;
    return tp;
}

ll solve(ll x){
    int pos = 0;
    while(x){
        a[pos++] = x % 10;
        x /= 10;
    }
    return dfs(pos-1, 0, 1, 1).sum;
}

int main(){
    ten[0] = 1;
    for(int i = 1; i <= 100; i++) ten[i] = ten[i-1]*10%mod;
    ll x, y;
    while(~scanf("%lld%lld%d", &x, &y, &K)){
        memset(dp, -1, sizeof(dp));
        printf("%lld\n", (solve(y)-solve(x-1)+mod)%mod);
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod = 998244353;

struct Res{
    ll sum, cnt;
}dp[20][1025];
Res tp;
ll ten[20];
int a[20];
int K;

Res dfs(int pos, int sta, bool limit, bool lead){
    if(__builtin_popcount(sta) > K){
        tp.sum = tp.cnt = 0;
        return tp;
    }
    if(pos == -1){
        tp.sum = 0; tp.cnt = 1;
        return tp;
    }
    if(!limit && !lead && dp[pos][sta].cnt != -1) return dp[pos][sta];
    int up = limit ? a[pos] : 9;
    ll a1 = 0, a2 = 0;
    for(int i = 0; i <= up; i++){
        tp = dfs(pos-1, sta|(1<<i), limit && i == up, lead && i == 0);
        a1 = (a1 + tp.sum + tp.cnt%mod*i%mod*ten[pos]%mod) % mod;
        a2 = (a2 + tp.cnt) % mod;
    }
    tp.sum = a1; tp.cnt = a2;
    if(!limit && !lead) dp[pos][sta] = tp;
    return tp;
}

ll solve(ll x){
    int pos = 0;
    while(x){
        a[pos++] = x % 10;
        x /= 10;
    }
    return dfs(pos-1, 0, 1, 1).sum;
}

int main(){
    ten[0] = 1;
    for(int i = 1; i <= 20; i++) ten[i] = ten[i-1]*10%mod;
    ll x, y;
    while(~scanf("%lld%lld%d", &x, &y, &K)){
        memset(dp, -1, sizeof(dp));
        printf("%lld\n", (solve(y)-solve(x-1)+mod)%mod);
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod = 998244353;

struct Res{
    ll sum, cnt;
}dp[20][1025];
Res tp;
ll ten[20];
int a[20];
int K;

Res dfs(int pos, int sta, bool limit, bool lead){
    if(__builtin_popcount(sta) > K){
        tp.sum = tp.cnt = 0;
        return tp;
    }
    if(pos == -1){
        tp.sum = 0; tp.cnt = 1;
        return tp;
    }
    if(!limit && !lead && dp[pos][sta].cnt != -1) return dp[pos][sta];
    int up = limit ? a[pos] : 9;
    ll a1 = 0, a2 = 0;
    for(int i = 0; i <= up; i++){
        tp = dfs(pos-1, sta|(1<<i), limit && i == up, lead && i == 0);
        a1 = (a1 + tp.sum + tp.cnt%mod*i%mod*ten[pos]%mod) % mod;
        a2 = (a2 + tp.cnt) % mod;
    }
    tp.sum = a1; tp.cnt = a2;
    if(!limit && !lead) dp[pos][sta] = tp;
    return tp;
}

ll solve(ll x){
    int pos = 0;
    while(x){
        a[pos++] = x % 10;
        x /= 10;
    }
    return dfs(pos-1, 0, 1, 1).sum;
}

int main(){
    ten[0] = 1;
    for(int i = 1; i <= 20; i++) ten[i] = ten[i-1]*10%mod;
    ll x, y;
    while(~scanf("%lld%lld%d", &x, &y, &K)){
        memset(dp, -1, sizeof(dp));
        printf("%lld\n", solve(y)-solve(x-1));
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod = 998244353;

struct Res{
    ll sum, cnt;
}dp[21][2000];
Res tp;
ll ten[101];
int a[21];
int K;

Res dfs(int pos, int sta, bool limit, bool lead){
    if(__builtin_popcount(sta) > K){
        tp.sum = tp.cnt = 0;
        return tp;
    }
    if(pos == -1){
        tp.sum = 0; tp.cnt = 1;
        return tp;
    }
    if(!limit && !lead && dp[pos][sta].cnt != -1) return dp[pos][sta];
    int up = limit ? a[pos] : 9;
    ll a1 = 0, a2 = 0;
    for(int i = 0; i <= up; i++){
        Res tmp = dfs(pos-1, sta|(1<<i), limit && i == up, lead && i == 0);
        a1 = (a1 + tmp.sum + tmp.cnt%mod*ten[pos]%mod*i%mod) % mod;
        a2 = (a2 + tmp.cnt) % mod;
    }
    tp.sum = a1; tp.cnt = a2;
    if(!limit && !lead) dp[pos][sta] = tp;
    return tp;
}

ll solve(ll x){
    int pos = 0;
    while(x){
        a[pos++] = x % 10;
        x /= 10;
    }
    return dfs(pos-1, 0, 1, 1).sum;
}

int main(){
    ten[0] = 1;
    for(int i = 1; i <= 100; i++) ten[i] = ten[i-1]*10%mod;
    ll x, y;
    while(~scanf("%lld%lld%d", &x, &y, &K)){
        memset(dp, -1, sizeof(dp));
        printf("%lld\n", (solve(y)-solve(x-1)+mod)%mod);
    }

    return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstdio>
#include <queue>
#include <deque>
#include <bitset>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <random>
#include <ctime>
#include <utility>
#include <fstream>

#pragma GCC optimize("Ofast")
#pragma GCC optimize("no-stack-protector")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,popcnt,abm,mmx,tune=native")
#pragma GCC optimize("fast-math")
#pragma comment(linker, "/STACK:256000000")
#pragma warning(disable:4996)

using namespace std;

typedef long long ll;
typedef long double ld;

const int inf = 1e9;
const ll llinf = 1e18, mod = 998244353;
const ld pi = 3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825;

#define forn(i, n) for (int i = 0; i < (int)n; ++i)
#define firn(i, n) for (int i = 1; i < (int)n; ++i)
#define all(v) v.begin(), v.end()

template<typename T> bool uin(T &a, T b) { if (b < a) { a = b; return 1; } return 0; }
template<typename T> bool uax(T &a, T b) { if (b > a) { a = b; return 1; } return 0; }
template<class iterator> void output(iterator begin, iterator end, char p = ' ', ostream & out = cout) { while (begin != end) { out << (*begin) << p; begin++; } out << '\n'; }
template<class T> void output(T x, char p = ' ', ostream & out = cout) { output(all(x), p, out); }

mt19937 rnd(time(NULL));

ll dp[19][10][1024], cnt[19][10][1024];

vector<ll> st(19, 1);
int qq;

ll solve(ll r) {
	if (!r) return 0ll;
	ll ans = 0ll;
	vector<int> rr;
	while (r > 0) {
		rr.push_back(r % 10);
		r /= 10;
	}
	reverse(all(rr));
	vector<bool> t(10), p(10);
	ll cur = 0ll;
	forn(i, rr.size()) {
		forn(j, rr[i]) {
			forn(mask, 1024) {
				int c = 0;
				forn(k, 10) {
					t[k] = (mask & (1 << k));
					c += t[k] | p[k];
				}
				if (c > qq)
					continue;
				ans = (ans + dp[(int)rr.size() - i][j][mask]) % mod;
				ans = (ans + cur * 1ll * cnt[(int)rr.size() - i][j][mask]) % mod;
			}
		}
		p[rr[i]] = 1;
		cur = (cur + (rr[i] * 1ll * st[(int)rr.size() - i - 1] % mod)) % mod;
	}
	int c = 0;
	forn(i, 10) c += p[i];
	if (c <= qq) {
		ans = (ans + cur) % mod;
	}
	return ans;
}
int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	ll l, r, k;
	cin >> l >> r >> k;
	qq = k;
	firn(i, 19) st[i] = st[i - 1] * 10ll % mod;
	forn(i, 10) {
		dp[1][i][1 << i] = i * 1ll;
		cnt[1][i][1 << i] = 1ll;
	}
	vector<bool> tmp(10);
	for (int i = 2; i < 19; ++i) {
		for (int j = 0; j < 10; ++j) {
			for (int mask = 0; mask < 1024; ++mask) {
				if ((mask & (1 << j)) == 0) continue;
				forn(r, 10) tmp[r] = mask & (1 << r);
				forn(r, 10)
					if (tmp[r]) {
						dp[i][j][mask] = (dp[i][j][mask] + dp[i - 1][r][mask]) % mod;
						dp[i][j][mask] = (dp[i][j][mask] + dp[i - 1][r][mask - (1 << j)]) % mod;
						cnt[i][j][mask] += cnt[i - 1][r][mask] + cnt[i - 1][r][mask - (1 << j)];
					}
				dp[i][j][mask] = (dp[i][j][mask] + (cnt[i][j][mask] * 1ll * st[i - 1] % mod) * j) % mod;
			}
		}
	}
	auto ans = solve(r) - solve(l - 1);
	ans = (ans % mod + mod) % mod;
	cout << ans;
#ifdef _DEBUG
	system("pause");
#endif
	return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstdio>
#include <queue>
#include <deque>
#include <bitset>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <random>
#include <ctime>
#include <utility>
#include <fstream>

#pragma GCC optimize("Ofast")
#pragma GCC optimize("no-stack-protector")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,popcnt,abm,mmx,tune=native")
#pragma GCC optimize("fast-math")
#pragma comment(linker, "/STACK:256000000")
#pragma warning(disable:4996)

using namespace std;

typedef long long ll;
typedef long double ld;

const int inf = 1e9;
const ll llinf = 1e18, mod = 998244353;
const ld pi = 3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825;

#define forn(i, n) for (int i = 0; i < (int)n; ++i)
#define firn(i, n) for (int i = 1; i < (int)n; ++i)
#define all(v) v.begin(), v.end()
#define int long long

template<typename T> bool uin(T &a, T b) { if (b < a) { a = b; return 1; } return 0; }
template<typename T> bool uax(T &a, T b) { if (b > a) { a = b; return 1; } return 0; }
template<class iterator> void output(iterator begin, iterator end, char p = ' ', ostream & out = cout) { while (begin != end) { out << (*begin) << p; begin++; } out << '\n'; }
template<class T> void output(T x, char p = ' ', ostream & out = cout) { output(all(x), p, out); }

mt19937 rnd(time(NULL));

ll dp[19][10][1024], cnt[19][10][1024];

vector<ll> st(19, 1);
int qq;

ll solve(ll r) {
	if (!r) return 0ll;
	ll ans = 0ll;
	vector<int> rr;
	while (r > 0) {
		rr.push_back(r % 10);
		r /= 10;
	}
	reverse(all(rr));
	vector<bool> t(10), p(10);
	ll cur = 0ll;
	forn(i, rr.size()) {
		forn(j, rr[i]) {
			forn(mask, 1024) {
				int c = 0;
				forn(k, 10) {
					t[k] = (mask & (1 << k));
					c += t[k] | p[k];
				}
				if (c > qq)
					continue;
				ans = (ans + dp[(int)rr.size() - i][j][mask]) % mod;
				ans = (ans + cur * 1ll * cnt[(int)rr.size() - i][j][mask]) % mod;
			}
		}
		p[rr[i]] = 1;
		cur = (cur + (rr[i] * 1ll * st[(int)rr.size() - i - 1] % mod)) % mod;
	}
	int c = 0;
	forn(i, 10) c += p[i];
	if (c <= qq) {
		ans = (ans + cur) % mod;
	}
	return ans;
}
signed main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	ll l, r, k;
	cin >> l >> r >> k;
	qq = k;
	firn(i, 19) st[i] = st[i - 1] * 10ll % mod;
	forn(i, 10) {
		dp[1][i][1 << i] = i * 1ll;
		cnt[1][i][1 << i] = 1ll;
	}
	vector<bool> tmp(10);
	for (int i = 2; i < 19; ++i) {
		for (int j = 0; j < 10; ++j) {
			for (int mask = 0; mask < 1024; ++mask) {
				if ((mask & (1 << j)) == 0) continue;
				forn(r, 10) tmp[r] = mask & (1 << r);
				forn(r, 10)
					if (tmp[r]) {
						dp[i][j][mask] = (dp[i][j][mask] + dp[i - 1][r][mask]) % mod;
						dp[i][j][mask] = (dp[i][j][mask] + dp[i - 1][r][mask - (1 << j)]) % mod;
						cnt[i][j][mask] = ((cnt[i][j][mask] + cnt[i - 1][r][mask]) % mod + cnt[i - 1][r][mask - (1 << j)]) % mod;
					}
				dp[i][j][mask] = (dp[i][j][mask] + (cnt[i][j][mask] * 1ll * st[i - 1] % mod) * j) % mod;
			}
		}
	}
	auto ans = solve(r) - solve(l - 1);
	ans = (ans % mod + mod) % mod;
	cout << ans;
#ifdef _DEBUG
	system("pause");
#endif
	return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstdio>
#include <queue>
#include <deque>
#include <bitset>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <random>
#include <ctime>
#include <utility>
#include <fstream>

#pragma GCC optimize("Ofast")
#pragma GCC optimize("no-stack-protector")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,popcnt,abm,mmx,tune=native")
#pragma GCC optimize("fast-math")
#pragma comment(linker, "/STACK:256000000")
#pragma warning(disable:4996)

using namespace std;

typedef long long ll;
typedef long double ld;

const int inf = 1e9;
const ll llinf = 1e18, mod = 998244353;
const ld pi = 3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825;

#define forn(i, n) for (int i = 0; i < (int)n; ++i)
#define firn(i, n) for (int i = 1; i < (int)n; ++i)
#define all(v) v.begin(), v.end()
#define int long long

template<typename T> bool uin(T &a, T b) { if (b < a) { a = b; return 1; } return 0; }
template<typename T> bool uax(T &a, T b) { if (b > a) { a = b; return 1; } return 0; }
template<class iterator> void output(iterator begin, iterator end, char p = ' ', ostream & out = cout) { while (begin != end) { out << (*begin) << p; begin++; } out << '\n'; }
template<class T> void output(T x, char p = ' ', ostream & out = cout) { output(all(x), p, out); }

mt19937 rnd(time(NULL));

ll dp[19][10][1024], cnt[19][10][1024];

vector<ll> st(19, 1);
int qq;

ll solve(ll r) {
	if (!r) return 0ll;
	ll ans = 0ll;
	vector<int> rr;
	while (r > 0) {
		rr.push_back(r % 10);
		r /= 10;
	}
	reverse(all(rr));
	vector<bool> t(10), p(10);
	ll cur = 0ll;
	ll e = 1ll;
	forn(i, (int)rr.size() - 1) e *= 10ll;
	e--;
	ans = solve(e);
	forn(i, rr.size()) {
		forn(j, rr[i]) {
			if (i == 0 && j == 0) continue;
			forn(mask, 1024) {
				int c = 0;
				forn(k, 10) {
					t[k] = (mask & (1 << k));
					c += t[k] | p[k];
				}
				if (c > qq)
					continue;
				ans = (ans + dp[(int)rr.size() - i][j][mask]) % mod;
				ans = (ans + cur * 1ll * cnt[(int)rr.size() - i][j][mask]) % mod;
			}
		}
		p[rr[i]] = 1;
		cur = (cur + (rr[i] * 1ll * st[(int)rr.size() - i - 1] % mod)) % mod;
	}
	int c = 0;
	forn(i, 10) c += p[i];
	if (c <= qq) {
		ans = (ans + cur) % mod;
	}
	return ans;
}
signed main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	ll l, r, k;
	cin >> l >> r >> k;
	qq = k;
	firn(i, 19) st[i] = st[i - 1] * 10ll % mod;
	forn(i, 10) {
		dp[1][i][1 << i] = i * 1ll;
		cnt[1][i][1 << i] = 1ll;
	}
	vector<bool> tmp(10);
	for (int i = 2; i < 19; ++i) {
		for (int j = 0; j < 10; ++j) {
			for (int mask = 0; mask < 1024; ++mask) {
				if ((mask & (1 << j)) == 0) continue;
				forn(r, 10) tmp[r] = mask & (1 << r);
				forn(r, 10)
					if (tmp[r]) {
						dp[i][j][mask] = (dp[i][j][mask] + dp[i - 1][r][mask]) % mod;
						dp[i][j][mask] = (dp[i][j][mask] + dp[i - 1][r][mask - (1 << j)]) % mod;
						cnt[i][j][mask] = ((cnt[i][j][mask] + cnt[i - 1][r][mask]) % mod + cnt[i - 1][r][mask - (1 << j)]) % mod;
					}
				dp[i][j][mask] = (dp[i][j][mask] + (cnt[i][j][mask] * 1ll * st[i - 1] % mod) * j) % mod;
			}
		}
	}
	ll ans = 0ll;
	if (r == (ll)(1e18)) {
		r--;
		if (k >= 2) ans = st[18];
	}
	ans += (solve(r) - solve(l - 1)) % mod;
	ans = (ans % mod + mod) % mod;
	cout << ans;
#ifdef _DEBUG
	system("pause");
#endif
	return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstdio>
#include <queue>
#include <deque>
#include <bitset>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <random>
#include <ctime>
#include <utility>
#include <fstream>

#pragma GCC optimize("Ofast")
#pragma GCC optimize("no-stack-protector")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,popcnt,abm,mmx,tune=native")
#pragma GCC optimize("fast-math")
#pragma comment(linker, "/STACK:256000000")
#pragma warning(disable:4996)

using namespace std;

typedef long long ll;
typedef long double ld;

const int inf = 1e9;
const ll llinf = 1e18, mod = 998244353;
const ld pi = 3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825;

#define forn(i, n) for (int i = 0; i < (int)n; ++i)
#define firn(i, n) for (int i = 1; i < (int)n; ++i)
#define all(v) v.begin(), v.end()
#define int long long

template<typename T> bool uin(T &a, T b) { if (b < a) { a = b; return 1; } return 0; }
template<typename T> bool uax(T &a, T b) { if (b > a) { a = b; return 1; } return 0; }
template<class iterator> void output(iterator begin, iterator end, char p = ' ', ostream & out = cout) { while (begin != end) { out << (*begin) << p; begin++; } out << '\n'; }
template<class T> void output(T x, char p = ' ', ostream & out = cout) { output(all(x), p, out); }

mt19937 rnd(time(NULL));

ll dp[19][10][1024], cnt[19][10][1024];

vector<ll> st(19, 1);
int qq;

ll solve(ll r) {
	if (!r) return 0ll;
	ll ans = 0ll;
	vector<int> rr;
	while (r > 0) {
		rr.push_back(r % 10);
		r /= 10;
	}
	reverse(all(rr));
	vector<bool> t(10), p(10);
	ll cur = 0ll;
	forn(i, rr.size()) {
		forn(j, rr[i]) {
			forn(mask, 1024) {
				int c = 0;
				forn(k, 10) {
					t[k] = (mask & (1 << k));
					c += t[k] | p[k];
				}
				if (c > qq)
					continue;
				ans = (ans + dp[(int)rr.size() - i][j][mask]) % mod;
				ans = (ans + cur * 1ll * cnt[(int)rr.size() - i][j][mask]) % mod;
			}
		}
		p[rr[i]] = 1;
		cur = (cur + (rr[i] * 1ll * st[(int)rr.size() - i - 1] % mod)) % mod;
	}
	int c = 0;
	forn(i, 10) c += p[i];
	if (c <= qq) {
		ans = (ans + cur) % mod;
	}
	return ans;
}
signed main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	ll l, r, k;
	cin >> l >> r >> k;
	qq = k;
	firn(i, 19) st[i] = st[i - 1] * 10ll % mod;
	forn(i, 10) {
		dp[1][i][1 << i] = i * 1ll;
		cnt[1][i][1 << i] = 1ll;
	}
	vector<bool> tmp(10);
	for (int i = 2; i < 19; ++i) {
		for (int j = 0; j < 10; ++j) {
			for (int mask = 0; mask < 1024; ++mask) {
				if ((mask & (1 << j)) == 0) continue;
				forn(r, 10) tmp[r] = mask & (1 << r);
				forn(r, 10)
					if (tmp[r]) {
						dp[i][j][mask] = (dp[i][j][mask] + dp[i - 1][r][mask]) % mod;
						dp[i][j][mask] = (dp[i][j][mask] + dp[i - 1][r][mask - (1 << j)]) % mod;
						cnt[i][j][mask] += (cnt[i - 1][r][mask] + cnt[i - 1][r][mask - (1 << j)]) % mod;
					}
				dp[i][j][mask] = (dp[i][j][mask] + (cnt[i][j][mask] * 1ll * st[i - 1] % mod) * j) % mod;
			}
		}
	}
	auto ans = solve(r) - solve(l - 1);
	ans = (ans % mod + mod) % mod;
	cout << ans;
#ifdef _DEBUG
	system("pause");
#endif
	return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstdio>
#include <queue>
#include <deque>
#include <bitset>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <random>
#include <ctime>
#include <utility>
#include <fstream>

#pragma GCC optimize("Ofast")
#pragma GCC optimize("no-stack-protector")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,popcnt,abm,mmx,tune=native")
#pragma GCC optimize("fast-math")
#pragma comment(linker, "/STACK:256000000")
#pragma warning(disable:4996)

using namespace std;

typedef long long ll;
typedef long double ld;

const int inf = 1e9;
const ll llinf = 1e18, mod = 998244353;
const ld pi = 3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825;

#define forn(i, n) for (int i = 0; i < (int)n; ++i)
#define firn(i, n) for (int i = 1; i < (int)n; ++i)
#define all(v) v.begin(), v.end()
#define int long long

template<typename T> bool uin(T &a, T b) { if (b < a) { a = b; return 1; } return 0; }
template<typename T> bool uax(T &a, T b) { if (b > a) { a = b; return 1; } return 0; }
template<class iterator> void output(iterator begin, iterator end, char p = ' ', ostream & out = cout) { while (begin != end) { out << (*begin) << p; begin++; } out << '\n'; }
template<class T> void output(T x, char p = ' ', ostream & out = cout) { output(all(x), p, out); }

mt19937 rnd(time(NULL));

ll dp[19][10][1024], cnt[19][10][1024];

vector<ll> st(19, 1);
int qq;

ll solve(ll r) {
	if (!r) return 0ll;
	ll ans = 0ll;
	vector<int> rr;
	while (r > 0) {
		rr.push_back(r % 10);
		r /= 10;
	}
	reverse(all(rr));
	vector<bool> t(10), p(10);
	ll cur = 0ll;
	forn(i, rr.size()) {
		forn(j, rr[i]) {
			forn(mask, 1024) {
				int c = 0;
				forn(k, 10) {
					t[k] = (mask & (1 << k));
					c += t[k] | p[k];
				}
				if (c > qq)
					continue;
				ans = (ans + dp[(int)rr.size() - i][j][mask]) % mod;
				ans = (ans + cur * 1ll * cnt[(int)rr.size() - i][j][mask]) % mod;
			}
		}
		p[rr[i]] = 1;
		cur = (cur + (rr[i] * 1ll * st[(int)rr.size() - i - 1] % mod)) % mod;
	}
	int c = 0;
	forn(i, 10) c += p[i];
	if (c <= qq) {
		ans = (ans + cur) % mod;
	}
	return ans;
}
signed main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	ll l, r, k;
	cin >> l >> r >> k;
	qq = k;
	firn(i, 19) st[i] = st[i - 1] * 10ll % mod;
	forn(i, 10) {
		dp[1][i][1 << i] = i * 1ll;
		cnt[1][i][1 << i] = 1ll;
	}
	vector<bool> tmp(10);
	for (int i = 2; i < 19; ++i) {
		for (int j = 0; j < 10; ++j) {
			for (int mask = 0; mask < 1024; ++mask) {
				if ((mask & (1 << j)) == 0) continue;
				forn(r, 10) tmp[r] = mask & (1 << r);
				forn(r, 10)
					if (tmp[r]) {
						dp[i][j][mask] = (dp[i][j][mask] + dp[i - 1][r][mask]) % mod;
						dp[i][j][mask] = (dp[i][j][mask] + dp[i - 1][r][mask - (1 << j)]) % mod;
						cnt[i][j][mask] += cnt[i - 1][r][mask] + cnt[i - 1][r][mask - (1 << j)];
					}
				dp[i][j][mask] = (dp[i][j][mask] + (cnt[i][j][mask] * 1ll * st[i - 1] % mod) * j) % mod;
			}
		}
	}
	auto ans = solve(r) - solve(l - 1);
	ans = (ans % mod + mod) % mod;
	cout << ans;
#ifdef _DEBUG
	system("pause");
#endif
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define MAX 20
#define MOD 998244353LL
#define mod(n) (((n)%MOD+MOD)%MOD)

int K;
ll tot[MAX][2][2][1<<10], cnt[20][2][2][1<<10], powers10[MAX], L, R;

ll get_cnt(int pos, bool prev_less, bool prev_zero, int mask, ll target) {
    if (pos < 0) {
        int ans = 0;
        while (mask > 0) {
            ans += (mask&1);
            mask /= 2;
        }
        return ans > 0 && ans <= K;
    } else if (cnt[pos][prev_less][prev_zero][mask] != -1) {
        return cnt[pos][prev_less][prev_zero][mask];
    } else {
        ll ans_cnt = 0, ans_tot = 0;
        int digit = (target/powers10[pos])%10;
        for (int i = 0; i <= (prev_less ? 9 : digit); ++i) {
            int new_mask = ((mask>>i)&1) || (i == 0 && prev_zero) ? mask : mask^(1<<i);
            bool new_prev_less = prev_less || i < digit;
            bool new_prev_zero = prev_zero && i == 0;

            ll curr_cnt = get_cnt(pos-1, new_prev_less, new_prev_zero, new_mask, target);
            ll curr_tot = pos == 0 ? 0 : tot[pos-1][new_prev_less][new_prev_zero][new_mask];

            ans_cnt = mod(ans_cnt+curr_cnt);
            ans_tot = mod(ans_tot+curr_tot);
            ans_tot = mod(ans_tot+i*powers10[pos]*curr_cnt);
        }
        cnt[pos][prev_less][prev_zero][mask] = ans_cnt;
        tot[pos][prev_less][prev_zero][mask] = ans_tot;
        return ans_cnt;
    }
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(NULL);

    powers10[0] = 1;
    for (int i = 1; i < MAX; ++i) {
        powers10[i] = mod(powers10[i-1]*10LL);
    }

    cin >> L >> R >> K;

    memset(tot, 255, sizeof(tot));
    memset(cnt, 255, sizeof(cnt));
    get_cnt(MAX-1, false, true, 0, R);
    ll ansR = tot[MAX-1][false][true][0];

    memset(tot, 255, sizeof(tot));
    memset(cnt, 255, sizeof(cnt));
    get_cnt(MAX-1, false, true, 0, L-1);
    ll ansL = tot[MAX-1][false][true][0];

    cout << mod(ansR-ansL) << "\n";
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define MAX 20
#define MOD 998244353LL
#define mod(n) (((n)%MOD+MOD)%MOD)

int K;
ll tot[MAX][2][2][1<<10], cnt[20][2][2][1<<10], powers10[MAX], L, R;

ll get_cnt(int pos, bool prev_less, bool prev_zero, int mask, ll target) {
    if (pos < 0) {
        int ans = 0;
        while (mask > 0) {
            ans += (mask&1);
            mask /= 2;
        }
        return ans > 0 && ans <= K;
    } else if (cnt[pos][prev_less][prev_zero][mask] != -1) {
        return cnt[pos][prev_less][prev_zero][mask];
    } else {
        ll ans_cnt = 0, ans_tot = 0;
        int digit = (target/powers10[pos])%10;
        for (int i = 0; i <= (prev_less ? 9 : digit); ++i) {
            int new_mask = ((mask>>i)&1) || (i == 0 && prev_zero) ? mask : mask^(1<<i);
            bool new_prev_less = prev_less || i < digit;
            bool new_prev_zero = prev_zero && i == 0;

            ll curr_cnt = get_cnt(pos-1, new_prev_less, new_prev_zero, new_mask, target);
            ll curr_tot = pos == 0 ? 0 : tot[pos-1][new_prev_less][new_prev_zero][new_mask];

            ans_cnt = mod(ans_cnt+curr_cnt);
            ans_tot = mod(ans_tot+curr_tot);

            ll val = mod(i*mod(powers10[pos]));
            ans_tot = mod(ans_tot+mod(val*curr_cnt));
        }
        cnt[pos][prev_less][prev_zero][mask] = ans_cnt;
        tot[pos][prev_less][prev_zero][mask] = ans_tot;
        return ans_cnt;
    }
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(NULL);

    powers10[0] = 1;
    for (int i = 1; i < MAX; ++i) {
        powers10[i] = powers10[i-1]*10LL;
    }

    cin >> L >> R >> K;

    memset(tot, 255, sizeof(tot));
    memset(cnt, 255, sizeof(cnt));
    get_cnt(MAX-1, false, true, 0, R);
    ll ansR = tot[MAX-1][false][true][0];

    memset(tot, 255, sizeof(tot));
    memset(cnt, 255, sizeof(cnt));
    get_cnt(MAX-1, false, true, 0, L-1);
    ll ansL = tot[MAX-1][false][true][0];

    cout << mod(ansR-ansL) << "\n";
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pll;
#define MOD ((ll)1e9+7)
#define mod(n) (((n)%MOD+MOD)%MOD)

int K;
bool used[20][2][2][(1<<10)];
pll dp[20][2][2][(1<<10)];
ll powers10[20];
string L, R;

pll get_dp(int pos, bool prev_less, bool prev_zero, int mask, string &target) {
    if (pos == target.size()) {
        int ans = 0;
        while (mask > 0) {
            ans += (mask&1);
            mask /= 2;
        }
        return make_pair(ans > 0 && ans <= K, 0);
    } else if (used[pos][prev_less][prev_zero][mask]) {
        return dp[pos][prev_less][prev_zero][mask];
    } else if (prev_less) {
        int new_mask;
        pll ans = make_pair(0, 0), curr;
        for (int i = 0; i < 10; ++i) {
            new_mask = ((mask>>i)&1) ? mask : i > 0 || !prev_zero ? mask^(1<<i) : mask;
            curr = get_dp(pos+1, true, prev_zero && i == 0, new_mask, target);
            ans.first = mod(ans.first+curr.first);
            ans.second = mod(ans.second+mod(i*powers10[target.size()-pos-1]*curr.first)+curr.second);
        }
        used[pos][prev_less][prev_zero][mask] = true;
        return dp[pos][prev_less][prev_zero][mask] = ans;
    } else {
        int new_mask;
        pll ans = make_pair(0, 0), curr;
        for (int i = 0; i <= target[pos]-'0'; ++i) {
            new_mask = ((mask>>i)&1) ? mask : i > 0 || !prev_zero ? mask^(1<<i) : mask;
            curr = get_dp(pos+1, i < target[pos]-'0', prev_zero && i == 0, new_mask, target);
            ans.first = mod(ans.first+curr.first);
            ans.second = mod(ans.second+mod(i*powers10[target.size()-pos-1]*curr.first)+curr.second);
        }
        used[pos][prev_less][prev_zero][mask] = true;
        return dp[pos][prev_less][prev_zero][mask] = ans;
    }
}

ll validateL() {
    ll num = 0, mask = 0, cnt = 0;
    for (int i = 0; i < L.size(); ++i) {
        num = num*10+(L[i]-'0');
        if (((mask>>(L[i]-'0'))&1) == 0) {
            mask ^= (1<<(L[i]-'0'));
            cnt++;
        }
    }
    return cnt <= K ? num : 0;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(NULL);

    powers10[0] = 1;
    for (int i = 1; i < 20; ++i) {
        powers10[i] = mod(powers10[i-1]*10);
    }

    cin >> L >> R >> K;
    memset(used, false, sizeof(used));
    pll ansR = get_dp(0, false, true, 0, R);
    cout << "ansR: " << ansR.first << ", " << ansR.second << "\n";
    memset(used, false, sizeof(used));
    pll ansL = get_dp(0, false, true, 0, L);

    cout << mod(ansR.second-ansL.second+validateL()) << "\n";
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define MAX 20
#define MOD 998244353LL
#define mod(n) (((n)%MOD+MOD)%MOD)

int K;
ll tot[MAX][2][2][1<<10], cnt[20][2][2][1<<10], powers10[MAX], L, R;

ll get_cnt(int pos, bool prev_less, bool prev_zero, int mask, ll target) {
    if (pos < 0) {
        int ans = 0;
        while (mask > 0) {
            ans += (mask&1);
            mask /= 2;
        }
        return ans > 0 && ans <= K;
    } else if (cnt[pos][prev_less][prev_zero][mask] != -1) {
        return cnt[pos][prev_less][prev_zero][mask];
    } else {
        ll ans_cnt = 0, ans_tot = 0;
        int digit = (target/powers10[pos])%10;
        for (int i = 0; i <= (prev_less ? 9 : digit); ++i) {
            int new_mask = ((mask>>i)&1) || (i == 0 && prev_zero) ? mask : mask^(1<<i);
            bool new_prev_less = prev_less || i < digit;
            bool new_prev_zero = prev_zero && i == 0;

            ll curr_cnt = get_cnt(pos-1, new_prev_less, new_prev_zero, new_mask, target);
            ll curr_tot = pos == 0 ? 0 : tot[pos-1][new_prev_less][new_prev_zero][new_mask];

            ans_cnt = mod(ans_cnt+curr_cnt);
            ans_tot = mod(ans_tot+curr_tot);
            ans_tot = mod(ans_tot+i*powers10[pos]*curr_cnt);
        }
        cnt[pos][prev_less][prev_zero][mask] = ans_cnt;
        tot[pos][prev_less][prev_zero][mask] = ans_tot;
        return ans_cnt;
    }
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(NULL);

    powers10[0] = 1;
    for (int i = 1; i < MAX; ++i) {
        powers10[i] = powers10[i-1]*10LL;
    }

    cin >> L >> R >> K;

    memset(tot, 255, sizeof(tot));
    memset(cnt, 255, sizeof(cnt));
    get_cnt(MAX-1, false, true, 0, R);
    ll ansR = tot[MAX-1][false][true][0];

    memset(tot, 255, sizeof(tot));
    memset(cnt, 255, sizeof(cnt));
    get_cnt(MAX-1, false, true, 0, L-1);
    ll ansL = tot[MAX-1][false][true][0];

    cout << mod(ansR-ansL) << "\n";
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pll;
#define MOD ((ll)1e9+7)
#define mod(n) (((n)%MOD+MOD)%MOD)

int K;
bool used[20][2][2][(1<<10)];
pll dp[20][2][2][(1<<10)];
ll powers10[20];
string L, R;

pll get_dp(int pos, bool prev_less, bool prev_zero, int mask, string &target) {
    if (pos == target.size()) {
        int ans = 0;
        while (mask > 0) {
            ans += (mask&1);
            mask /= 2;
        }
        return make_pair(ans > 0 && ans <= K, 0);
    } else if (used[pos][prev_less][prev_zero][mask]) {
        return dp[pos][prev_less][prev_zero][mask];
    } else if (prev_less) {
        int new_mask;
        pll ans = make_pair(0, 0), curr;
        for (int i = 0; i < 10; ++i) {
            new_mask = ((mask>>i)&1) ? mask : i > 0 || !prev_zero ? mask^(1<<i) : mask;
            curr = get_dp(pos+1, true, prev_zero && i == 0, new_mask, target);
            ans.first = mod(ans.first+curr.first);
            ans.second = mod(ans.second+mod(i*powers10[target.size()-pos-1]*curr.first)+curr.second);
        }
        used[pos][prev_less][prev_zero][mask] = true;
        return dp[pos][prev_less][prev_zero][mask] = ans;
    } else {
        int new_mask;
        pll ans = make_pair(0, 0), curr;
        for (int i = 0; i <= target[pos]-'0'; ++i) {
            new_mask = ((mask>>i)&1) ? mask : i > 0 || !prev_zero ? mask^(1<<i) : mask;
            curr = get_dp(pos+1, i < target[pos]-'0', prev_zero && i == 0, new_mask, target);
            ans.first = mod(ans.first+curr.first);
            ans.second = mod(ans.second+mod(i*powers10[target.size()-pos-1]*curr.first)+curr.second);
        }
        used[pos][prev_less][prev_zero][mask] = true;
        return dp[pos][prev_less][prev_zero][mask] = ans;
    }
}

ll validateL() {
    ll num = 0, mask = 0, cnt = 0;
    for (int i = 0; i < L.size(); ++i) {
        num = num*10+(L[i]-'0');
        if (((mask>>(L[i]-'0'))&1) == 0) {
            mask ^= (1<<(L[i]-'0'));
            cnt++;
        }
    }
    return cnt <= K ? num : 0;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(NULL);

    powers10[0] = 1;
    for (int i = 1; i < 20; ++i) {
        powers10[i] = mod(powers10[i-1]*10);
    }

    cin >> L >> R >> K;
    memset(used, false, sizeof(used));
    pll ansR = get_dp(0, false, true, 0, R);
    memset(used, false, sizeof(used));
    pll ansL = get_dp(0, false, true, 0, L);

    cout << mod(ansR.second-ansL.second+validateL()) << "\n";
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define MAX 20
#define MOD ((ll)1e9+7)
#define mod(n) (((n)%MOD+MOD)%MOD)

int K;
ll tot[MAX][2][2][1<<10], cnt[20][2][2][1<<10], powers10[MAX], L, R;

ll get_cnt(int pos, bool prev_less, bool prev_zero, int mask, ll target) {
    if (pos < 0) {
        int ans = 0;
        while (mask > 0) {
            ans += (mask&1);
            mask /= 2;
        }
        return ans > 0 && ans <= K;
    } else if (cnt[pos][prev_less][prev_zero][mask] != -1) {
        return cnt[pos][prev_less][prev_zero][mask];
    } else {
        ll ans_cnt = 0, ans_tot = 0;
        int digit = (target/powers10[pos])%10;
        for (int i = 0; i <= (prev_less ? 9 : digit); ++i) {
            int new_mask = ((mask>>i)&1) || (i == 0 && prev_zero) ? mask : mask^(1<<i);
            bool new_prev_less = prev_less || i < digit;
            bool new_prev_zero = prev_zero && i == 0;

            ll curr_cnt = get_cnt(pos-1, new_prev_less, new_prev_zero, new_mask, target);
            ll curr_tot = pos == 0 ? 0 : tot[pos-1][new_prev_less][new_prev_zero][new_mask];

            ans_cnt = mod(ans_cnt+curr_cnt);
            ans_tot = mod(ans_tot+curr_tot);
            ans_tot = mod(ans_tot+i*powers10[pos]*curr_cnt);
        }
        cnt[pos][prev_less][prev_zero][mask] = ans_cnt;
        tot[pos][prev_less][prev_zero][mask] = ans_tot;
        return ans_cnt;
    }
}

int main() {
    //ios::sync_with_stdio(false);
    //cin.tie(NULL);

    powers10[0] = 1;
    for (int i = 1; i < MAX; ++i) {
        powers10[i] = powers10[i-1]*10LL;
    }

    cin >> L >> R >> K;

    memset(tot, 255, sizeof(tot));
    memset(cnt, 255, sizeof(cnt));
    get_cnt(MAX-1, false, true, 0, R);
    ll ansR = tot[MAX-1][false][true][0];

    memset(tot, 255, sizeof(tot));
    memset(cnt, 255, sizeof(cnt));
    get_cnt(MAX-1, false, true, 0, L-1);
    ll ansL = tot[MAX-1][false][true][0];

    cout << mod(ansR-ansL) << "\n";
}


#include<bits/stdc++.h>
using namespace std;
const long long mod = 998244353;
long long dp[22][1<<10][2];
long long cnt[22][1<<10][2];
long long num[22];
long long MOD(long long a)
{
    while(a<0)      a+=mod;
    while(a>=mod)   a-=mod;
    return a;
}
long long solve(long long n,long long lim,long long sum=0)
{
    long long tmp=n,digit = 0;
    while(tmp)  tmp/=10,++digit;
    memset(dp,0,sizeof dp);
    memset(cnt,0,sizeof cnt);
    cnt[0][0][0] = 1;
    for(long long i=1,tmp=n;i<=digit;i++) num[i] = tmp%10,tmp/=10;
    for(long long i=1,pow10=1;i<=digit;i++,pow10*=10)
    {
        pow10 = MOD(pow10);
        for(long long j=0;j<=9;j++)
        {
            long long ch = 0;
            if(j>num[i])    ch = 1;
            for(long long k=0;k<=1023;k++)
            {
                if((1ll<<j)&k)
                {
                    if(j!=num[i])
                    {
                        dp[i][k][ch] = MOD(MOD(cnt[i-1][k][0]+cnt[i-1][k][1])*MOD(j*pow10)+MOD(dp[i-1][k][0]+dp[i-1][k][1]+dp[i][k][ch]));
                        cnt[i][k][ch]  = MOD(cnt[i][k][ch]+cnt[i-1][k][0]+cnt[i-1][k][1]);
                        if(j&&((digit!=i)||(digit==i&&!ch)))    sum = MOD(MOD(cnt[i-1][k][0]+cnt[i-1][k][1])*MOD(j*pow10)+MOD(sum+dp[i-1][k][0]+dp[i-1][k][1]));
                    }
                    else
                    {
                        dp[i][k][0] = MOD(cnt[i-1][k][0]*MOD(j*pow10)+MOD(dp[i-1][k][0]+dp[i][k][0]));
                        dp[i][k][1] = MOD(cnt[i-1][k][1]*MOD(j*pow10)+MOD(dp[i-1][k][1]+dp[i][k][1]));
                        cnt[i][k][0] = MOD(cnt[i][k][0]+cnt[i-1][k][0]);
                        cnt[i][k][1] = MOD(cnt[i][k][1]+cnt[i-1][k][1]);
                        if(j&&((digit!=i)||(digit==i&&!ch)))    sum = MOD(MOD(cnt[i-1][k][0]*MOD(j*pow10)+MOD(sum+dp[i-1][k][0])));
                        if(digit!=i&&j) sum = MOD(MOD(cnt[i-1][k][1]*MOD(j*pow10)+MOD(sum+dp[i-1][k][1])));
                    }
                }
                else
                {
                    if(__builtin_popcountll(k)==lim)    continue;
                    if(j!=num[i])
                    {
                        dp[i][k|(1<<j)][ch] = MOD(MOD(cnt[i-1][k][0]+cnt[i-1][k][1])*MOD(j*pow10)+MOD(dp[i-1][k][0]+dp[i-1][k][1]+dp[i][k|(1<<j)][ch]));
                        cnt[i][k|(1<<j)][ch]  = MOD(cnt[i][k|(1<<j)][ch]+cnt[i-1][k][0]+cnt[i-1][k][1]);
                        if(j&&((digit!=i)||(digit==i&&!ch)))    sum = MOD(sum+MOD(MOD(cnt[i-1][k][0]+cnt[i-1][k][1])*MOD(j*pow10)+dp[i-1][k][0]+dp[i-1][k][1]));
                    }
                    else
                    {
                        dp[i][k|(1<<j)][0] = MOD(cnt[i-1][k][0]*MOD(j*pow10)+dp[i-1][k][0]+dp[i][k|(1<<j)][0]);
                        dp[i][k|(1<<j)][1] = MOD(cnt[i-1][k][1]*MOD(j*pow10)+dp[i-1][k][1]+dp[i][k|(1<<j)][1]);
                        cnt[i][k|(1<<j)][0] = MOD(cnt[i][k|(1<<j)][0]+cnt[i-1][k][0]);
                        cnt[i][k|(1<<j)][1] = MOD(cnt[i][k|(1<<j)][1]+cnt[i-1][k][1]);
                        if((j&&((digit!=i)||(digit==i&&!ch))))    sum = MOD(sum+MOD(cnt[i-1][k][0]*MOD(j*pow10)+dp[i-1][k][0]));
                        if(digit!=i&&j) sum = MOD(sum+MOD(cnt[i-1][k][1]*MOD(j*pow10)+dp[i-1][k][1]));
                    }
                }
            }
        }
    }
    return sum;
}
int main()
{
    long long l,r,k;
    scanf("%lld %lld %lld",&l,&r,&k);
    printf("%lld\n",MOD(solve(r,k)-solve(l-1,k)));
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
const long long mod = 998244353;
long long dp[22][1<<10][2];
long long cnt[22][1<<10][2];
long long num[22];
long long bitcnt[1<<10];
long long MOD(long long a)
{
    if(a<0) return (a%mod)+mod;
    if(a>mod)   return a%mod;
    return a;
}
long long solve(long long n,long long lim,long long sum=0)
{
    long long tmp=n,digit = 0;
    while(tmp)  tmp/=10,++digit;
    memset(dp,0,sizeof dp);
    memset(cnt,0,sizeof cnt);
    cnt[0][0][0] = 1;
    for(long long i=1,tmp=n;i<=digit;i++) num[i] = tmp%10,tmp/=10;
    for(long long i=1,pow10=1;i<=digit;i++,pow10*=10)
    {
        pow10 = MOD(pow10);
        for(long long j=0;j<=9;j++)
        {
            long long ch = 0;
            if(j>num[i])    ch = 1;
            for(long long k=0;k<=1023;k++)
            {
                if((1ll<<j)&k)
                {
                    if(j!=num[i])
                    {
                        dp[i][k][ch] = MOD(MOD(cnt[i-1][k][0]+cnt[i-1][k][1])*MOD(j*pow10)+MOD(dp[i-1][k][0]+dp[i-1][k][1]+dp[i][k][ch]));
                        cnt[i][k][ch]  = MOD(cnt[i][k][ch]+cnt[i-1][k][0]+cnt[i-1][k][1]);
                        if(j&&((digit!=i)||(digit==i&&!ch)))    sum = MOD(MOD(cnt[i-1][k][0]+cnt[i-1][k][1])*MOD(j*pow10)+MOD(sum+dp[i-1][k][0]+dp[i-1][k][1]));
                    }
                    else
                    {
                        dp[i][k][0] = MOD(cnt[i-1][k][0]*MOD(j*pow10)+MOD(dp[i-1][k][0]+dp[i][k][0]));
                        dp[i][k][1] = MOD(cnt[i-1][k][1]*MOD(j*pow10)+MOD(dp[i-1][k][1]+dp[i][k][1]));
                        cnt[i][k][0] = MOD(cnt[i][k][0]+cnt[i-1][k][0]);
                        cnt[i][k][1] = MOD(cnt[i][k][1]+cnt[i-1][k][1]);
                        if(j&&((digit!=i)||(digit==i&&!ch)))    sum = MOD(MOD(cnt[i-1][k][0]*MOD(j*pow10)+MOD(sum+dp[i-1][k][0])));
                        if(digit!=i&&j) sum = MOD(MOD(cnt[i-1][k][1]*MOD(j*pow10)+MOD(sum+dp[i-1][k][1])));
                    }
                }
                else
                {
                    if(bitcnt[i]==lim)    continue;
                    if(j!=num[i])
                    {
                        dp[i][k|(1<<j)][ch] = MOD(MOD(cnt[i-1][k][0]+cnt[i-1][k][1])*MOD(j*pow10)+MOD(dp[i-1][k][0]+dp[i-1][k][1]+dp[i][k|(1<<j)][ch]));
                        cnt[i][k|(1<<j)][ch]  = MOD(cnt[i][k|(1<<j)][ch]+cnt[i-1][k][0]+cnt[i-1][k][1]);
                        if(j&&((digit!=i)||(digit==i&&!ch)))    sum = MOD(sum+MOD(MOD(cnt[i-1][k][0]+cnt[i-1][k][1])*MOD(j*pow10)+dp[i-1][k][0]+dp[i-1][k][1]));
                    }
                    else
                    {
                        dp[i][k|(1<<j)][0] = MOD(cnt[i-1][k][0]*MOD(j*pow10)+dp[i-1][k][0]+dp[i][k|(1<<j)][0]);
                        dp[i][k|(1<<j)][1] = MOD(cnt[i-1][k][1]*MOD(j*pow10)+dp[i-1][k][1]+dp[i][k|(1<<j)][1]);
                        cnt[i][k|(1<<j)][0] = MOD(cnt[i][k|(1<<j)][0]+cnt[i-1][k][0]);
                        cnt[i][k|(1<<j)][1] = MOD(cnt[i][k|(1<<j)][1]+cnt[i-1][k][1]);
                        if((j&&((digit!=i)||(digit==i&&!ch))))    sum = MOD(sum+MOD(cnt[i-1][k][0]*MOD(j*pow10)+dp[i-1][k][0]));
                        if(digit!=i&&j) sum = MOD(sum+MOD(cnt[i-1][k][1]*MOD(j*pow10)+dp[i-1][k][1]));
                    }
                }
            }
        }
    }
    return sum;
}
int main()
{
    long long l,r,k;
    scanf("%lld %lld %lld",&l,&r,&k);
    for(long long i=0;i<=1023;i++)  bitcnt[i] = __builtin_popcountll(i);
    printf("%lld\n",MOD(solve(r,k)-solve(l-1,k)));
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
const long long mod = 998244353;
long long dp[20][1<<10][2];
long long cnt[20][1<<10][2];
long long num[20];
long long MOD(long long a)
{
    while(a<0)      a+=mod;
    while(a>=mod)   a-=mod;
    return a;
}
long long solve(long long n,long long lim,long long sum=0)
{
    long long digit = (long long)log10(n)+1;
    memset(dp,0,sizeof dp);
    memset(cnt,0,sizeof cnt);
    cnt[0][0][0] = 1;
    for(long long i=1,tmp=n;i<=digit;i++) num[i] = tmp%10,tmp/=10;
    for(long long i=1,pow10=1;i<=digit;i++,pow10*=10,pow10%=mod)
    {
        for(long long j=0;j<=9;j++)
        {
            long long ch = 0;
            if(j>num[i])    ch = 1;
            for(long long k=0;k<=1023;k++)
            {
                if((1ll<<j)&k)
                {
                    if(j!=num[i])
                    {
                        dp[i][k][ch] = MOD(MOD(cnt[i-1][k][0]+cnt[i-1][k][1])*MOD(j*pow10)+dp[i-1][k][0]+dp[i-1][k][1]+dp[i][k][ch]);
                        cnt[i][k][ch]  = MOD(cnt[i][k][ch]+cnt[i-1][k][0]+cnt[i-1][k][1]);
//                        if(j&&((digit!=i)||(digit==i&&!ch)))    sum = MOD(sum+MOD(cnt[i-1][k][0]+cnt[i-1][k][1])*MOD(j*pow10)+dp[i-1][k][0]+dp[i-1][k][1]);
                    }
                    else
                    {
                        dp[i][k][0] = MOD(cnt[i-1][k][0]*MOD(j*pow10)+dp[i-1][k][0]+dp[i][k][0]);
                        dp[i][k][1] = MOD(cnt[i-1][k][1]*MOD(j*pow10)+dp[i-1][k][1]+dp[i][k][1]);
                        cnt[i][k][0] = MOD(cnt[i][k][0]+cnt[i-1][k][0]);
                        cnt[i][k][1] = MOD(cnt[i][k][1]+cnt[i-1][k][1]);
//                        if(j&&((digit!=i)||(digit==i&&!ch)))    sum = MOD(sum+MOD(cnt[i-1][k][0]*MOD(j*pow10)+dp[i-1][k][0]));
                    }
                }
                else
                {
                    if(__builtin_popcountll(k)==lim)    continue;
                    if(j!=num[i])
                    {
                        dp[i][k|(1<<j)][ch] = MOD(MOD(cnt[i-1][k][0]+cnt[i-1][k][1])*MOD(j*pow10)+dp[i-1][k][0]+dp[i-1][k][1]+dp[i][k|(1<<j)][ch]);
                        cnt[i][k|(1<<j)][ch]  = MOD(cnt[i][k|(1<<j)][ch]+cnt[i-1][k][0]+cnt[i-1][k][1]);
//                        if(j&&((digit!=i)||(digit==i&&!ch)))    sum = MOD(sum+MOD(MOD(cnt[i-1][k][0]+cnt[i-1][k][1])*MOD(j*pow10)+dp[i-1][k][0]+dp[i-1][k][1]));
                    }
                    else
                    {
                        dp[i][k|(1<<j)][0] = MOD(cnt[i-1][k][0]*MOD(j*pow10)+dp[i-1][k][0]+dp[i][k|(1<<j)][0]);
                        dp[i][k|(1<<j)][1] = MOD(cnt[i-1][k][1]*MOD(j*pow10)+dp[i-1][k][1]+dp[i][k|(1<<j)][1]);
                        cnt[i][k|(1<<j)][0] = MOD(cnt[i][k|(1<<j)][0]+cnt[i-1][k][0]);
                        cnt[i][k|(1<<j)][1] = MOD(cnt[i][k|(1<<j)][1]+cnt[i-1][k][1]);
//                        if(j&&((digit!=i)||(digit==i&&!ch)))    sum = MOD(sum+MOD(cnt[i-1][k][0]*MOD(j*pow10)+dp[i-1][k][0]));
                    }
                }

            }
        }
//        if(n==50&&i==1)
//            printf("%lld\n",sum);
    }
//    printf("%lld\n",sum);
    sum = 0;
    for(long long i=0;i<=1023;i++)  sum = MOD(sum+dp[digit][i][0]);
    return sum;
}
int main()
{
    long long l,r,k;
    scanf("%lld %lld %lld",&l,&r,&k);
    printf("%lld\n",MOD(solve(r,k)-solve(l-1,k)));
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
const long long mod = 998244353;
long long dp[22][1<<10][2];
long long cnt[22][1<<10][2];
long long num[22];
long long bitcnt[1<<10];
long long MOD(long long a)
{
    if(a<0) return (a%mod)+mod;
    if(a>=mod)   return a%mod;
    return a;
}
long long solve(long long n,long long lim,long long sum=0)
{
    long long tmp=n,digit = 0;
    while(tmp)  tmp/=10,++digit;
    memset(dp,0,sizeof dp);
    memset(cnt,0,sizeof cnt);
    cnt[0][0][0] = 1;
    for(long long i=1,tmp=n;i<=digit;i++) num[i] = tmp%10,tmp/=10;
    for(long long i=1,pow10=1;i<=digit;i++,pow10*=10)
    {
        pow10 = MOD(pow10);
        for(long long j=0;j<=9;j++)
        {
            long long ch = 0;
            if(j>num[i])    ch = 1;
            for(long long k=0;k<=1023;k++)
            {
                if((1ll<<j)&k)
                {
                    if(j!=num[i])
                    {
                        dp[i][k][ch] = MOD(MOD(cnt[i-1][k][0]+cnt[i-1][k][1])*MOD(j*pow10)+MOD(dp[i-1][k][0]+dp[i-1][k][1]+dp[i][k][ch]));
                        cnt[i][k][ch]  = MOD(cnt[i][k][ch]+cnt[i-1][k][0]+cnt[i-1][k][1]);
                        if(j&&((digit!=i)||(digit==i&&!ch)))    sum = MOD(MOD(cnt[i-1][k][0]+cnt[i-1][k][1])*MOD(j*pow10)+MOD(sum+dp[i-1][k][0]+dp[i-1][k][1]));
                    }
                    else
                    {
                        dp[i][k][0] = MOD(cnt[i-1][k][0]*MOD(j*pow10)+MOD(dp[i-1][k][0]+dp[i][k][0]));
                        dp[i][k][1] = MOD(cnt[i-1][k][1]*MOD(j*pow10)+MOD(dp[i-1][k][1]+dp[i][k][1]));
                        cnt[i][k][0] = MOD(cnt[i][k][0]+cnt[i-1][k][0]);
                        cnt[i][k][1] = MOD(cnt[i][k][1]+cnt[i-1][k][1]);
                        if(j&&((digit!=i)||(digit==i&&!ch)))    sum = MOD(MOD(cnt[i-1][k][0]*MOD(j*pow10)+MOD(sum+dp[i-1][k][0])));
                        if(digit!=i&&j) sum = MOD(MOD(cnt[i-1][k][1]*MOD(j*pow10)+MOD(sum+dp[i-1][k][1])));
                    }
                }
                else
                {
                    if(bitcnt[k]==lim)    continue;
                    if(j!=num[i])
                    {
                        dp[i][k|(1<<j)][ch] = MOD(MOD(cnt[i-1][k][0]+cnt[i-1][k][1])*MOD(j*pow10)+MOD(dp[i-1][k][0]+dp[i-1][k][1]+dp[i][k|(1<<j)][ch]));
                        cnt[i][k|(1<<j)][ch]  = MOD(cnt[i][k|(1<<j)][ch]+cnt[i-1][k][0]+cnt[i-1][k][1]);
                        if(j&&((digit!=i)||(digit==i&&!ch)))    sum = MOD(sum+MOD(MOD(cnt[i-1][k][0]+cnt[i-1][k][1])*MOD(j*pow10)+dp[i-1][k][0]+dp[i-1][k][1]));
                    }
                    else
                    {
                        dp[i][k|(1<<j)][0] = MOD(cnt[i-1][k][0]*MOD(j*pow10)+dp[i-1][k][0]+dp[i][k|(1<<j)][0]);
                        dp[i][k|(1<<j)][1] = MOD(cnt[i-1][k][1]*MOD(j*pow10)+dp[i-1][k][1]+dp[i][k|(1<<j)][1]);
                        cnt[i][k|(1<<j)][0] = MOD(cnt[i][k|(1<<j)][0]+cnt[i-1][k][0]);
                        cnt[i][k|(1<<j)][1] = MOD(cnt[i][k|(1<<j)][1]+cnt[i-1][k][1]);
                        if((j&&((digit!=i)||(digit==i&&!ch))))    sum = MOD(sum+MOD(cnt[i-1][k][0]*MOD(j*pow10)+dp[i-1][k][0]));
                        if(digit!=i&&j) sum = MOD(sum+MOD(cnt[i-1][k][1]*MOD(j*pow10)+dp[i-1][k][1]));
                    }
                }
            }
        }
    }
    return sum;
}
int main()
{
    long long l,r,k;
    scanf("%lld %lld %lld",&l,&r,&k);
    for(long long i=0;i<=1023;i++)  bitcnt[i] = __builtin_popcountll(i);
    printf("%lld\n",MOD(solve(r,k)-solve(l-1,k)));
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
const long long mod = 998244353;
long long dp[20][1<<10][2];
long long cnt[20][1<<10][2];
long long num[20];
long long MOD(long long a)
{
    while(a<0)      a+=mod;
    while(a>=mod)   a-=mod;
    return a;
}
long long solve(long long n,long long lim,long long sum=0)
{
    if(!n)  return 0;
    long long digit = (long long)log10(n)+1;
    memset(dp,0,sizeof dp);
    memset(cnt,0,sizeof cnt);
    cnt[0][0][0] = 1;
    for(long long i=1,tmp=n;i<=digit;i++) num[i] = tmp%10,tmp/=10;
    for(long long i=1,pow10=1;i<=digit;i++,pow10*=10,pow10%=mod)
    {
        for(long long j=0;j<=9;j++)
        {
            long long ch = 0;
            if(j>num[i])    ch = 1;
            for(long long k=0;k<=1023;k++)
            {
                if((1ll<<j)&k)
                {
                    if(j!=num[i])
                    {
                        dp[i][k][ch] = MOD(MOD(cnt[i-1][k][0]+cnt[i-1][k][1])*MOD(j*pow10)+dp[i-1][k][0]+dp[i-1][k][1]+dp[i][k][ch]);
                        cnt[i][k][ch]  = MOD(cnt[i][k][ch]+cnt[i-1][k][0]+cnt[i-1][k][1]);
                        if(j&&((digit!=i)||(digit==i&&!ch)))    sum = MOD(sum+MOD(cnt[i-1][k][0]+cnt[i-1][k][1])*MOD(j*pow10)+dp[i-1][k][0]+dp[i-1][k][1]);
                    }
                    else
                    {
                        dp[i][k][0] = MOD(cnt[i-1][k][0]*MOD(j*pow10)+dp[i-1][k][0]+dp[i][k][0]);
                        dp[i][k][1] = MOD(cnt[i-1][k][1]*MOD(j*pow10)+dp[i-1][k][1]+dp[i][k][1]);
                        cnt[i][k][0] = MOD(cnt[i][k][0]+cnt[i-1][k][0]);
                        cnt[i][k][1] = MOD(cnt[i][k][1]+cnt[i-1][k][1]);
                        if(j&&((digit!=i)||(digit==i&&!ch)))    sum = MOD(sum+MOD(cnt[i-1][k][0]*MOD(j*pow10)+dp[i-1][k][0]));
                        if(digit!=i&&j) sum = MOD(sum+MOD(cnt[i-1][k][1]*MOD(j*pow10)+dp[i-1][k][1]));
                    }
                }
                else
                {
                    if(__builtin_popcountll(k)==lim)    continue;
                    if(j!=num[i])
                    {
                        dp[i][k|(1<<j)][ch] = MOD(MOD(cnt[i-1][k][0]+cnt[i-1][k][1])*MOD(j*pow10)+dp[i-1][k][0]+dp[i-1][k][1]+dp[i][k|(1<<j)][ch]);
                        cnt[i][k|(1<<j)][ch]  = MOD(cnt[i][k|(1<<j)][ch]+cnt[i-1][k][0]+cnt[i-1][k][1]);
                        if(j&&((digit!=i)||(digit==i&&!ch)))    sum = MOD(sum+MOD(MOD(cnt[i-1][k][0]+cnt[i-1][k][1])*MOD(j*pow10)+dp[i-1][k][0]+dp[i-1][k][1]));
                    }
                    else
                    {
                        dp[i][k|(1<<j)][0] = MOD(cnt[i-1][k][0]*MOD(j*pow10)+dp[i-1][k][0]+dp[i][k|(1<<j)][0]);
                        dp[i][k|(1<<j)][1] = MOD(cnt[i-1][k][1]*MOD(j*pow10)+dp[i-1][k][1]+dp[i][k|(1<<j)][1]);
                        cnt[i][k|(1<<j)][0] = MOD(cnt[i][k|(1<<j)][0]+cnt[i-1][k][0]);
                        cnt[i][k|(1<<j)][1] = MOD(cnt[i][k|(1<<j)][1]+cnt[i-1][k][1]);
                        if((j&&((digit!=i)||(digit==i&&!ch))))    sum = MOD(sum+MOD(cnt[i-1][k][0]*MOD(j*pow10)+dp[i-1][k][0]));
                        if(digit!=i&&j) sum = MOD(sum+MOD(cnt[i-1][k][1]*MOD(j*pow10)+dp[i-1][k][1]));
                    }
                }
            }
        }
    }
    return sum;
}
int main()
{
    long long l,r,k;
    scanf("%lld %lld %lld",&l,&r,&k);
    printf("%lld\n",MOD(solve(r,k)-solve(l-1,k)));
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define F first
#define S second
typedef long long   ll;
typedef long double ld;
typedef pair <ll, ll> pll;

ifstream in;
ofstream out;

const long long kk=1000;
const long long ml=kk*kk;
const long long mod=ml*kk+7;
const long long inf=998244353;

ll n,i,j,l,r,k,d;
ll st[20];
vector <ll> m,kol,sc;
vector <ll> reb[10*kk];
map <ll, ll> mp;
bool viv=false;

void count()
{
for (ll i=0; i<d; i++)
  {
  j=i;
  kol.push_back(0);
  while (j)
    kol.back()+=j&1, j>>=1;
  }
}

void build()
{
d=1024;
count();
for (ll i=0; i<d; i++)
  {
  ll i1=i;
  for (j=0; j<10; j++)
    {
    if (i1&1)
      reb[i].push_back(i-(1<<j));
    i1>>=1;
    }
  }
for (ll i=0; i<d; i++)
  {
  sc.push_back(0);
  ll i1=i;
  for (j=0; j<10; j++)
    sc.back()+=j*(i1&1), i1>>=1;
  }
}

ll fkol(ll r, ll z)
{
vector <bool> cif(10, false);
ll r1=r;
ll now=0;
while (r1)
  {
  if (!cif[r1%10])
    cif[r1%10]=true, now+=st[r1%10];
  r1/=10;
  }
ll var[20][d+10];
ll skol[20][d+10];
for (ll i=0; i<20; i++)
  for (ll j=0; j<d+10; j++)
    var[i][j]=0,
    skol[i][j]=0;
skol[0][now]=r%mod;
var[0][now]=1;
for(ll i=1; i<=z; i++)
  {
  for (ll j=1; j<d; j++)
    {
    for (auto s:reb[j])
      {
      var[i][j]+=var[i-1][s];
      skol[i][j]+=skol[i-1][s]*10;
      skol[i][j]+=var[i-1][s]*(mp[j-s]);
      var[i][j]%=mod;
      skol[i][j]%=mod;
      }
    var[i][j]+=var[i-1][j]*kol[j];
    skol[i][j]+=skol[i-1][j]*10*kol[j];
    skol[i][j]+=sc[j]*var[i-1][j];
    var[i][j]%=mod;
    skol[i][j]%=mod;
//    cout<<"{"<<j<<' '<<var[i][j]<<' '<<skol[i][j]<<"} ";
    }
  }
ll res=0;
for (ll j=0; j<d; j++)
  if (kol[j]<=k)
    res+=skol[z][j], res%=mod;
//cout<<"Fkol "<<r<<' '<<z<<"= "<<res<<endl;
return res;
}

ll work(ll r)
{
if (r<10)
  return r*(r+1)/2;
ll ans=0;
ll z=0;
ans+=fkol(r, 0);
while (r)
  {
  ll c=r%10;
  r/=10;
  for (ll i=0; i<c; i++)
    ans+=fkol(10*r+i, z), ans%=mod;
  z++;
  }
z-=2;
while (z)
  ans+=fkol(0, z), ans%=mod, z--;
return ans;
}

int main()
{
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
cin>>l>>r>>k;
for (i=0; i<10; i++)
  st[i]=(1<<i);
for (i=0; i<10; i++)
  mp[st[i]]=i;
build();
ll ans=0;
ans+=work(r);
ans-=work(l-1);
ans=(ans%mod+mod)%mod;
cout<<ans<<endl;
/*
for (i=0; i<=50; i++)
  cout<<i<<'_'<<work(i)<<' ';
cout<<endl;
*/

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define F first
#define S second
typedef long long   ll;
typedef long double ld;
typedef pair <ll, ll> pll;

ifstream in;
ofstream out;

const long long kk=1000;
const long long ml=kk*kk;
const long long mod=ml*kk+7;
const long long inf=998244353;

ll n,i,j,l,r,k,d;
ll st[20];
vector <ll> m,kol,sc;
vector <ll> reb[10*kk];
map <ll, ll> mp;
bool viv=false;

void count()
{
for (ll i=0; i<d; i++)
  {
  j=i;
  kol.push_back(0);
  while (j)
    kol.back()+=j&1, j>>=1;
  }
//kol[0]=1;
}

void build()
{
d=1024;
count();
for (ll i=0; i<d; i++)
  {
  ll i1=i;
  for (j=0; j<10; j++)
    {
    if (i1&1)
      reb[i].push_back(i-(1<<j));
    i1>>=1;
    }
  }
for (ll i=0; i<d; i++)
  {
  sc.push_back(0);
  ll i1=i;
  for (j=0; j<10; j++)
    sc.back()+=j*(i1&1), i1>>=1;
  }
}

ll fkol(ll r, ll z)
{
vector <bool> cif(10, false);
ll r1=r;
ll now=0;
while (r1)
  {
  if (!cif[r1%10])
    cif[r1%10]=true, now+=st[r1%10];
  r1/=10;
  }
ll var[20][d+10];
ll skol[20][d+10];
for (ll i=0; i<20; i++)
  for (ll j=0; j<d+10; j++)
    var[i][j]=0,
    skol[i][j]=0;
skol[0][now]=r%mod;
var[0][now]=1;
for(ll i=1; i<=z; i++)
  {
  for (ll j=0; j<d; j++)
    {
    for (auto s:reb[j])
      {
      if (i!=1||j!=1||now!=0)
        var[i][j]+=var[i-1][s];
      skol[i][j]+=skol[i-1][s]*10;
      skol[i][j]+=var[i-1][s]*(mp[j-s]);
      var[i][j]%=mod;
      skol[i][j]%=mod;
      }
    var[i][j]+=var[i-1][j]*kol[j];
    skol[i][j]+=skol[i-1][j]*10*kol[j];
    skol[i][j]+=sc[j]*var[i-1][j];
    var[i][j]%=mod;
    skol[i][j]%=mod;
//    cout<<"{"<<j<<' '<<var[i][j]<<' '<<skol[i][j]<<"} ";
    }
  }
ll res=0;
for (ll j=0; j<d; j++)
  if (kol[j]<=k)
    res+=skol[z][j], res%=mod;
//cout<<"Fkol "<<r<<' '<<z<<"= "<<res<<endl;
return res;
}

ll work(ll r)
{
if (r<10)
  return r*(r+1)/2;
ll ans=0;
ll z=0;
ans+=fkol(r, 0);
while (r)
  {
  ll c=r%10;
  r/=10;
  for (ll i=0; i<c; i++)
    ans+=fkol(10*r+i, z), ans%=mod;
  z++;
  }
z-=2;
while (z)
  ans+=fkol(0, z), ans%=mod, z--;
return ans;
}

int main()
{
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
cin>>l>>r>>k;
for (i=0; i<10; i++)
  st[i]=(1<<i);
for (i=0; i<10; i++)
  mp[st[i]]=i;
build();
ll ans=0;
ans+=work(r);
ans-=work(l-1);
ans=(ans%mod+mod)%mod;
cout<<ans<<endl;
/*
for (i=0; i<=50; i++)
  cout<<i<<'_'<<work(i)<<' ';
cout<<endl;
*/

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define F first
#define S second
typedef long long   ll;
typedef long double ld;
typedef pair <ll, ll> pll;

ifstream in;
ofstream out;

const long long kk=1000;
const long long ml=kk*kk;
const long long mod=ml*kk+7;
const long long inf=998244353;

ll n,i,j,l,r,k,d;
ll st[20];
vector <ll> m,kol,sc;
vector <ll> reb[10*kk];
map <ll, ll> mp;
bool viv=false;

void count()
{
for (ll i=0; i<d; i++)
  {
  j=i;
  kol.push_back(0);
  while (j)
    kol.back()+=j&1, j>>=1;
  }
}

void build()
{
d=1024;
count();
for (ll i=0; i<d; i++)
  {
  ll i1=i;
  for (j=0; j<10; j++)
    {
    if (i1&1)
      reb[i].push_back(i-(1<<j));
    i1>>=1;
    }
  }
for (ll i=0; i<d; i++)
  {
  sc.push_back(0);
  ll i1=i;
  for (j=0; j<10; j++)
    sc.back()+=j*(i1&1), i1>>=1;
  }
}

ll fkol(ll r, ll z)
{
//cout<<"Fkol "<<r<<' '<<z<<"= ";
vector <bool> cif(10, false);
ll r1=r;
ll now=0;
while (r1)
  {
  if (!cif[r1%10])
    cif[r1%10]=true, now+=st[r1%10];
  r1/=10;
  }
ll var[20][d+10];
ll skol[20][d+10];
for (ll i=0; i<20; i++)
  for (ll j=0; j<d+10; j++)
    var[i][j]=0,
    skol[i][j]=0;
skol[0][now]=r%mod;
var[0][now]=1;
for(ll i=1; i<=z; i++)
  {
  for (ll j=1; j<d; j++)
    {
    for (auto s:reb[j])
      {
      var[i][j]+=var[i-1][s];
      skol[i][j]+=skol[i-1][s]*10;
      skol[i][j]+=var[i-1][s]*(mp[j-s]);
      var[i][j]%=mod;
      skol[i][j]%=mod;
      }
    var[i][j]+=var[i-1][j]*kol[j];
    skol[i][j]+=skol[i-1][j]*10*kol[j];
    skol[i][j]+=sc[j]*var[i-1][j];
    var[i][j]%=mod;
    skol[i][j]%=mod;
//    cout<<"{"<<j<<' '<<var[i][j]<<' '<<skol[i][j]<<"} ";
    }
  }
ll res=0;
for (ll j=0; j<d; j++)
  if (kol[j]<=k)
    res+=skol[z][j], res%=mod;
//cout<<res<<endl;
 return res;
}

ll work(ll r)
{
if (r<10)
  return r*(r+1)/2;
ll ans=0;
ll z=0;
ans+=fkol(r, 0);
while (r)
  {
  ll c=r%10;
  r/=10;
  for (ll i=0; i<c; i++)
    ans+=fkol(10*r+i, z), ans%=mod;
  z++;
  }
z--;
return ans;
}

int main()
{
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
cin>>l>>r>>k;
for (i=0; i<10; i++)
  st[i]=(1<<i);
for (i=0; i<10; i++)
  mp[st[i]]=i;
build();
ll ans=0;
ans+=work(r);
ans-=work(l-1);
ans=(ans%mod+mod)%mod;
cout<<ans<<endl;
/*
for (i=0; i<=50; i++)
  cout<<i<<'_'<<work(i)<<' ';
cout<<endl;
*/

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define F first
#define S second
typedef long long   ll;
typedef long double ld;
typedef pair <ll, ll> pll;

ifstream in;
ofstream out;

const long long kk=1000;
const long long ml=kk*kk;
const long long mod=998244353;
const long long inf=998244353;

ll n,i,j,l,r,k,d;
ll st[20];
vector <ll> m,kol,sc;
vector <ll> reb[10*kk];
map <ll, ll> mp;
bool viv=false;

void count()
{
for (ll i=0; i<d; i++)
  {
  ll j=i;
  kol.push_back(0);
  while (j)
    kol.back()+=j&1, j>>=1;
  }
//kol[0]=1;
}

void build()
{
d=1024;
count();
for (ll i=0; i<d; i++)
  {
  ll i1=i;
  for (ll j=0; j<10; j++)
    {
    if (i1&1)
      reb[i].push_back(i-(1<<j));
    i1>>=1;
    }
  }
for (ll i=0; i<d; i++)
  {
  sc.push_back(0);
  ll i1=i;
  for (ll j=0; j<10; j++)
    sc.back()+=j*(i1&1), i1>>=1;
  }
}

ll fkol(ll r, ll z)
{
vector <bool> cif(10, false);
ll r1=r;
ll now=0;
while (r1)
  {
  if (!cif[r1%10])
    cif[r1%10]=true, now+=st[r1%10];
  r1/=10;
  }
ll var[20][d+10];
ll skol[20][d+10];
for (ll i=0; i<20; i++)
  for (ll j=0; j<d+10; j++)
    var[i][j]=0,
    skol[i][j]=0;
skol[0][now]=r%mod;
var[0][now]=1;
for(ll i=1; i<=z; i++)
  {
  for (ll j=0; j<d; j++)
    {
    for (auto s:reb[j])
      {
      if (j!=1)
        var[i][j]+=var[i-1][s];
      skol[i][j]+=skol[i-1][s]*10;
      skol[i][j]+=var[i-1][s]*(mp[j-s]);
      var[i][j]%=mod;
      skol[i][j]%=mod;
      }
    var[i][j]+=var[i-1][j]*kol[j];
    skol[i][j]+=skol[i-1][j]*10*kol[j];
    skol[i][j]+=sc[j]*var[i-1][j];
    var[i][j]%=mod;
    skol[i][j]%=mod;
//    cout<<"{"<<j<<' '<<var[i][j]<<' '<<skol[i][j]<<"} ";
    }
  }
ll res=0;
for (ll j=0; j<d; j++)
  if (kol[j]<=k)
    res+=skol[z][j], res%=mod;
//cout<<"Fkol "<<r<<' '<<z<<"= "<<res<<endl;
return res;
}

ll work(ll r)
{
if (r<10ll)
  return r*(r+1)/2;
ll ans=0;
ll z=0;
ans+=fkol(r, 0);
while (r)
  {
  ll c=r%10;
  r/=10;
  for (ll i=0; i<c; i++)
    ans+=fkol(10*r+i, z), ans%=mod;
  z++;
  }
z-=2;
while (z)
  ans+=fkol(0, z), ans%=mod, z--;
return ans;
}

int main()
{
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
cin>>l>>r>>k;
for (i=0; i<10; i++)
  st[i]=(1<<i);
for (i=0; i<10; i++)
  mp[st[i]]=i;
build();
ll ans=0;
ans+=work(r);
ans-=work(l-1);
ans=(ans%mod+mod)%mod;
cout<<ans<<endl;
/*
for (i=0; i<=50; i++)
  cout<<i<<'_'<<work(i)<<' ';
cout<<endl;
*/

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define F first
#define S second
typedef long long   ll;
typedef long double ld;
typedef pair <ll, ll> pll;

ifstream in;
ofstream out;

const long long kk=1000;
const long long ml=kk*kk;
const long long mod=ml*kk+7;
const long long inf=998244353;

ll n,i,j,l,r,k,d;
ll st[20];
vector <ll> m,kol,sc;
vector <ll> reb[10*kk];
map <ll, ll> mp;
bool viv=false;

void count()
{
for (ll i=0; i<d; i++)
  {
  j=i;
  kol.push_back(0);
  while (j)
    kol.back()+=j&1, j>>=1;
  }
//kol[0]=1;
}

void build()
{
d=1024;
count();
for (ll i=0; i<d; i++)
  {
  ll i1=i;
  for (j=0; j<10; j++)
    {
    if (i1&1)
      reb[i].push_back(i-(1<<j));
    i1>>=1;
    }
  }
for (ll i=0; i<d; i++)
  {
  sc.push_back(0);
  ll i1=i;
  for (j=0; j<10; j++)
    sc.back()+=j*(i1&1), i1>>=1;
  }
}

ll fkol(ll r, ll z)
{
vector <bool> cif(10, false);
ll r1=r;
ll now=0;
while (r1)
  {
  if (!cif[r1%10])
    cif[r1%10]=true, now+=st[r1%10];
  r1/=10;
  }
ll var[20][d+10];
ll skol[20][d+10];
for (ll i=0; i<20; i++)
  for (ll j=0; j<d+10; j++)
    var[i][j]=0,
    skol[i][j]=0;
skol[0][now]=r%mod;
var[0][now]=1;
for(ll i=1; i<=z; i++)
  {
  for (ll j=0; j<d; j++)
    {
    for (auto s:reb[j])
      {
      if (i!=1||s!=0||j!=1)
        var[i][j]+=var[i-1][s];
      skol[i][j]+=skol[i-1][s]*10;
      skol[i][j]+=var[i-1][s]*(mp[j-s]);
      var[i][j]%=mod;
      skol[i][j]%=mod;
      }
    var[i][j]+=var[i-1][j]*kol[j];
    skol[i][j]+=skol[i-1][j]*10*kol[j];
    skol[i][j]+=sc[j]*var[i-1][j];
    var[i][j]%=mod;
    skol[i][j]%=mod;
//    cout<<"{"<<j<<' '<<var[i][j]<<' '<<skol[i][j]<<"} ";
    }
  }
ll res=0;
for (ll j=0; j<d; j++)
  if (kol[j]<=k)
    res+=skol[z][j], res%=mod;
//cout<<"Fkol "<<r<<' '<<z<<"= "<<res<<endl;
return res;
}

ll work(ll r)
{
if (r<10)
  return r*(r+1)/2;
ll ans=0;
ll z=0;
ans+=fkol(r, 0);
while (r)
  {
  ll c=r%10;
  r/=10;
  for (ll i=0; i<c; i++)
    ans+=fkol(10*r+i, z), ans%=mod;
  z++;
  }
z-=2;
while (z)
  ans+=fkol(0, z), ans%=mod, z--;
return ans;
}

int main()
{
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
cin>>l>>r>>k;
for (i=0; i<10; i++)
  st[i]=(1<<i);
for (i=0; i<10; i++)
  mp[st[i]]=i;
build();
ll ans=0;
ans+=work(r);
ans-=work(l-1);
ans=(ans%mod+mod)%mod;
cout<<ans<<endl;
/*
for (i=0; i<=50; i++)
  cout<<i<<'_'<<work(i)<<' ';
cout<<endl;
*/

    return 0;
}


#include <cstdio>
#include <cstring>
#include <algorithm>
#include <utility>

#define mpr make_pair

using namespace std;

typedef pair<long long, int> pli;

const long long MOD = 998244353;
const int MAXD = 20;
const int MAXS = 11;

int k;

int digit[MAXD];
int cnt;

long long pow10[MAXD];

pli dp[MAXD][1<<MAXS];

long long dfscnt = 0;

inline pli dfs(int d, int s, bool f, bool has0)
{
    if (d < 0) return mpr(0, 1);

    if (!f && dp[d][s].first != -1) return dp[d][s];

    long long ans = 0;
    int maxd = f ? digit[d] : 9;
    int cc = 0;
    for (int dd = 0; dd <= maxd; dd++)
    {
        int ns = s;
        if (!(has0 && dd==0))
        {
            ns |= (1<<dd);
        }
        int kk = 0, ts = ns;
        while (ts > 0)
        {
            if (ts & 1) kk++;
            ts >>= 1;
        }
        if (kk <= k)
        {
            pli ret = dfs(d-1, ns, f&&(dd==maxd), has0&&dd==0);
            cc += ret.second;
            ans = (ans + ret.first + dd*pow10[d]*ret.second) % MOD;
        }
    }

    pli pans = mpr(ans, cc);
    if (!f) dp[d][s] = pans;

    return pans;
}

inline long long ddp(long long n)
{
    memset(digit, 0, sizeof(digit));
    cnt = 0;
    while (n > 0)
    {
        digit[cnt++] = n % 10;
        n /= 10;
    }
    return dfs(cnt-1, 0, true, true).first % MOD;
}

inline void init()
{
    memset(dp, -1, sizeof(dp));
    pow10[0] = 1;
    for (int i = 1; i < MAXD; i++)
    {
        pow10[i] = pow10[i-1] * 10 % MOD;
    }
}

int main()
{
    init();

    long long l, r;
    scanf("%lld%lld%d", &l, &r, &k);
    long long ans = ddp(r) - ddp(l-1);
    ans = ((ans % MOD) + MOD) % MOD;
    printf("%lld\n", ans);
    return 0;
}


#include <cstdio>
#include <cstring>
#include <algorithm>
#include <utility>

#define mpr make_pair

using namespace std;

typedef pair<long long, long long> pll;

const long long MOD = 998244353;
const int MAXD = 20;
const int MAXS = 11;

int k;

int digit[MAXD];
int cnt;

long long pow10[MAXD];

pll dp[MAXD][1<<MAXS];

long long dfscnt = 0;

inline pll dfs(int d, int s, bool f, bool has0)
{
    if (d < 0) return mpr(0, 1);

    if (!f && dp[d][s].first != -1) return dp[d][s];

    long long ans = 0;
    int maxd = f ? digit[d] : 9;
    long long cc = 0;
    for (int dd = 0; dd <= maxd; dd++)
    {
        int ns = s;
        if (!(has0 && dd==0))
        {
            ns |= (1<<dd);
        }
        int kk = 0, ts = ns;
        while (ts > 0)
        {
            if (ts & 1) kk++;
            ts >>= 1;
        }
        if (kk <= k)
        {
            pll ret = dfs(d-1, ns, f&&(dd==maxd), has0&&dd==0);
            cc += ret.second;
            ans = (ans + ret.first + dd*pow10[d]%MOD*ret.second) % MOD;
        }
    }

    pll pans = mpr(ans, cc);
    if (!f) dp[d][s] = pans;

    return pans;
}

inline long long ddp(long long n)
{
    memset(digit, 0, sizeof(digit));
    cnt = 0;
    while (n > 0)
    {
        digit[cnt++] = n % 10;
        n /= 10;
    }
    return dfs(cnt-1, 0, true, true).first % MOD;
}

inline void init()
{
    memset(dp, -1, sizeof(dp));
    pow10[0] = 1;
    for (int i = 1; i < MAXD; i++)
    {
        pow10[i] = pow10[i-1] * 10 % MOD;
    }
}

int main()
{
    init();

    long long l, r;
    scanf("%lld%lld%d", &l, &r, &k);
    long long ans = ddp(r) - ddp(l-1);
    ans = ((ans % MOD) + MOD) % MOD;
    printf("%lld\n", ans);
    return 0;
}


#include <cstdio>
#include <cstring>
#include <algorithm>
#include <utility>

#define mpr make_pair

using namespace std;

typedef pair<long long, long long> pll;

const long long MOD = 998244353;
const int MAXD = 20;
const int MAXS = 11;

int k;

int digit[MAXD];
int cnt;

long long pow10[MAXD];

pll dp[MAXD][1<<MAXS];

long long dfscnt = 0;

inline pll dfs(int d, int s, bool f, bool has0)
{
    if (d < 0) return mpr(0, 1);

    if (!f && dp[d][s].first != -1) return dp[d][s];

    long long ans = 0;
    int maxd = f ? digit[d] : 9;
    long long cc = 0;
    for (int dd = 0; dd <= maxd; dd++)
    {
        int ns = s;
        if (!(has0 && dd==0))
        {
            ns |= (1<<dd);
        }
        int kk = 0, ts = ns;
        while (ts > 0)
        {
            if (ts & 1) kk++;
            ts >>= 1;
        }
        if (kk <= k)
        {
            pll ret = dfs(d-1, ns, f&&(dd==maxd), has0&&dd==0);
            cc += ret.second;
            cc %= MOD;
            ans = (ans + ret.first + dd*pow10[d]%MOD*ret.second) % MOD;
        }
    }

    pll pans = mpr(ans, cc);
    if (!f) dp[d][s] = pans;

    return pans;
}

inline long long ddp(long long n)
{
    memset(digit, 0, sizeof(digit));
    cnt = 0;
    while (n > 0)
    {
        digit[cnt++] = n % 10;
        n /= 10;
    }
    return dfs(cnt-1, 0, true, true).first % MOD;
}

inline void init()
{
    memset(dp, -1, sizeof(dp));
    pow10[0] = 1;
    for (int i = 1; i < MAXD; i++)
    {
        pow10[i] = pow10[i-1] * 10 % MOD;
    }
}

int main()
{
    init();

    long long l, r;
    scanf("%lld%lld%d", &l, &r, &k);
    long long ans = ddp(r) - ddp(l-1);
    ans = ((ans % MOD) + MOD) % MOD;
    printf("%lld\n", ans);
    return 0;
}


#include <cstdio>
#include <cstring>
#include <algorithm>
#include <utility>

#define mpr make_pair

using namespace std;

typedef pair<long long, long long> pll;

const long long MOD = 998244353;
const int MAXD = 20;
const int MAXS = 11;

int k;

int digit[MAXD];
int cnt;

long long pow10[MAXD];

pll dp[MAXD][1<<MAXS];

long long dfscnt = 0;

inline pll dfs(int d, int s, bool f, bool has0)
{
    if (d < 0) return mpr(0, 1);

    if (!f && dp[d][s].first != -1) return dp[d][s];

    long long ans = 0;
    int maxd = f ? digit[d] : 9;
    long long cc = 0;
    for (int dd = 0; dd <= maxd; dd++)
    {
        int ns = s;
        if (!(has0 && dd==0))
        {
            ns |= (1<<dd);
        }
        int kk = 0, ts = ns;
        while (ts > 0)
        {
            if (ts & 1) kk++;
            ts >>= 1;
        }
        if (kk <= k)
        {
            pll ret = dfs(d-1, ns, f&&(dd==maxd), has0&&dd==0);
            cc += ret.second;
            ans = (ans + ret.first + dd*pow10[d]*ret.second) % MOD;
        }
    }

    pll pans = mpr(ans, cc);
    if (!f) dp[d][s] = pans;

    return pans;
}

inline long long ddp(long long n)
{
    memset(digit, 0, sizeof(digit));
    cnt = 0;
    while (n > 0)
    {
        digit[cnt++] = n % 10;
        n /= 10;
    }
    return dfs(cnt-1, 0, true, true).first % MOD;
}

inline void init()
{
    memset(dp, -1, sizeof(dp));
    pow10[0] = 1;
    for (int i = 1; i < MAXD; i++)
    {
        pow10[i] = pow10[i-1] * 10 % MOD;
    }
}

int main()
{
    init();

    long long l, r;
    scanf("%lld%lld%d", &l, &r, &k);
    long long ans = ddp(r) - ddp(l-1);
    ans = ((ans % MOD) + MOD) % MOD;
    printf("%lld\n", ans);
    return 0;
}


#include <bits/stdc++.h>

#define endl '\n'
#define fi first
#define se second
#define forn(i,n) for (int i = 0; i < n; i++)
#define forr(i,a,b) for (int i = a; i <= b; i++)
#define all(v) v.begin(), v.end()
#define pb push_back
#define fastIO(); ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define SZ(s) int(s.size())

using namespace std;

typedef long long lli;
typedef long double ld;
typedef pair<lli, lli> plli;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<vector<lli>> vvlli;
typedef vector<lli> vlli;
typedef vector<pii> vpii;

const lli mod = 998244353;

int k;
vi digits;
lli power[25];
lli mem[2][20][2][2][1030];

lli dp(int i, bool use_all, bool pref, int mask){
	if(i < 0)
		return 1;
	lli& ans = mem[0][i][use_all][pref][mask];
	if(ans != -1) return ans;
	ans = 0;
	int limit = (use_all ? 9 : digits[i]);
	forr(d,0,limit){
		if(__builtin_popcount(mask | (1<<d)) > k) continue;
		ans += dp(i-1,use_all | d < limit, pref & d == 0, (pref && d == 0 ? mask : mask | (1 << d)) );
	}
	ans %= mod;
	return ans;
}

lli dp2(int i, bool use_all, bool pref, int mask){
	if(i < 0)
		return 0;
	lli& ans = mem[1][i][use_all][pref][mask];
	if(ans != -1) return ans;
	ans = 0;
	int limit = (use_all ? 9 : digits[i]);
	forr(d,0,limit){
		if(__builtin_popcount(mask | (1<<d)) > k) continue;
		ans = (ans + ((d*power[i])%mod)*dp(i-1,use_all | d<limit, pref & d==0, (pref && d==0) ? mask : mask | (1<<d))%mod
				+ dp2(i-1,use_all | d<limit, pref & d==0, (pref && d==0) ? mask :  mask | (1<<d))) % mod;
	}
	return ans;
}

lli f(lli x){
	lli aux = x;
	memset(mem,-1,sizeof mem);
	if(x == 0) return 0;
	digits.clear();
	while(x){
		digits.pb(x % 10);
		x /= 10;
	}
	dp(digits.size()-1,false,true,0);
//	cout << "f("<<aux<<") = " << dp2(digits.size()-1,false,true,0) << endl;
	return dp2(digits.size()-1,false,true,0);
}

int main () {
	fastIO();
	power[0] = 1;
	forr(i,1,20) power[i] = power[i-1]*10 % mod;
	lli l,r;
	cin >> l >> r >> k;
	cout << (f(r) - f(l-1) + mod) % mod << endl;
	return 0;
}


#include <bits/stdc++.h>

#define endl '\n'
#define fi first
#define se second
#define forn(i,n) for (int i = 0; i < n; i++)
#define forr(i,a,b) for (int i = a; i <= b; i++)
#define all(v) v.begin(), v.end()
#define pb push_back
#define fastIO(); ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define SZ(s) int(s.size())

using namespace std;

typedef long long lli;
typedef long double ld;
typedef pair<lli, lli> plli;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<vector<lli>> vvlli;
typedef vector<lli> vlli;
typedef vector<pii> vpii;

const lli mod = 998244353;

int k;
vi digits;
lli power[25];
lli mem[2][20][2][1030];

lli dp(int i, bool use_all, int mask){
	if(__builtin_popcount(mask) > k)
		return 0;
	if(i < 0)
		return 1;
	lli& ans = mem[0][i][use_all][mask];
	if(ans != -1) return ans;
	ans = 0;
	int limit = (use_all ? 9 : digits[i]);
	forr(d,0,limit){
		ans += dp(i-1,use_all | d < limit, mask | (1 << d));
	}
	ans %= mod;
	return ans;
}

lli dp2(int i, bool use_all, int mask){
	if(__builtin_popcount(mask) > k)
		return 0;
	if(i < 0)
		return 0;
	lli& ans = mem[1][i][use_all][mask];
	if(ans != -1) return ans;
	ans = 0;
	int limit = (use_all ? 9 : digits[i]);
	forr(d,0,limit){
		ans = (ans + (d*power[i])*dp(i-1,use_all | d<limit, mask | (1<<d))%mod + dp2(i-1,use_all | d<limit, mask | (1<<d))) % mod;
	}
	return ans;
}

lli f(lli x){
	memset(mem,-1,sizeof mem);
	if(x == 0) return 0;
	digits.clear();
	while(x){
		digits.pb(x % 10);
		x /= 10;
	}
	dp(digits.size()-1,false,0);
	return dp2(digits.size()-1,false,0);
}

int main () {
	fastIO();
	power[0] = 1;
	forr(i,1,20) power[i] = power[i-1]*10 % mod;
	lli l,r;
	cin >> l >> r >> k;
	cout << (f(r) - f(l-1) + mod) % mod << endl;
	return 0;
}


#include <bits/stdc++.h>

#define endl '\n'
#define fi first
#define se second
#define forn(i,n) for (int i = 0; i < n; i++)
#define forr(i,a,b) for (int i = a; i <= b; i++)
#define all(v) v.begin(), v.end()
#define pb push_back
#define fastIO(); ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define SZ(s) int(s.size())

using namespace std;

typedef long long lli;
typedef long double ld;
typedef pair<lli, lli> plli;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<vector<lli>> vvlli;
typedef vector<lli> vlli;
typedef vector<pii> vpii;

const lli mod = 998244353;

int k;
vi digits;
lli power[25];
lli mem[2][20][2][1030];

lli dp(int i, bool use_all, int mask){
	if(__builtin_popcount(mask) > k)
		return 0;
	if(i < 0)
		return 1;
	lli& ans = mem[0][i][use_all][mask];
	if(ans != -1) return ans;
	ans = 0;
	int limit = (use_all ? 9 : digits[i]);
	forr(d,0,limit){
		ans += dp(i-1,use_all | d < limit, mask | (1 << d));
	}
	ans %= mod;
	return ans;
}

lli dp2(int i, bool use_all, int mask){
	if(__builtin_popcount(mask) > k)
		return 0;
	if(i < 0)
		return 0;
	lli& ans = mem[1][i][use_all][mask];
	if(ans != -1) return ans;
	ans = 0;
	int limit = (use_all ? 9 : digits[i]);
	forr(d,0,limit){
		ans = (ans + ((d*power[i])%mod)*dp(i-1,use_all | d<limit, mask | (1<<d))%mod + dp2(i-1,use_all | d<limit, mask | (1<<d))) % mod;
	}
	return ans;
}

lli f(lli x){
	memset(mem,-1,sizeof mem);
	if(x == 0) return 0;
	digits.clear();
	while(x){
		digits.pb(x % 10);
		x /= 10;
	}
	dp(digits.size()-1,false,0);
	return dp2(digits.size()-1,false,0);
}

int main () {
	fastIO();
	power[0] = 1;
	forr(i,1,20) power[i] = power[i-1]*10 % mod;
	lli l,r;
	cin >> l >> r >> k;
	cout << (f(r) - f(l-1) + mod) % mod << endl;
	return 0;
}


#include <bits/stdc++.h>

#define endl '\n'
#define fi first
#define se second
#define forn(i,n) for (int i = 0; i < n; i++)
#define forr(i,a,b) for (int i = a; i <= b; i++)
#define all(v) v.begin(), v.end()
#define pb push_back
#define fastIO(); ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define SZ(s) int(s.size())

using namespace std;

typedef long long lli;
typedef long double ld;
typedef pair<lli, lli> plli;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<vector<lli>> vvlli;
typedef vector<lli> vlli;
typedef vector<pii> vpii;

const lli mod = 998244353;

int k;
vi digits;
lli power[20];
lli mem[2][20][2][1030];

lli dp(int i, bool use_all, int mask){
	if(__builtin_popcount(mask) > k)
		return 0;
	if(i < 0)
		return 1;
	lli& ans = mem[0][i][use_all][mask];
	if(ans != -1) return ans;
	ans = 0;
	int limit = (use_all ? 9 : digits[i]);
	forr(d,0,limit){
		ans += dp(i-1,use_all | d < limit, mask | (1 << d));
	}
	ans %= mod;
	return ans;
}

lli dp2(int i, bool use_all, int mask){
	if(__builtin_popcount(mask) > k)
		return 0;
	if(i < 0)
		return 0;
	lli& ans = mem[1][i][use_all][mask];
	if(ans != -1) return ans;
	ans = 0;
	int limit = (use_all ? 9 : digits[i]);
	forr(d,0,limit){
		ans = (ans + (d*power[i])*dp(i-1,use_all | d<limit, mask | (1<<d))%mod + dp2(i-1,use_all | d<limit, mask | (1<<d))) % mod;
	}
	return ans;
}

lli f(lli x){
	memset(mem,-1,sizeof mem);
	if(x == 0) return 0;
	digits.clear();
	while(x){
		digits.pb(x % 10);
		x /= 10;
	}
	dp(digits.size()-1,false,0);
	return dp2(digits.size()-1,false,0);
}

int main () {
	fastIO();
	power[0] = 1;
	forr(i,1,20) power[i] = power[i-1]*10 % mod;
	lli l,r;
	cin >> l >> r >> k;
	cout << (f(r) - f(l-1) + mod) % mod << endl;
	return 0;
}


#include <bits/stdc++.h>
#define MOD 998244353

typedef long long ll;
using namespace std;

// dp[i][j].first  ==> the total number that could be added to the sum when
// the current state is i and is at the jth position
pair<ll, ll> dp[1 << 10][19];
int bitcnt[1 << 10];
ll p10[19];
string a;
int n, k;

pair<ll,ll> dfs(int bi, int pos, int flag) {
	if (pos == n && bi == 1) return make_pair(0,0);
	if (pos == n) return make_pair(0, 1);
	if (dp[bi][pos].first != 0 && !flag) {
		return dp[bi][pos];
	}

	ll ans = 0;
	ll cnt = 0;
	int upper = flag ? a[pos] - '0' : 9;
	for (int i = 0 ; i <= upper; i++) {
		int nextstate = bi | (1 << i);
		if (bitcnt[nextstate] <= k) {
			pair<ll, ll> p = dfs(nextstate, pos + 1, flag && i == upper);
			cnt = (cnt + p.second) % MOD;
			ans = (ans + p.second * i * p10[n - pos - 1]+ p.first) % MOD;
		}
	}

	if (!flag) {
		dp[bi][pos] = make_pair(ans, cnt);
	}
	return make_pair(ans, cnt);
}

ll solve(ll num) {
	a = to_string(num);
	n = (int) a.length();
	auto p = dfs(0, 0, 1);
	return p.first;
}

int main() {
	ll l, r;
	int i, j;
	p10[0] = 1;
	for (i = 1; i <= 18; i++) {
		p10[i] = (p10[i-1] * 10) % MOD;
	}
	for (i = 1 ; i < 1024; i++) {
		for (j = 0; j < 10; j++) {
			if (i & (1 << j)) {
				bitcnt[i]++;
			}
		}
	}

	cin >> l >> r >> k;
	cout << (solve(r) - solve(l - 1) + MOD) % MOD<< endl;
	return 0;
}


#include <bits/stdc++.h>
#define MOD 998244353

typedef long long ll;
using namespace std;

// dp[i][j].first  ==> the total number that could be added to the sum when
// the current state is i and is at the jth position
pair<ll, ll> dp[1100][20];
int bitcnt[1100];
ll p10[21];
string a;
int n, k;

pair<ll,ll> dfs(int bi, int pos, int flag, int leading) {
	// if (pos == n && bi == 1) return make_pair(0,0);
	if (pos == -1) return make_pair(0, 1);
	if (dp[bi][pos].second != -1 && !flag && !leading) {
		return dp[bi][pos];
	}

	ll ans = 0;
	ll cnt = 0;
	int upper = (flag ? a[n - pos - 1] - '0' : 9);
	for (int i = 0 ; i <= upper; i++) {
		int nextstate = (bi | (1 << i));
		if ((bi & (1 << i)) == 0 && !(leading && i == 0)) {
			if (bitcnt[nextstate] > k) continue;
			pair<ll, ll> p = dfs(nextstate, pos - 1, flag && (i == upper), leading && (i == 0));
			cnt = (cnt + p.second) % MOD;
			ans = (ans + ((((p.second * i) % MOD) * p10[pos]) % MOD+ p.first) % MOD) % MOD;
		} else {
			pair<ll, ll> p = dfs(bi, pos - 1, flag && (i == upper), leading && (i == 0));
			cnt = (cnt + p.second) % MOD;
			ans = (ans + ((((p.second * i) % MOD) * p10[pos]) % MOD + p.first) % MOD) % MOD;
		}
	}

	if (!flag && !leading) {
		dp[bi][pos] = make_pair(ans % MOD, cnt % MOD);
	}
	return make_pair(ans % MOD, cnt % MOD);
}

ll solve(ll num) {
	a = to_string(num);
	n = (int) a.length();
	pair<ll, ll> p = dfs(0 , n - 1, 1, 1);
	return p.first % MOD;
}

int main() {
	ll l, r;
	int i, j;
	p10[0] = 1;
	for (i = 1; i <= 20; i++) {
		p10[i] = (p10[i-1] * 10) % MOD;
	}

	for (i = 0 ; i < 1100; i++) {
		for (j = 0 ; j < 20; j++) {
			dp[i][j] = make_pair(0, -1);
		}
	}

	bitcnt[0] = 0;
	bitcnt[1] = 1;
	for(i = 2;i < 1100;i++)
		bitcnt[i] = bitcnt[i-(i & -i)] + 1;

	cin >> l >> r >> k;
	cout << (solve(r) - solve(l - 1) + MOD) % MOD<< endl;
	return 0;
}


#include <bits/stdc++.h>
#define MOD 998244353

typedef long long ll;
using namespace std;

// dp[i][j].first  ==> the total number that could be added to the sum when
// the current state is i and is at the jth position
pair<ll, ll> dp[1100][20];
int bitcnt[1100];
ll p10[21];
string a;
int n, k;

pair<ll,ll> dfs(int bi, int pos, int flag, int leading) {
	// if (pos == n && bi == 1) return make_pair(0,0);
	if (pos == n) return make_pair(0, 1);
	if (dp[bi][pos].second != -1 && !flag && !leading) {
		return dp[bi][pos];
	}

	ll ans = 0;
	ll cnt = 0;
	int upper = flag ? a[pos] - '0' : 9;
	for (int i = 0 ; i <= upper; i++) {
		int nextstate = (bi | (1 << i));
		if ((bi & (1 << i)) == 0 && !(leading && i == 0)) {
			if (bitcnt[nextstate] > k) continue;
			pair<ll, ll> p = dfs(nextstate, pos + 1, flag && (i == upper), leading && (i == 0));
			cnt = (cnt + p.second) % MOD;
			ans = (ans + ((((p.second * i) % MOD) * p10[n - pos - 1]) % MOD+ p.first) % MOD) % MOD;
		} else {
			pair<ll, ll> p = dfs(bi, pos + 1, flag && (i == upper), leading && (i == 0));
			cnt = (cnt + p.second) % MOD;
			ans = (ans + ((((p.second * i) % MOD) * p10[n - pos - 1]) % MOD + p.first) % MOD) % MOD;
		}
	}

	if (!flag && !leading) {
		dp[bi][pos] = make_pair(ans, cnt);
	}
	return make_pair(ans, cnt);
}

ll solve(ll num) {
	a = to_string(num);
	n = (int) a.length();
	pair<ll, ll> p = dfs(0, 0, 1, 1);
	return p.first % MOD;
}

int main() {
	ll l, r;
	int i, j;
	p10[0] = 1;
	for (i = 1; i <= 20; i++) {
		p10[i] = (p10[i-1] * 10) % MOD;
	}

	for (i = 0 ; i < 1100; i++) {
		for (j = 0 ; j < 20; j++) {
			dp[i][j] = make_pair(-1, -1);
		}
	}

	bitcnt[0] = 0;
	bitcnt[1] = 1;
	for(i = 2;i < 1100;i++)
		bitcnt[i] = bitcnt[i-(i & -i)] + 1;

	cin >> l >> r >> k;
	cout << (solve(r) - solve(l - 1) + MOD) % MOD<< endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
//数位DP
#define clr(a,b) memset(a,b,sizeof(a))
#define reg      register
#define il       inline
typedef long long ll;
const int maxn = 200000 + 5;
const int minn = 100;
const int mod  = 998244353;
const ll  inf = 0x3f3f3f3f3f3f3f;
struct Node
{
    ll si,pr;
    Node(){}
    Node(ll si,ll pr):si(si),pr(pr){}
}dp[22][1025];
int digit[21];
int k;
ll ppow[20];
Node dfs(int pos,int sta,bool nozero,bool limit)
{
    if(pos==0){return Node(__builtin_popcount(sta)<=k,0);}
    if(!limit&&nozero&&dp[pos][sta].si!=-1){return dp[pos][sta];}
    Node ans(0,0);
    Node res;
    for(int i=0;i<=(limit?digit[pos]:9);++i)
    {
        if(!nozero&&i==0){res=dfs(pos-1,sta,nozero,limit&&i>=digit[pos]);}
        else             {res=dfs(pos-1,sta|(1<<i),nozero||i>0,limit&&i>=digit[pos]);}
        ans.si=(ans.si+res.si)%mod;
        ans.pr=(ans.pr+res.pr+i*ppow[pos-1]%mod*res.si%mod)%mod;
    }
    if(!limit&&nozero)dp[pos][sta]=ans;
    return ans;
}
ll solve(ll num)
{
    int cnt=0;
    while(num)
    {
        digit[++cnt]=num%10;
        num/=10;
    }
    return dfs(cnt,0,0,1).pr;
}
void init()
{
    clr(dp,-1);
    ppow[0]=1;
    for(int i=1;i<=20;++i){ppow[i]=(ppow[i-1]*10)%mod;}
    return ;
}
int main()
{
	cin.tie(0); cout.tie(0);
	ll l,r;
	init();
    cin>>l>>r>>k;
    cout<<(solve(r)-solve(l-1)+mod)%mod<<endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
//数位DP
#define clr(a,b) memset(a,b,sizeof(a))
#define reg      register
#define il       inline
typedef long long ll;
const int maxn = 200000 + 5;
const int minn = 100;
const int mod  = 998244353;
const ll  inf = 0x3f3f3f3f3f3f3f;
struct Node
{
    ll si,pr;
    Node(){}
    Node(ll si,ll pr):si(si),pr(pr){}
}dp[22][1025];
int digit[21];
int k;
ll ppow[20];
Node dfs(int pos,int sta,bool nozero,bool limit)
{
    if(pos==0){return Node(1,0);}
    if(!limit&&nozero&&dp[pos][sta].si!=-1){return dp[pos][sta];}
    Node ans(0,0);
    Node res;
    for(int i=0;i<=(limit?digit[pos]:9);++i)
    {
        if(__builtin_popcount(sta|(1<<i))>k){continue;}
        if(!nozero&&i==0){res=dfs(pos-1,sta,nozero,limit&&i>=digit[pos]);}
        else             {res=dfs(pos-1,sta|(1<<i),nozero||i>0,limit&&i>=digit[pos]);}
        ans.si=(ans.si+res.si)%mod;
        ans.pr=(ans.pr+res.pr+i*ppow[pos-1]%mod*res.si%mod)%mod;
    }
    if(!limit&&nozero)dp[pos][sta]=ans;
    return ans;
}
ll solve(ll num)
{
    int cnt=0;
    while(num)
    {
        digit[++cnt]=num%10;
        num/=10;
    }
    Node res=dfs(cnt,0,0,1);
    return res.pr;
}
void init()
{
    clr(dp,-1);
    ppow[0]=1;
    for(int i=1;i<=20;++i){ppow[i]=(ppow[i-1]*10)%mod;}
    return ;
}
int main()
{
	cin.tie(0); cout.tie(0);
	ll l,r;
	init();
    cin>>l>>r>>k;
    cout<<(solve(r)-solve(l-1)+mod)%mod<<endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
//数位DP
#define clr(a,b) memset(a,b,sizeof(a))
#define reg      register
#define il       inline
typedef long long ll;
const int maxn = 200000 + 5;
const int minn = 100;
const int mod  = 998244353;
const ll  inf = 0x3f3f3f3f3f3f3f;
struct Node
{
    ll si,pr;
    Node(){}
    Node(ll si,ll pr):si(si),pr(pr){}
}dp[22][1025];
int digit[21];
int k;
ll ppow[20];
Node dfs(int pos,int sta,bool nozero,bool limit)
{
    if(pos==0){return Node(__builtin_popcount(sta)<=k,0);}
    if(!limit&&nozero&&dp[pos][sta].si!=-1){return dp[pos][sta];}
    Node ans(0,0);
    Node res;
    for(int i=0;i<=(limit?digit[pos]:9);++i)
    {
        if(__builtin_popcount(sta|(1<<i))>k){continue;}
        if(!nozero&&i==0){res=dfs(pos-1,sta,nozero,limit&&i>=digit[pos]);}
        else             {res=dfs(pos-1,sta|(1<<i),nozero||i>0,limit&&i>=digit[pos]);}
        ans.si=(ans.si+res.si)%mod;
        ans.pr=(ans.pr+res.pr+i*ppow[pos-1]%mod*res.si%mod)%mod;
    }
    if(!limit&&nozero)dp[pos][sta]=ans;
    return ans;
}
ll solve(ll num)
{
    int cnt=0;
    while(num)
    {
        digit[++cnt]=num%10;
        num/=10;
    }
    return dfs(cnt,0,0,1).pr;
}
void init()
{
    clr(dp,-1);
    ppow[0]=1;
    for(int i=1;i<=20;++i){ppow[i]=(ppow[i-1]*10)%mod;}
    return ;
}
int main()
{
	cin.tie(0); cout.tie(0);
	ll l,r;
	init();
    cin>>l>>r>>k;
    cout<<(solve(r)-solve(l-1)+mod)%mod<<endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
//数位DP
#define clr(a,b) memset(a,b,sizeof(a))
#define reg      register
#define il       inline
typedef long long ll;
const int maxn = 200000 + 5;
const int minn = 100;
const int mod  = 998244353;
const ll  inf = 0x3f3f3f3f3f3f3f;
struct Node
{
    ll si,pr;
    Node(){}
    Node(ll si,ll pr):si(si),pr(pr){}
}dp[22][1<<21];
int digit[21];
int k;
ll ppow[20];
Node dfs(int pos,int sta,bool nozero,bool limit)
{
    if(pos==0){return Node(__builtin_popcount(sta)<=k,0);}
    if(!limit&&nozero&&dp[pos][sta].si!=-1){return dp[pos][sta];}
    Node ans(0,0);
    Node res;
    for(int i=0;i<=(limit?digit[pos]:9);++i)
    {
        if(!nozero&&i==0){res=dfs(pos-1,sta,nozero,limit&&i>=digit[pos]);}
        else             {res=dfs(pos-1,sta|(1<<i),nozero||i>0,limit&&i>=digit[pos]);}
        ans.si=(ans.si+res.si)%mod;
        ans.pr=(ans.pr+res.pr+i*ppow[pos-1]%mod*res.si%mod)%mod;
    }
    if(!limit&&nozero)dp[pos][sta]=ans;
    return ans;
}
ll solve(ll num)
{
    int cnt=0;
    while(num)
    {
        digit[++cnt]=num%10;
        num/=10;
    }
    return dfs(cnt,0,0,1).pr;
}
void init()
{
    ppow[0]=1;
    for(int i=1;i<=20;++i){ppow[i]=(ppow[i-1]*10)%mod;}
    clr(dp,-1);
    return ;
}
int main()
{
	cin.tie(0); cout.tie(0);
	ll l,r;
	init();
    cin>>l>>r>>k;
    cout<<(solve(r)-solve(l-1)+mod)%mod<<endl;
	return 0;
}


/**
 *  Author: houtaruijika
 *  Created: 2018.10.26 01:58:06
 */

#include <bits/stdc++.h>

using namespace std;

#define REP(i, n) for (int i = 0; i < n; ++i)
#define FOR(i, a, b) for (int i = a; i <= b; ++i)
#define FORD(i, b, a) for (int i = b; i >= a; --i)

#define sz(v) (int) v.size()
#define all(v) v.begin(), v.end()
#define uni(v) v.erase(unique(all(v)), v.end())

#define DEBUG(x) cerr << #x << " = " << x << endl;
#define DEBUGS(v, a, b) cerr << #v << " = "; FOR(i, a, b) cerr << v[i] << " "; cerr << endl;

const int MOD = 998244353;

long long f[22][1 << 10][2][2];

void add(long long &x, long long y) { x = (x + y % MOD) % MOD; }

long long solve(string s, long long k) {
    memset(f, 0, sizeof f);
    f[0][0][1][0] = 1;
    REP(i, sz(s)) REP(x, 1 << 10) REP(y, 2) REP(dg, 10) {
        if (dg > s[i] - '0' && y) continue;

        int newx = (x == 1 ? 0 : x) | 1 << dg, newy = y && dg == s[i] - '0';

        add(f[i + 1][newx][newy][0], f[i][x][y][0]);
        add(f[i + 1][newx][newy][1], 10 * f[i][x][y][1] + dg * f[i][x][y][0]);
    }
    long long answer = 0;
    REP(x, 1 << 10) REP(y, 2) if (__builtin_popcount(x) <= k) {
        add(answer, f[sz(s)][x][y][1]);
    }
    return answer;
}

int main() {
    long long l, r, k;
    while (cin >> l >> r >> k) {
        cout << (solve(to_string(r), k) - solve(to_string(l - 1), k) + MOD) % MOD << "\n";
    }
    return 0;
}


/**
 *  Author: houtaruijika
 *  Created: 2018.10.26 01:58:06
 */

#include <bits/stdc++.h>

using namespace std;

#define REP(i, n) for (int i = 0; i < n; ++i)
#define FOR(i, a, b) for (int i = a; i <= b; ++i)
#define FORD(i, b, a) for (int i = b; i >= a; --i)

#define sz(v) (int) v.size()
#define all(v) v.begin(), v.end()
#define uni(v) v.erase(unique(all(v)), v.end())

#define DEBUG(x) cerr << #x << " = " << x << endl;
#define DEBUGS(v, a, b) cerr << #v << " = "; FOR(i, a, b) cerr << v[i] << " "; cerr << endl;

const int MOD = 998244353;

long long f[22][1 << 10][2][2];

void add(long long &x, long long y) { x = (x + y % MOD) % MOD; }

long long solve(string s, long long k) {
    memset(f, 0, sizeof f);
    f[0][0][1][0] = 1;
    REP(i, sz(s)) REP(x, 1 << 10) REP(y, 2) REP(dg, 10) {
        if (dg > s[i] - '0' && y) continue;
        add(f[i + 1][x | 1 << dg][y && dg == s[i] - '0'][0], f[i][x][y][0]);
        add(f[i + 1][x | 1 << dg][y && dg == s[i] - '0'][1], 10 * f[i][x][y][1] + dg * f[i][x][y][0]);
    }
    long long answer = 0;
    REP(x, 1 << 10) REP(y, 2) if (__builtin_popcount(x) <= k) {
        add(answer, f[sz(s)][x][y][1]);
    }
    return answer;
}

int main() {
    long long l, r, k;
    while (cin >> l >> r >> k) {
        cout << solve(to_string(r), k) - solve(to_string(l - 1), k) << "\n";
    }
    return 0;
}