#include <bits/stdc++.h>
using namespace std;

#define mp make_pair
#define pb push_back
#define INF 1000000000

typedef long long ll;
typedef pair<int,int> pii;
const double PI = 3.141592653589793238462643383279502884197169399375105820974944592307816406286;

ll gcd(ll a, ll b)
{
	if (a%b) return gcd(b,a%b);
	else return b;
}

ll lcm(ll a, ll b)
{
	return a*b/gcd(a,b);
}

ll N, X, V[112345];
int dp[1000000];
vector<int> primes;
void sieve()
{
	for (int i = 2; i < 1000000; i++)
		dp[i] = 1;
	for (int i = 2; i < 100000; i++)
		for (int j = 2*i; j < 1000000; j+=i)
			dp[j] = 0;
	for (int i = 2; i < 1000000; i++)
		if (dp[i]) primes.push_back(i);
}

map<int,int> primeFactors(ll N) { // remember: vi is vector<int>, ll is long long
map<int,int> factors;
ll PF_idx = 0, PF = primes[PF_idx]; // primes has been populated by sieve
while (PF * PF <= N) { // stop at sqrt(N); N can get smaller
while (N % PF == 0) { N /= PF; if (PF>3) factors[PF]++; } // remove PF
PF = primes[++PF_idx]; // only consider primes!
}
if (N != 1 && N != 2 && N != 3) factors[N]++; // special case if N is a prime
return factors; // if N does not fit in 32-bit integer and is a prime
}
bool bate(map<int,int> m1, map<int,int> m2)
{
	for (auto i = m1.begin(); i != m1.end(); i++)
		if (i->second != m2[i->first])
			return false;
	for (auto i = m2.begin(); i != m2.end(); i++)
		if (i->second != m1[i->first])
			return false;
	return true;
}
int main()
{
	sieve();
	cin >> N >> X;
	map<int,int> inic = primeFactors(X);
	int flag = 1;
	for (int i = 0; i < N-1; i++)
	{
		cin >> X;
		map<int,int> pf = primeFactors(X);
		if (!bate(inic,pf)) flag = 0;
	}
	cout << (flag?"Yes":"No") << endl;
}


#include <bits/stdc++.h>
using namespace std;

#define mp make_pair
#define pb push_back
#define INF 1000000000

typedef long long ll;
typedef pair<int,int> pii;
const double PI = 3.141592653589793238462643383279502884197169399375105820974944592307816406286;

ll gcd(ll a, ll b)
{
	if (a%b) return gcd(b,a%b);
	else return b;
}

ll lcm(ll a, ll b)
{
	return a*b/gcd(a,b);
}

ll N, X, V[112345];
int dp[1000000];
vector<int> primes;
void sieve()
{
	for (int i = 2; i < 1000000; i++)
		dp[i] = 1;
	for (int i = 2; i < 1000000; i++)
		for (int j = 2*i; j < 1000000; j+=i)
			dp[j] = 0;
	for (int i = 2; i < 1000000; i++)
		if (dp[i]) primes.push_back(i);
}

map<int,int> inic;
int flag;
ll primeFactors(ll N) { // remember: vi is vector<int>, ll is long long
map<int,int> factors;
ll cnt = 0;
ll PF_idx = 0, PF = primes[PF_idx]; // primes has been populated by sieve
while (PF * PF <= N) { // stop at sqrt(N); N can get smaller
while (N % PF == 0) { N /= PF; if (PF>3) factors[PF]++; if (factors[PF] == inic[PF]) cnt++; if(factors[PF] > inic[PF]) cnt--; } // remove PF
PF = primes[++PF_idx]; // only consider primes!
}
if (N != 1 && N != 2 && N != 3) factors[N]++; // special case if N is a prime
return cnt; // if N does not fit in 32-bit integer and is a prime
}
bool bate(map<int,int> m1, map<int,int> m2)
{
	if (m1.size() != m2.size()) return false;
	for (auto i = m1.begin(); i != m1.end(); i++)
		if (i->second != m2[i->first])
			return false;
	return true;
}
int main()
{
	sieve();
	cin >> N >> X;
	inic = primeFactors(X);
	flag = 1;
	for (int i = 0; i < N-1; i++)
	{
		cin >> X;
		if (flag) if (primeFactors(X) != inic.size()) flag = 0;

	}
	cout << (flag?"Yes":"No") << endl;
}


#include <bits/stdc++.h>
using namespace std;

#define mp make_pair
#define pb push_back
#define INF 1000000000

typedef long long ll;
typedef pair<int,int> pii;
const double PI = 3.141592653589793238462643383279502884197169399375105820974944592307816406286;

int dp[1000000];
vector<int> primes;
void sieve()
{
	for (int i = 2; i < 1000000; i++)
		dp[i] = 1;
	for (int i = 2; i < 1000000; i++)
		for (int j = 2*i; j < 1000000; j+=i)
			dp[j] = 0;
	for (int i = 2; i < 1000000; i++)
		if (dp[i]) primes.push_back(i);
}

bool bate(ll N) { // remember: vi is vector<int>, ll is long long
map<int,int> factors;
ll PF_idx = 0, PF = primes[PF_idx]; // primes has been populated by sieve
while (PF * PF <= N) { // stop at sqrt(N); N can get smaller
while (N % PF == 0) { N /= PF; if (PF>3) return false; } // remove PF
PF = primes[++PF_idx]; // only consider primes!
}
if (N != 1 && N != 2 && N != 3) return false; // special case if N is a prime
return true; // if N does not fit in 32-bit integer and is a prime
}

int main()
{
	int N, V[112345];
	sieve();
	cin >> N;
	for (int i = 0; i < N; i++) cin >> V[i];
	sort(V,V+N);
	int maior = V[N-1];
	for (int i = N-2; i >= 0; i--)
	{
		if (maior%V[i] || !bate(maior/V[i]))
		{
			cout << "No" << endl;
			return 0;
		}
	}
	cout << "Yes" << endl;
}


#include <bits/stdc++.h>
using namespace std;

typedef long long ll;

ll gcd(ll a, ll b)
{
	if (a%b) return gcd(b,a%b);
	else return b;
}

ll lcm(ll a, ll b)
{
	return a*(b/gcd(a,b));
}

int dp[5000000];
vector<int> primes;
void sieve()
{
	for (int i = 2; i < 5000000; i++)
		dp[i] = 1;
	for (int i = 2; i < 5000000; i++)
		for (int j = 2*i; j < 5000000; j+=i)
			dp[j] = 0;
	for (int i = 2; i < 5000000; i++)
		if (dp[i]) primes.push_back(i);
}

bool bate(ll N)
{
	ll PF_idx = 0, PF = primes[PF_idx];
	while (PF * PF <= N)
	{
		while (N % PF == 0)
		{
			N /= PF;
			if (PF>3) return false;
		}
		PF = primes[++PF_idx];
	}
	if (N > 3) return false;
	return true;
}

int main()
{
	ll N, V[112345];
	sieve();
	cin >> N;
	for (int i = 0; i < N; i++) cin >> V[i];
	sort(V,V+N);
	ll maior = V[N-1];
	for (int i = N-2; i >= 0; i--)
	{
		if (maior%V[i]!=0 && !bate(lcm(maior,V[i])/gcd(maior,V[i])) || maior%V[i]==0 && !bate(maior/V[i]))
		{
			cout << "No" << endl;
			return 0;
		}
	}
	cout << "Yes" << endl;
}


#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

const ll mod = 998244353;

int k;
int n, v[20];

ll dp1[20][2][1 << 10];

ll f(int i, int less, int bit){
    if(__builtin_popcount(bit) > k) return 0;
    if(i == n) return 1;

    ll &ans = dp1[i][less][bit];

    if(~ans) return ans;

    ans = 0;
    if(less){
        for(int d = 0; d < 10; d++)
            ans += f(i+1, 1, bit | (1 << d));
    }
    else{
        for(int d = 0; d < v[i]; d++)
            ans += f(i+1, 1, bit | (1 << d));
        ans += f(i+1, 0, bit | (1 << v[i]));
    }
    while(ans >= mod) ans -= mod;
    return ans;
}

ll p[20];

ll dp[20][2][1 << 10];
ll cnt(int i, int less, int bit){
    if(__builtin_popcount(bit) > k) return 0;
    if(i == n) return 0;

    ll &ans = dp[i][less][bit];

    if(~ans) return ans;

    ans = 0;
    ll tmp;
    int nbit;
    if(less){
        for(int d = 0; d < 10; d++){
            nbit = bit | (1 << d);
            // if(__builtin_popcount(bit) == 0 && !d) nbit = 0;
            tmp = (f(i+1, 1, nbit) * d)%mod;
            tmp = (tmp * p[n-1-i]) % mod;
            ans += tmp + cnt(i+1, 1, nbit);
        }
    }
    else{
        for(int d = 0; d < v[i]; d++){
            nbit = bit | (1 << d);
            // if(__builtin_popcount(bit) == 0 && !d) nbit = 0;
            tmp = (f(i+1, 1, nbit) * d)%mod;
            tmp = (tmp * p[n-1-i]) % mod;
            ans += tmp + cnt(i+1, 1, nbit);
        }
        tmp = (f(i+1, 0, bit | (1 << v[i])) * v[i])%mod;
        tmp = (tmp * p[n-1-i]) % mod;
        ans += tmp + cnt(i+1, 0, bit | (1 << v[i]));
    }
    while(ans >= mod) ans -= mod;
    return ans;
}

ll solve(ll val){
    if(!val) return 0;
    n = 0;
    while(val) v[n++] = val % 10, val /= 10;
    reverse(v, v+n);

    memset(dp1, -1, sizeof dp1);
    memset(dp, -1, sizeof dp);

    return cnt(0, 0, 0);
}

int main(){

    p[0] = 1;
    for(int i = 1; i < 20; i++) p[i] = (10*p[i-1])%mod;

    ll l, r;

    scanf("%lld %lld %d", &l, &r, &k);

    ll ans = solve(r) - solve(l-1);
    if(ans < 0) ans += mod;

    printf("%lld\n", ans);
}


#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

const ll mod = 998244353;

int k;
int n, v[20];

ll dp1[20][2][1 << 10];

ll f(int i, int less, int bit){
    if(__builtin_popcount(bit) > k) return 0;
    if(i == n) return 1;

    ll &ans = dp1[i][less][bit];

    if(~ans) return ans;

    ans = 0;
    if(less){
        for(int d = 0; d < 10; d++)
            ans += f(i+1, 1, bit | (1 << d));
    }
    else{
        for(int d = 0; d < v[i]; d++)
            ans += f(i+1, 1, bit | (1 << d));
        ans += f(i+1, 0, bit | (1 << v[i]));
    }
    while(ans >= mod) ans -= mod;
    return ans;
}

ll p[20];

ll dp[20][2][1 << 10];
ll cnt(int i, int less, int bit){
    if(__builtin_popcount(bit) > k) return 0;
    if(i == n) return 0;

    ll &ans = dp[i][less][bit];

    if(~ans) return ans;

    ans = 0;
    ll tmp;
    int nbit;
    if(less){
        for(int d = 0; d < 10; d++){
            nbit = bit | (1 << d);
            if(__builtin_popcount(bit) == 0 && !d) nbit = 0;
            tmp = (f(i+1, 1, nbit) * d)%mod;
            tmp = (tmp * p[n-1-i]) % mod;
            ans += tmp + cnt(i+1, 1, nbit);
        }
    }
    else{
        for(int d = 0; d < v[i]; d++){
            nbit = bit | (1 << d);
            if(__builtin_popcount(bit) == 0 && !d) nbit = 0;
            tmp = (f(i+1, 1, nbit) * d)%mod;
            tmp = (tmp * p[n-1-i]) % mod;
            ans += tmp + cnt(i+1, 1, nbit);
        }
        tmp = (f(i+1, 0, bit | (1 << v[i])) * v[i])%mod;
        tmp = (tmp * p[n-1-i]) % mod;
        ans += tmp + cnt(i+1, 0, bit | (1 << v[i]));
    }
    while(ans >= mod) ans -= mod;
    return ans;
}

ll solve(ll val){
    if(!val) return 0;
    n = 0;
    while(val) v[n++] = val % 10, val /= 10;
    reverse(v, v+n);

    memset(dp1, -1, sizeof dp1);
    memset(dp, -1, sizeof dp);

    return cnt(0, 0, 0);
}

int main(){

    p[0] = 1;
    for(int i = 1; i < 20; i++) p[i] = (10*p[i-1])%mod;

    ll l, r;

    scanf("%lld %lld %d", &l, &r, &k);

    ll ans = solve(r) - solve(l-1);
    if(ans < 0) ans += mod;

    printf("%lld\n", ans);
}


#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

const ll mod = 998244353;

int k;
int n, v[20];

ll dp1[20][2][1 << 10];

ll f(int i, int less, int bit){
    if(__builtin_popcount(bit) > k) return 0;
    if(i == n) return 1;

    ll &ans = dp1[i][less][bit];

    if(~ans) return ans;

    ans = 0;
    if(less){
        for(int d = 0; d < 10; d++)
            ans += f(i+1, 1, bit | (1 << d));
    }
    else{
        for(int d = 0; d < v[i]; d++)
            ans += f(i+1, 1, bit | (1 << d));
        ans += f(i+1, 0, bit | (1 << v[i]));
    }
    while(ans >= mod) ans -= mod;
    return ans;
}

ll p[20];

ll dp[20][2][1 << 10];
ll cnt(int i, int less, int bit){
    if(__builtin_popcount(bit) > k) return 0;
    if(i == n) return 0;

    ll &ans = dp[i][less][bit];

    if(~ans) return ans;

    ans = 0;
    ll tmp;
    if(less){
        for(int d = 0; d < 10; d++){
            tmp = (f(i+1, 1, bit | (1 << d)) * d)%mod;
            tmp = (tmp * p[n-1-i]) % mod;
            ans = tmp + cnt(i+1, 1, bit | (1 << d));
        }
    }
    else{
        for(int d = 0; d < v[i]; d++){
            tmp = (f(i+1, 1, bit | (1 << d)) * d)%mod;
            tmp = (tmp * p[n-1-i]) % mod;
            ans += tmp + cnt(i+1, 1, bit | (1 << d));
        }
        tmp = (f(i+1, 0, bit | (1 << v[i])) * v[i])%mod;
        tmp = (tmp * p[n-1-i]) % mod;
        ans += tmp + cnt(i+1, 0, bit | (1 << v[i]));
    }
    while(ans >= mod) ans -= mod;
    return ans;
}

ll solve(ll val){
    if(!val) return 0;
    n = 0;
    while(val) v[n++] = val % 10, val /= 10;
    reverse(v, v+n);

    memset(dp1, -1, sizeof dp1);
    memset(dp, -1, sizeof dp);

    return cnt(0, 0, 0);
}

int main(){

    p[0] = 1;
    for(int i = 1; i < 20; i++) p[i] = (10*p[i-1])%mod;

    ll l, r;

    scanf("%lld %lld %d", &l, &r, &k);

    ll ans = solve(r) - solve(l-1);
    if(ans < 0) ans += mod;

    printf("%lld\n", ans);
}


#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

const ll mod = 998244353;

int k;
int n, v[20];

ll dp1[20][2][1 << 10];

ll f(int i, int less, int bit){
    if(__builtin_popcount(bit) > k) return 0;
    if(i == n) return 1;

    ll &ans = dp1[i][less][bit];

    if(~ans) return ans;

    ans = 0;
    if(less){
        for(int d = 0; d < 10; d++)
            ans += f(i+1, 1, bit | (1 << d));
    }
    else{
        for(int d = 0; d < v[i]; d++)
            ans += f(i+1, 1, bit | (1 << d));
        ans += f(i+1, 0, bit | (1 << v[i]));
    }
    while(ans >= mod) ans -= mod;
    return ans;
}

ll p[20];

ll dp[20][2][1 << 10];
ll cnt(int i, int less, int bit){
    if(__builtin_popcount(bit) > k) return 0;
    if(i == n) return 0;

    ll &ans = dp[i][less][bit];

    if(~ans) return ans;

    ans = 0;
    ll tmp;
    if(less){
        for(int d = 0; d < 10; d++){
            tmp = (f(i+1, 1, bit | (1 << d)) * d * p[n-i-1])%mod;
            ans += tmp + cnt(i+1, 1, bit | (1 << d));
        }
    }
    else{
        for(int d = 0; d < v[i]; d++){
            tmp = (f(i+1, 1, bit | (1 << d)) * d * p[n-i-1])%mod;
            ans += tmp + cnt(i+1, 1, bit | (1 << d));
        }
        tmp = (f(i+1, 0, bit | (1 << v[i])) * v[i] * p[n-i-1])%mod;
        ans += tmp + cnt(i+1, 0, bit | (1 << v[i]));
    }
    while(ans >= mod) ans -= mod;
    return ans;
}

ll solve(ll val){
    if(!val) return 0;
    n = 0;
    while(val) v[n++] = val % 10, val /= 10;
    reverse(v, v+n);

    memset(dp1, -1, sizeof dp1);
    memset(dp, -1, sizeof dp);

    return cnt(0, 0, 0);
}

int main(){

    p[0] = 1;
    for(int i = 1; i < 20; i++) p[i] = (10*p[i-1])%mod;

    ll l, r;

    scanf("%lld %lld %d", &l, &r, &k);

    ll ans = solve(r) - solve(l-1);
    if(ans < 0) ans += mod;

    printf("%lld\n", ans);
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll dp[30][20];
int num[30],k;
ll mod=998244353;
ll dfs(int len,int sta,int res,ll cur,bool limit)
{
	if (!len)
	{
	//	cout<<cur<<endl;
		return cur%mod;
	}
	if (!limit && dp[len][res]!=-1)
	return dp[len][res];
	int t=limit?num[len]:9;
	ll ans=0;
	for (int i=0;i<=t;i++)
	{
		if ((sta&(1<<i))!=0)
		{
			ans=(ans+dfs(len-1,sta,res,cur*10+i,limit&&i==t))%mod;
		}
		else
		{
			if (res)
			ans=(ans+dfs(len-1,sta|(1<<i),res-1,cur*10+i,limit&&i==t))%mod;
		}
	}
	if (!limit)
	dp[len][k]=ans;
	return ans;
}
ll solve(ll r)
{
	int len=0;
	while (r)
	{
		num[++len]=r%10;
		r/=10;
	}
	return dfs(len,0,k,0,true);
}
int main()
{
	memset(dp,-1,sizeof(dp));
	ll l,r;
	cin>>l>>r>>k;
	//cout<<solve(r)<<endl<<solve(l-1)<<endl;
	cout<<(solve(r)-solve(l-1)+mod)%mod;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
struct P{
	ll sum,count;
	P()
	{
		sum=0;
		count=0;
	}
};
P dp[30][1025][2];
int num[30],k;
ll mod=998244353;
ll tmp[20];
P dfs(int len,int sta,int res,ll cur,bool limit,int lead)
{
	if (!len)
	{
		P tmp1;
		tmp1.sum=0;
		tmp1.count=1;
		if (lead && !cur)
		tmp1.count=0;
		return tmp1;
	}
	if (!limit && dp[len][sta][lead].sum!=-1)
	{
		return dp[len][sta][lead];
	}
	int t= limit? num[len] : 9;
	P ans;
	for (int i=0;i<=t;i++)
	{
		if ((sta&(1<<i))!=0 || (i==0 && lead))
		{
			P tmp1=dfs(len-1,sta, res, (cur*10+i)%mod , limit&&i==t , i==0 && lead);
			ans.sum=(ans.sum + (i * tmp[len] % mod * tmp1.count%mod + tmp1.sum)%mod)%mod;
			ans.count+=tmp1.count;
		}
		else
		{
			if (res)
			{
				P tmp1=dfs(len-1, sta^(1<<i), res-1, (cur*10+i)%mod , limit&&i==t,false);
				ans.sum=(ans.sum + (i * tmp[len] % mod * tmp1.count %mod + tmp1.sum))%mod;
				ans.count+=tmp1.count;
			}
		}
	}
	if (!limit)
	dp[len][sta][lead]=ans;
	return ans;
}
P solve(ll r)
{
	int len=0;
	while (r)
	{
			num[++len]=r%10;
		r/=10;
	}
	return dfs(len,0,k,0,true,true);
}
int main()
{
	for (int i=0;i<30;i++)
	{
		for (int j=0;j<1025;j++)
		{
			for (int k=0;k<2;k++)
			dp[i][j][k].sum=-1;
		}
	}
	tmp[1]=1;
	for(int i=2;i<=19;i++)
	{
		tmp[i]=tmp[i-1]*10;
		tmp[i]%=mod;
	}
	ll l,r;
	cin>>l>>r>>k;
//	cout<<solve(r).sum<<'\n';
//	cout<<solve(l-1).sum<<'\n';
	cout<<(solve(r).sum-solve(l-1).sum+mod)%mod;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
struct P{
	ll sum,count;
	P()
	{
		sum=0;
		count=0;
	}
};
P dp[30][1025][2];
int num[30],k;
ll mod=998244353;
ll tmp[20];
P dfs(int len,int sta,int res,ll cur,bool limit,int lead)
{
	if (!len)
	{
		P tmp1;
		tmp1.sum=0;
		tmp1.count=1;
		if (lead && !cur)
		tmp1.count=0;
		return tmp1;
	}
	if (!limit && dp[len][sta][lead].sum!=-1)
	{
		return dp[len][sta][lead];
	}
	int t= limit? num[len] : 9;
	P ans;
	for (int i=0;i<=t;i++)
	{
		if ((sta&(1<<i))!=0 || (i==0 && lead))
		{
			P tmp1=dfs(len-1,sta, res, (cur*10+i)%mod , limit&&i==t , i==0 && lead);
			ans.sum=(ans.sum + (i * tmp[len] % mod * tmp1.count%mod + tmp1.sum)%mod)%mod;
			ans.count+=tmp1.count;
		}
		else
		{
			if (res)
			{
				P tmp1=dfs(len-1, sta^(1<<i), res-1, (cur*10+i)%mod , limit&&i==t,false);
				ans.sum=(ans.sum + (i * tmp[len] % mod * tmp1.count %mod + tmp1.sum))%mod;
				ans.count+=tmp1.count;
			}
		}
	}
	if (!limit)
	dp[len][sta][lead]=ans;
	return ans;
}
P solve(ll r)
{
	int len=0;
	while (r)
	{
			num[++len]=r%10;
		r/=10;
	}
	return dfs(len,0,k,0,true,true);
}
int main()
{
	for (int i=0;i<30;i++)
	{
		for (int j=0;j<1025;j++)
		{
			for (int k=0;k<2;k++)
			dp[i][j][k].sum=-1;
		}
	}
	tmp[1]=1;
	for(int i=2;i<=19;i++)
	{
		tmp[i]=tmp[i-1]*10;
		tmp[i]%=mod;
	}
	ll l,r;
	cin>>l>>r>>k;
//	cout<<solve(r).sum<<'\n';
//	cout<<solve(l-1).sum<<'\n';
	cout<<(solve(r).sum-solve(l-1).sum)%mod;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll dp[30][12][1025];
int num[30],k;
ll mod=998244353;
ll dfs(int len,int sta,int res,ll cur,bool limit,bool lead)
{
	if (!len)
	{
		//cout<<cur<<endl;
		return cur;
	}
//	if (!limit && dp[len][res][sta]!=-1)
//	return dp[len][res][sta];
	int t=limit?num[len]:9;
	ll ans=0;
	for (int i=0;i<=t;i++)
	{
		if ((sta&(1<<i))!=0 || (i==0 && lead))
		{
			ans=(ans+dfs(len-1,sta,res,cur*10+i,limit&&i==t,lead&&(!i)))%mod;
		}
		else
		{
			if (res)
			ans=(ans+dfs(len-1,sta^(1<<i),res-1,cur*10+i,limit&&i==t,lead&&(!i)))%mod;
		}
	}
	if (!limit)
	dp[len][res][sta]=ans;
	return ans;
}
ll solve(ll r)
{
	int len=0;
	while (r)
	{
		num[++len]=r%10;
		r/=10;
	}
	return dfs(len,0,k,0,true,true);
}
int main()
{
	memset(dp,-1,sizeof(dp));
	ll l,r;
	cin>>l>>r>>k;
	//solve(r);
	cout<<(solve(r)-solve(l-1)+mod)%mod;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
struct P{
	ll sum,count;
	P()
	{
		sum=0;
		count=0;
	}
};
P dp[30][1025][2];
int num[30],k;
ll mod=998244353;
ll tmp[20];
P dfs(int len,int sta,int res,ll cur,bool limit,int lead)
{
	if (!len)
	{
		P tmp1;
		tmp1.sum=0;
		tmp1.count=1;
		if (lead && !cur)
		tmp1.count=0;
		return tmp1;
	}
	if (!limit && dp[len][sta][lead].sum!=-1)
	{
		return dp[len][sta][lead];
	}
	int t= limit? num[len] : 9;
	P ans;
	for (int i=0;i<=t;i++)
	{
		if ((sta&(1<<i))!=0 || (i==0 && lead))
		{
			P tmp1=dfs(len-1,sta, res, (cur*10+i)%mod , limit&&i==t , i==0 && lead);
			ans.sum=(ans.sum + (i * tmp[len] % mod * tmp1.count%mod + tmp1.sum)%mod)%mod;
			ans.count=(ans.count+tmp1.count)%mod;
		}
		else
		{
			if (res)
			{
				P tmp1=dfs(len-1, sta^(1<<i), res-1, (cur*10+i)%mod , limit&&i==t,false);
				ans.sum=(ans.sum + (i * tmp[len] % mod * tmp1.count %mod + tmp1.sum)%mod)%mod;
				ans.count=(ans.count+tmp1.count)%mod;
			}
		}
	}
	if (!limit)
	dp[len][sta][lead]=ans;
	return ans;
}
P solve(ll r)
{
	int len=0;
	while (r)
	{
			num[++len]=r%10;
		r/=10;
	}
	return dfs(len,0,k,0,true,true);
}
int main()
{
	for (int i=0;i<30;i++)
	{
		for (int j=0;j<1025;j++)
		{
			for (int k=0;k<2;k++)
			dp[i][j][k].sum=-1;
		}
	}
	tmp[1]=1;
	for(int i=2;i<=19;i++)
	{
		tmp[i]=tmp[i-1]*10;
		tmp[i]%=mod;
	}
	ll l,r;
	cin>>l>>r>>k;
//	cout<<solve(r).sum<<'\n';
//	cout<<solve(l-1).sum<<'\n';
	cout<<(solve(r).sum-solve(l-1).sum+mod)%mod;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <functional>
#include <string>
#include <cstring>
using namespace std;
typedef long long ll;
const int inf = 0x3c3c3c3c;
const ll infl = 0x3c3c3c3c3c3c3c3c;
const ll mod = 998244353;

ll L, R, K;
ll dp1[18][1 << 10][2];
ll dp2[18][1 << 10][2];
ll X;
int num[20];
ll md[20];
ll go1(int pos, int mask, int shit) {
	if (pos == -1) return 1;
	ll& cache = dp1[pos][mask][shit];
	if (cache != -1) return cache;
	ll ret = 0;
	int cnt = 0;
	for (int i = 0; i < 10; i++) cnt += ((mask >> i) & 1);
	for (int i = 0; i < 10; i++) {
		if (!shit && num[pos] < i) continue;
		int add = ((~(mask >> i)) & 1);
		if (cnt + add > K) continue;
		int n_mask = (mask | (1 << i));
		if (mask == 0 && i == 0) n_mask = 0;
		ret += go1(pos - 1, n_mask, shit || (i < num[pos]));
	}
	return cache = ret;
}

ll go2(int pos, int mask, int shit) {
	if (pos == -1) return 0;
	ll& cache = dp2[pos][mask][shit];
	if (cache != -1) return cache;
	ll ret = 0;
	int cnt = 0;
	for (int i = 0; i < 10; i++) cnt += ((mask >> i) & 1);
	for (int i = 0; i < 10; i++) {
		if (!shit && num[pos] < i) continue;
		int add = ((~(mask >> i)) & 1);
		if (cnt + add > K) continue;
		int n_mask = (mask | (1 << i));
		if (mask == 0 && i == 0) n_mask = 0;
		int n_shit = (shit || (i < num[pos]));
		ll tmp = (md[pos] * i) % mod * go1(pos - 1, n_mask, n_shit) % mod;

		ret = ((ret + tmp) % mod + go2(pos - 1, n_mask, n_shit)) % mod;
	}
	return cache = ret;
}

void init(ll x) {
	memset(dp1, -1, sizeof(dp1));
	memset(dp2, -1, sizeof(dp2));
	memset(num, 0, sizeof(num));
	X = x;
	int idx = 0;
	while (x) {
		num[idx] = x % 10;
		x /= 10;
		idx++;
	}
}

int main() {
	cin >> L >> R >> K;
	md[0] = 1;
	for (int i = 1; i < 20; i++) {
		md[i] = (md[i - 1] * 10) % mod;
	}
	init(L - 1);
	go1(17, 0, 0);
	ll lo = go2(17, 0, 0);

	init(R);
	go1(17, 0, 0);
	ll hi = go2(17, 0, 0);

	cout << hi - lo << endl;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int inf = 0x3c3c3c3c;
const ll infl = 0x3c3c3c3c3c3c3c3c;
const ll mod = 998244353;

ll L, R, K;
ll dp1[18][1 << 10][2];
ll dp2[18][1 << 10][2];
ll X;
int num[20];
ll md[20];
ll go1(int pos, int mask, int shit){
    if(pos == -1) return 1;
    ll& cache = dp1[pos][mask][shit];
    if(cache != -1) return cache;
    ll ret = 0;
    int cnt = 0;
    for(int i = 0; i < 10; i++) cnt += ((mask >> i) & 1);
    for(int i = 0; i < 10; i++) {
        if(!shit && num[pos] < i) continue;
        int add = ((~(mask >> i)) & 1);
        if(cnt + add > K) continue;
        int n_mask = (mask | (1 << i));
        if(mask == 0 && i == 0) n_mask = 0;
        ret = (ret + go1(pos - 1, n_mask, shit || (i < num[pos]))) % mod;
    }
    return cache = ret;
}

ll go2(int pos, int mask, int shit){
    if(pos == -1) return 0;
    ll& cache = dp2[pos][mask][shit];
    if(cache != -1) return cache;
    ll ret = 0;
    int cnt = 0;
    for(int i = 0; i < 10; i++) cnt += ((mask >> i) & 1);
    for(int i = 0; i < 10; i++) {
        if(!shit && num[pos] < i) continue;
        int add = ((~(mask >> i)) & 1);
        if(cnt + add > K) continue;
        int n_mask = (mask | (1 << i));
        if(mask == 0 && i == 0) n_mask = 0;
        int n_shit = (shit || (i < num[pos]));
        ll tmp = (md[pos] * i) % mod * go1(pos - 1, n_mask, n_shit) % mod;

        ret = ((ret + tmp) % mod + go2(pos - 1, n_mask, n_shit)) % mod;
    }
    return cache = ret;
}

void init(ll x){
    memset(dp1,-1,sizeof(dp1));
    memset(dp2,-1,sizeof(dp2));
    memset(num,0,sizeof(num));
    X = x;
    int idx = 0;
    while(x){
        num[idx] = x % 10;
        x /= 10;
        idx++;
    }
}

int main(){
    cin >> L >> R >> K;
    md[0] = 1;
    for(int i = 1; i < 20; i++) {
        md[i] = (md[i - 1] * 10) % mod;
    }
    init(L - 1);
    go1(17, 0, 0);
    ll lo = go2(17, 0, 0);

    init(R);
    go1(17, 0, 0);
    ll hi = go2(17, 0, 0);

    cout << (hi - lo + mod) % mod << endl;
    return 0;
}


//#include <iostream>
//#include <vector>
//#include <algorithm>
//#include <set>
//#include <map>
//#include <stack>
//#include <queue>
//#include <functional>
//#include <string>
//using namespace std;
//typedef long long ll;
//const int MAXN = 2e5 + 5;
//char str[MAXN];
//int n, ex, ey,x,y;
//int sumx[MAXN], sumy[MAXN];
//map<char, int> dx, dy;
//int main() {
//	dx['U'] = dx['D'] = 0;
//	dx['L'] = -1, dx['R'] = 1;
//
//	dy['U'] = 1, dy['D'] = -1;
//	dy['L'] = dy['R'] = 0;
//
//	scanf("%d", &n);
//	scanf("%s", &str);
//	scanf("%d%d", &ex, &ey);
//
//	for (int i = 1; i <= n; i++) {
//		sumx[i] += sumx[i - 1] + dx[str[i - 1]];
//		sumy[i] += sumy[i - 1] + dy[str[i - 1]];
//	}
//
//	if (sumx[n] == ex && sumy[n] == ey) {
//		puts("0");
//		return 0;
//	}
//
//	int l = 1, r = n;
//	while (l <= r) {
//		int mid = (l + r) >> 1;
//
//		for (int i = 1; i + mid <= n; i++) {
//			int diffx = abs(ex - sumx[n] + (sumx[mid] - sumx[i - 1]));
//			int diffy = abs(ey - sumy[n] + (sumy[mid] - sumy[i - 1]));
//
//			if (mid & 1 == (diffx + diffy) & 1) {
//				if(mid - i )
//
//			}
//			else r = mid - 1;
//		}
//	}
//}
#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <functional>
#include <string>
#include <cstring>
using namespace std;
typedef long long ll;
const int inf = 0x3c3c3c3c;
const ll infl = 0x3c3c3c3c3c3c3c3c;
const ll mod = 998244353;

ll L, R, K;
ll dp1[18][1 << 10][2];
ll dp2[18][1 << 10][2];
ll X;
int num[20];
ll md[20];
ll go1(int pos, int mask, int shit) {
	if (pos == -1) return 1;
	ll& cache = dp1[pos][mask][shit];
	if (cache != -1) return cache;
	ll ret = 0;
	int cnt = 0;
	for (int i = 0; i < 10; i++) cnt += ((mask >> i) & 1);
	for (int i = 0; i < 10; i++) {
		if (!shit && num[pos] < i) continue;
		int add = ((~(mask >> i)) & 1);
		if (cnt + add > K) continue;
		int n_mask = (mask | (1 << i));
		if (mask == 0 && i == 0) n_mask = 0;
		ret = (ret + go1(pos - 1, n_mask, shit || (i < num[pos]))) % mod;
	}
	return cache = ret;
}

ll go2(int pos, int mask, int shit) {
	if (pos == -1) return 0;
	ll& cache = dp2[pos][mask][shit];
	if (cache != -1) return cache;
	ll ret = 0;
	int cnt = 0;
	for (int i = 0; i < 10; i++) cnt += ((mask >> i) & 1);
	for (int i = 0; i < 10; i++) {
		if (!shit && num[pos] < i) continue;
		int add = ((~(mask >> i)) & 1);
		if (cnt + add > K) continue;
		int n_mask = (mask | (1 << i));
		if (mask == 0 && i == 0) n_mask = 0;
		int n_shit = (shit || (i < num[pos]));
		ll tmp = (md[pos] * i) % mod * go1(pos - 1, n_mask, n_shit) % mod;

		ret = ((ret + tmp) % mod + go2(pos - 1, n_mask, n_shit)) % mod;
	}
	return cache = ret;
}

void init(ll x) {
	memset(dp1, -1, sizeof(dp1));
	memset(dp2, -1, sizeof(dp2));
	memset(num, 0, sizeof(num));
	X = x;
	int idx = 0;
	while (x) {
		num[idx] = x % 10;
		x /= 10;
		idx++;
	}
}

int main() {
	cin >> L >> R >> K;
	md[0] = 1;
	for (int i = 1; i < 20; i++) {
		md[i] = (md[i - 1] * 10) % mod;
	}
	init(L - 1);
	go1(17, 0, 0);
	ll lo = go2(17, 0, 0);

	init(R);
	go1(17, 0, 0);
	ll hi = go2(17, 0, 0);

	cout << hi - lo << endl;
	return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <functional>
#include <string>
using namespace std;
typedef long long ll;
const int inf = 0x3c3c3c3c;
const ll infl = 0x3c3c3c3c3c3c3c3c;
const ll mod = 998244353;

ll L, R, K;
ll dp1[18][1 << 10][2];
ll dp2[18][1 << 10][2];
ll X;
int num[20];
ll md[20];
ll go1(int pos, int mask, int shit) {
	if (pos == -1) return 1;
	ll& cache = dp1[pos][mask][shit];
	if (cache != -1) return cache;
	ll ret = 0;
	int cnt = 0;
	for (int i = 0; i < 10; i++) cnt += ((mask >> i) & 1);
	for (int i = 0; i < 10; i++) {
		if (!shit && num[pos] < i) continue;
		int add = ((~(mask >> i)) & 1);
		if (cnt + add > K) continue;
		int n_mask = (mask | (1 << i));
		if (mask == 0 && i == 0) n_mask = 0;
		ret += go1(pos - 1, n_mask, shit || (i < num[pos]));
	}
	return cache = ret;
}

ll go2(int pos, int mask, int shit) {
	if (pos == -1) return 0;
	ll& cache = dp2[pos][mask][shit];
	if (cache != -1) return cache;
	ll ret = 0;
	int cnt = 0;
	for (int i = 0; i < 10; i++) cnt += ((mask >> i) & 1);
	for (int i = 0; i < 10; i++) {
		if (!shit && num[pos] < i) continue;
		int add = ((~(mask >> i)) & 1);
		if (cnt + add > K) continue;
		int n_mask = (mask | (1 << i));
		if (mask == 0 && i == 0) n_mask = 0;
		int n_shit = (shit || (i < num[pos]));
		ll tmp = (md[pos] * i) % mod * go1(pos - 1, n_mask, n_shit) % mod;

		ret = ((ret + tmp) % mod + go2(pos - 1, n_mask, n_shit)) % mod;
	}
	return cache = ret;
}

void init(ll x) {
	memset(dp1, -1, sizeof(dp1));
	memset(dp2, -1, sizeof(dp2));
	memset(num, 0, sizeof(num));
	X = x;
	int idx = 0;
	while (x) {
		num[idx] = x % 10;
		x /= 10;
		idx++;
	}
}

int main() {
	cin >> L >> R >> K;
	md[0] = 1;
	for (int i = 1; i < 20; i++) {
		md[i] = (md[i - 1] * 10) % mod;
	}
	init(L - 1);
	go1(17, 0, 0);
	ll lo = go2(17, 0, 0);

	init(R);
	go1(17, 0, 0);
	ll hi = go2(17, 0, 0);

	cout << hi - lo << endl;
	return 0;
}


#define FRER() freopen("i.txt","r",stdin)
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=20+5,inf=0x3f3f3f3f,mod=998244353;
int l,r,k,bit[N],nb,vis[N][2][2],f[N][2][2][(1<<10)],g[N][2][2][(1<<10)],pw[N],ka;
void dfs(int u,int lim,int ze) {
    if(vis[u][lim][ze]==ka)return;
    vis[u][lim][ze]=ka;
    int* fu=f[u][lim][ze],*gu=g[u][lim][ze];
    for(int i=0; i<(1<<10); ++i)fu[i]=gu[i]=0;
    if(u==0) {fu[0]=1; return;}
    for(int i=0; i<=(lim?bit[u]:9); ++i) {
        int lim2=(lim&&i==bit[u]),ze2=(ze&&i==0);
        dfs(u-1,lim2,ze2);
        int* fv=f[u-1][lim2][ze2],*gv=g[u-1][lim2][ze2];
        for(int S=0; S<(1<<10); ++S) {
            int S2=ze&&i==0?S:S|(1<<i);
            fu[S2]+=fv[S];
            fu[S2]%=mod;
            gu[S2]+=gv[S]+(ll)fv[S]*i%mod*pw[u-1]%mod;
            gu[S2]%=mod;
        }
    }
}
int solve(int x) {
    ++ka;
    for(nb=0; x; x/=10)bit[++nb]=x%10;
    dfs(nb,1,1);
    int ret=0;
    for(int S=0; S<(1<<10); ++S)if(__builtin_popcount(S)<=k)ret=(ret+g[nb][1][1][S])%mod;
    return ret;
}
int main() {
    //FRER();
    pw[0]=1;
    for(int i=1; i<N; ++i)pw[i]=(ll)pw[i-1]*10%mod;
    scanf("%d%d%d",&l,&r,&k);
    printf("%d\n",solve(r)-solve(l-1));
    return 0;
}


#define FRER() freopen("i.txt","r",stdin)
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll N=20+5,inf=0x3f3f3f3f,mod=998244353;
ll l,r,k,bit[N],nb,vis[N][2][2],f[N][2][2][(1<<10)],g[N][2][2][(1<<10)],pw[N],ka;
void dfs(ll u,ll lim,ll ze) {
    if(vis[u][lim][ze]==ka)return;
    vis[u][lim][ze]=ka;
    ll* fu=f[u][lim][ze],*gu=g[u][lim][ze];
    for(ll i=0; i<(1<<10); ++i)fu[i]=gu[i]=0;
    if(u==0) {fu[0]=1; return;}
    for(ll i=0; i<=(lim?bit[u]:9); ++i) {
        ll lim2=(lim&&i==bit[u]),ze2=(ze&&i==0);
        dfs(u-1,lim2,ze2);
        ll* fv=f[u-1][lim2][ze2],*gv=g[u-1][lim2][ze2];
        for(ll S=0; S<(1<<10); ++S) {
            ll S2=ze&&i==0?S:S|(1<<i);
            fu[S2]=(fu[S2]+fv[S])%mod;
            gu[S2]=(gu[S2]+gv[S]+fv[S]*i%mod*pw[u-1]%mod)%mod;
        }
    }
}
ll solve(ll x) {
    ++ka;
    for(nb=0; x; x/=10)bit[++nb]=x%10;
    dfs(nb,1,1);
    ll ret=0;
    for(ll S=0; S<(1<<10); ++S)if(__builtin_popcount(S)<=k)ret=(ret+g[nb][1][1][S])%mod;
    return ret;
}
int main() {
    //FRER();
    pw[0]=1;
    for(ll i=1; i<N; ++i)pw[i]=(ll)pw[i-1]*10%mod;
    scanf("%lld%lld%lld",&l,&r,&k);
    printf("%lld\n",(solve(r)-solve(l-1)+mod)%mod);
    return 0;
}


#define FRER() freopen("i.txt","r",stdin)
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=20+5,inf=0x3f3f3f3f,mod=998244353;
int l,r,k,bit[N],nb,vis[N][2][2],f[N][2][2][(1<<10)],g[N][2][2][(1<<10)],pw[N],ka;
void dfs(int u,int lim,int ze) {
    if(vis[u][lim][ze]==ka)return;
    vis[u][lim][ze]=ka;
    int* fu=f[u][lim][ze],*gu=g[u][lim][ze];
    for(int i=0; i<(1<<10); ++i)fu[i]=gu[i]=0;
    if(u==0) {fu[0]=1; return;}
    for(int i=0; i<=(lim?bit[u]:9); ++i) {
        int lim2=(lim&&i==bit[u]),ze2=(ze&&i==0);
        dfs(u-1,lim2,ze2);
        int* fv=f[u-1][lim2][ze2],*gv=g[u-1][lim2][ze2];
        for(int S=0; S<(1<<10); ++S) {
            int S2=ze&&i==0?S:S|(1<<i);
            fu[S2]=(fu[S2]+fv[S])%mod;
            gu[S2]=((ll)gu[S2]+gv[S]+(ll)fv[S]*i%mod*pw[u-1]%mod)%mod;
        }
    }
}
int solve(int x) {
    ++ka;
    for(nb=0; x; x/=10)bit[++nb]=x%10;
    dfs(nb,1,1);
    int ret=0;
    for(int S=0; S<(1<<10); ++S)if(__builtin_popcount(S)<=k)ret=(ret+g[nb][1][1][S])%mod;
    return ret;
}
int main() {
    //FRER();
    pw[0]=1;
    for(int i=1; i<N; ++i)pw[i]=(ll)pw[i-1]*10%mod;
    scanf("%d%d%d",&l,&r,&k);
    printf("%d\n",solve(r)-solve(l-1));
    return 0;
}


#define FRER() freopen("i.txt","r",stdin)
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=20+5,inf=0x3f3f3f3f,mod=998244353;
ll l,r;
int k,bit[N],nb,vis[N][2][2],f[N][2][2][(1<<10)],g[N][2][2][(1<<10)],pw[N],ka;
void dfs(int u,int lim,int ze) {
    if(vis[u][lim][ze]==ka)return;
    vis[u][lim][ze]=ka;
    int* fu=f[u][lim][ze],*gu=g[u][lim][ze];
    for(int i=0; i<(1<<10); ++i)fu[i]=gu[i]=0;
    if(u==0) {fu[0]=1; return;}
    for(int i=0; i<=(lim?bit[u]:9); ++i) {
        int lim2=(lim&&i==bit[u]),ze2=(ze&&i==0);
        dfs(u-1,lim2,ze2);
        int* fv=f[u-1][lim2][ze2],*gv=g[u-1][lim2][ze2];
        for(int S=0; S<(1<<10); ++S) {
            int S2=ze&&i==0?S:S|(1<<i);
            fu[S2]=(fu[S2]+fv[S])%mod;
            gu[S2]=((ll)gu[S2]+gv[S]+(ll)fv[S]*i%mod*pw[u-1]%mod)%mod;
        }
    }
}
int solve(ll x) {
    ++ka;
    for(nb=0; x; x/=10)bit[++nb]=x%10;
    dfs(nb,1,1);
    int ret=0;
    for(int S=0; S<(1<<10); ++S)if(__builtin_popcount(S)<=k)ret=(ret+g[nb][1][1][S])%mod;
    return ret;
}
int main() {
    //FRER();
    pw[0]=1;
    for(int i=1; i<N; ++i)pw[i]=(ll)pw[i-1]*10%mod;
    scanf("%lld%lld%d",&l,&r,&k);
    printf("%d\n",(solve(r)-solve(l-1)+mod)%mod);
    return 0;
}


#define FRER() freopen("i.txt","r",stdin)
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=20+5,inf=0x3f3f3f3f,mod=998244353;
int l,r,k,bit[N],nb,vis[N][2][2],f[N][2][2][(1<<10)],g[N][2][2][(1<<10)],pw[N],ka;
void dfs(int u,int lim,int ze) {
    if(vis[u][lim][ze]==ka)return;
    vis[u][lim][ze]=ka;
    int* fu=f[u][lim][ze],*gu=g[u][lim][ze];
    for(int i=0; i<(1<<10); ++i)fu[i]=gu[i]=0;
    if(u==0) {fu[0]=1; return;}
    for(int i=0; i<=(lim?bit[u]:9); ++i) {
        int lim2=(lim&&i==bit[u]),ze2=(ze&&i==0);
        dfs(u-1,lim2,ze2);
        int* fv=f[u-1][lim2][ze2],*gv=g[u-1][lim2][ze2];
        for(int S=0; S<(1<<10); ++S) {
            int S2=ze&&i==0?S:S|(1<<i);
            fu[S2]+=fv[S];
            fu[S2]%=mod;
            gu[S2]+=gv[S];
            fu[S2]%=mod;
            gu[S2]+=(ll)fv[S]*i%mod*pw[u-1]%mod;
            gu[S2]%=mod;
        }
    }
}
int solve(int x) {
    ++ka;
    for(nb=0; x; x/=10)bit[++nb]=x%10;
    dfs(nb,1,1);
    int ret=0;
    for(int S=0; S<(1<<10); ++S)if(__builtin_popcount(S)<=k)ret=(ret+g[nb][1][1][S])%mod;
    return ret;
}
int main() {
    //FRER();
    pw[0]=1;
    for(int i=1; i<N; ++i)pw[i]=(ll)pw[i-1]*10%mod;
    scanf("%d%d%d",&l,&r,&k);
    printf("%d\n",solve(r)-solve(l-1));
    return 0;
}


#define FRER() freopen("i.txt","r",stdin)
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=20+5,inf=0x3f3f3f3f,mod=998244353;
ll l,r;
int k,bit[N],nb,vis[N][2][2],f[N][2][2][(1<<10)],g[N][2][2][(1<<10)],pw[N],ka;
void dfs(int u,int lim,int ze) {
    if(vis[u][lim][ze]==ka)return;
    vis[u][lim][ze]=ka;
    int* fu=f[u][lim][ze],*gu=g[u][lim][ze];
    for(int i=0; i<(1<<10); ++i)fu[i]=gu[i]=0;
    if(u==0) {fu[0]=1; return;}
    for(int i=0; i<=(lim?bit[u]:9); ++i) {
        int lim2=(lim&&i==bit[u]),ze2=(ze&&i==0);
        dfs(u-1,lim2,ze2);
        int* fv=f[u-1][lim2][ze2],*gv=g[u-1][lim2][ze2];
        for(int S=0; S<(1<<10); ++S) {
            int S2=ze&&i==0?S:S|(1<<i);
            fu[S2]=(fu[S2]+fv[S])%mod;
            gu[S2]=((ll)gu[S2]+gv[S]+(ll)fv[S]*i%mod*pw[u-1]%mod)%mod;
        }
    }
}
int solve(int x) {
    ++ka;
    for(nb=0; x; x/=10)bit[++nb]=x%10;
    dfs(nb,1,1);
    int ret=0;
    for(int S=0; S<(1<<10); ++S)if(__builtin_popcount(S)<=k)ret=(ret+g[nb][1][1][S])%mod;
    return ret;
}
int main() {
    //FRER();
    pw[0]=1;
    for(int i=1; i<N; ++i)pw[i]=(ll)pw[i-1]*10%mod;
    scanf("%lld%lld%d",&l,&r,&k);
    printf("%d\n",(solve(r)-solve(l-1)+mod)%mod);
    return 0;
}


#define FRER() freopen("i.txt","r",stdin)
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=20+5,inf=0x3f3f3f3f,mod=998244353;
int l,r,k,bit[N],nb,vis[N][2][2],f[N][2][2][(1<<10)],g[N][2][2][(1<<10)],pw[N],ka;
void dfs(int u,int lim,int ze) {
    if(vis[u][lim][ze]==ka)return;
    vis[u][lim][ze]=ka;
    int* fu=f[u][lim][ze],*gu=g[u][lim][ze];
    for(int i=0; i<(1<<10); ++i)fu[i]=gu[i]=0;
    if(u==0) {fu[0]=1; return;}
    for(int i=0; i<=(lim?bit[u]:9); ++i) {
        int lim2=(lim&&i==bit[u]),ze2=(ze&&i==0);
        dfs(u-1,lim2,ze2);
        int* fv=f[u-1][lim2][ze2],*gv=g[u-1][lim2][ze2];
        for(int S=0; S<(1<<10); ++S) {
            int S2=ze&&i==0?S:S|(1<<i);
            fu[S2]=(fu[S2]+fv[S])%mod;
            gu[S2]=((ll)gu[S2]+gv[S]+(ll)fv[S]*i%mod*pw[u-1]%mod)%mod;
        }
    }
}
int solve(int x) {
    ++ka;
    for(nb=0; x; x/=10)bit[++nb]=x%10;
    dfs(nb,1,1);
    int ret=0;
    for(int S=0; S<(1<<10); ++S)if(__builtin_popcount(S)<=k)ret=(ret+g[nb][1][1][S])%mod;
    return ret;
}
int main() {
    //FRER();
    pw[0]=1;
    for(int i=1; i<N; ++i)pw[i]=(ll)pw[i-1]*10%mod;
    scanf("%d%d%d",&l,&r,&k);
    printf("%d\n",(solve(r)-solve(l-1)+mod)%mod);
    return 0;
}


#include <bits/stdc++.h>
#define rep(i, a, b) for (int i = (a); i <= (b); ++i)
#define per(i, a, b) for (int i = (a); i >= (b); --i)
#define pb push_back
#define mp make_pair
#define x first
#define y second
using namespace std;

template<typename T>
void read(T& n){
	char ch; int sign = 1;
	while (!isdigit(ch = getchar())) if (ch == '-') sign = -1;
	n = ch - '0';
	while (isdigit(ch = getchar())) n = n * 10 + ch - '0';
	n *= sign;
}
typedef long long ll;
typedef pair<int, int> pii;
const int INF = 1e9 + 7;
const int MOD = 998244353;
const int N = 22;
ll l, r;
int k, n;
int a[N], f[N][1<<10][2][2], g[N][1<<10][2][2], d[1<<10], fac[N];

pii dfs(int x, int s, int lim, int lead){
	if (x > n) return mp(d[s] <= k, 0);
	if (f[x][s][lim][lead] != -1) return mp(f[x][s][lim][lead], g[x][s][lim][lead]);
	int &ans = f[x][s][lim][lead], &sum = g[x][s][lim][lead]; ans = sum = 0;
	if (lead){
		pii res = dfs(x + 1, s, lim & (a[x] == 0), 1);
		(ans += res.x) %= MOD, (sum += res.y) %= MOD;
	} else {
		pii res = dfs(x + 1, s | 1, lim & (a[x] == 0), 0);
		(ans += res.x) %= MOD, (sum += res.y) %= MOD;
	}
	rep(i, 1, lim ? a[x] : 9){
		pii res = dfs(x + 1, s | (1 << i), lim & (a[x] == i), 0);
		(ans += res.x) %= MOD;
		(sum += ((ll)fac[n-x] * i * res.x + res.y) % MOD) %= MOD;
	}
	return mp(ans, sum);
}
int solve(ll x){
	for (n = 0; x; x /= 10) a[++n] = x % 10;
	reverse(a + 1, a + n + 1);
	memset(f, -1, sizeof(f)), memset(g, 0, sizeof(g));
	return dfs(1, 0, 1, 1).y;
}

int main(){
	rep(i, 1, (1 << 10) - 1) d[i] = d[i>>1] + (i & 1);
	fac[0] = 1; rep(i, 1, N - 1) fac[i] = (ll)fac[i-1] * 10 % MOD;
	read(l), read(r), read(k);
	printf("%d\n", (solve(r) - solve(l - 1) + MOD) % MOD);
	return 0;
}


#include <bits/stdc++.h>
#define rep(i, a, b) for (int i = (a); i <= (b); ++i)
#define per(i, a, b) for (int i = (a); i >= (b); --i)
#define pb push_back
#define mp make_pair
#define x first
#define y second
using namespace std;

template<typename T>
void read(T& n){
	char ch; int sign = 1;
	while (!isdigit(ch = getchar())) if (ch == '-') sign = -1;
	n = ch - '0';
	while (isdigit(ch = getchar())) n = n * 10 + ch - '0';
	n *= sign;
}
typedef long long ll;
typedef pair<int, int> pii;
const int INF = 1e9 + 7;
const int MOD = 998244353;
const int N = 22;
ll l, r;
int k, n;
int a[N], f[N][1<<10], g[N][1<<10], d[1<<10], fac[N];

pii dfs(int x, int s, int lim, int lead){
	if (x > n) return mp(d[s] <= k, 0);
	if (f[x][s] != -1) return mp(f[x][s], g[x][s]);
	int &ans = f[x][s], &sum = g[x][s]; ans = sum = 0;
	if (lead){
		pii res = dfs(x + 1, s, lim & (a[x] == 0), 1);
		(ans += res.x) %= MOD, (sum += res.y) %= MOD;
	} else {
		pii res = dfs(x + 1, s | 1, lim & (a[x] == 0), 0);
		(ans += res.x) %= MOD, (sum += res.y) %= MOD;
	}
	rep(i, 1, lim ? a[x] : 9){
		pii res = dfs(x + 1, s | (1 << i), lim & (a[x] == i), 0);
		(ans += res.x) %= MOD;
		(sum += (ll)fac[n-x] * i * res.x % MOD + res.y) %= MOD;
	}
	return mp(ans, sum);
}
int solve(ll x){
	for (n = 0; x; x /= 10) a[++n] = x % 10;
	reverse(a + 1, a + n + 1);
	memset(f, -1, sizeof(f)), memset(g, 0, sizeof(g));
	return dfs(1, 0, 1, 1).y;
}

int main(){
	rep(i, 1, (1 << 10) - 1) d[i] = d[i>>1] + (i & 1);
	fac[0] = 1; rep(i, 1, N - 1) fac[i] = (ll)fac[i-1] * 10 % MOD;
	read(l), read(r), read(k);
	printf("%d\n", (solve(r) - solve(l - 1) + MOD) % MOD);
	return 0;
}


#include <bits/stdc++.h>
#define rep(i, a, b) for (int i = (a); i <= (b); ++i)
#define per(i, a, b) for (int i = (a); i >= (b); --i)
#define pb push_back
#define mp make_pair
#define x first
#define y second
using namespace std;

template<typename T>
void read(T& n){
	char ch; int sign = 1;
	while (!isdigit(ch = getchar())) if (ch == '-') sign = -1;
	n = ch - '0';
	while (isdigit(ch = getchar())) n = n * 10 + ch - '0';
	n *= sign;
}
typedef long long ll;
typedef pair<int, int> pii;
const int INF = 1e9 + 7;
const int MOD = 998244353;
const int N = 22;
ll l, r;
int k, n;
int a[N], f[N][1<<10][2], g[N][1<<10][2], d[1<<10], fac[N];

pii dfs(int x, int s, int lim, int lead){
	if (x > n) return mp(d[s] <= k, 0);
	if (f[x][s][lim] != -1) return mp(f[x][s][lim], g[x][s][lim]);
	int &ans = f[x][s][lim], &sum = g[x][s][lim]; ans = sum = 0;
	if (lead){
		pii res = dfs(x + 1, s, lim & (a[x] == 0), 1);
		(ans += res.x) %= MOD, (sum += res.y) %= MOD;
	} else {
		pii res = dfs(x + 1, s | 1, lim & (a[x] == 0), 0);
		(ans += res.x) %= MOD, (sum += res.y) %= MOD;
	}
	rep(i, 1, lim ? a[x] : 9){
		pii res = dfs(x + 1, s | (1 << i), lim & (a[x] == i), 0);
		(ans += res.x) %= MOD;
		(sum += ((ll)fac[n-x] * i * res.x + res.y) % MOD) %= MOD;
	}
	return mp(ans, sum);
}
int solve(ll x){
	for (n = 0; x; x /= 10) a[++n] = x % 10;
	reverse(a + 1, a + n + 1);
	memset(f, -1, sizeof(f)), memset(g, 0, sizeof(g));
	return dfs(1, 0, 1, 1).y;
}

int main(){
	rep(i, 1, (1 << 10) - 1) d[i] = d[i>>1] + (i & 1);
	fac[0] = 1; rep(i, 1, N - 1) fac[i] = (ll)fac[i-1] * 10 % MOD;
	read(l), read(r), read(k);
	printf("%d\n", (solve(r) - solve(l - 1) + MOD) % MOD);
	return 0;
}


#include <bits/stdc++.h>
#define rep(i, a, b) for (int i = (a); i <= (b); ++i)
#define per(i, a, b) for (int i = (a); i >= (b); --i)
#define pb push_back
#define mp make_pair
#define x first
#define y second
using namespace std;

template<typename T>
void read(T& n){
	char ch; int sign = 1;
	while (!isdigit(ch = getchar())) if (ch == '-') sign = -1;
	n = ch - '0';
	while (isdigit(ch = getchar())) n = n * 10 + ch - '0';
	n *= sign;
}
typedef long long ll;
typedef pair<int, int> pii;
const int INF = 1e9 + 7;
const int MOD = 998244353;
const int N = 22;
ll l, r;
int k, n;
int a[N], f[N][1<<10], g[N][1<<10], d[1<<10], fac[N];

pii dfs(int x, int s, int lim, int lead){
	if (x > n) return mp(d[s] <= k, 0);
	if (f[x][s] != -1) return mp(f[x][s], g[x][s]);
	int &ans = f[x][s], &sum = g[x][s]; ans = sum = 0;
	if (lead){
		pii res = dfs(x + 1, s, lim & (a[x] == 0), 1);
		(ans += res.x) %= MOD, (sum += res.y) %= MOD;
	} else {
		pii res = dfs(x + 1, s | 1, lim & (a[x] == 0), 0);
		(ans += res.x) %= MOD, (sum += res.y) %= MOD;
	}
	rep(i, 1, lim ? a[x] : 9){
		pii res = dfs(x + 1, s | (1 << i), lim & (a[x] == i), 0);
		(ans += res.x) %= MOD;
		(sum += ((ll)fac[n-x] * i * res.x % MOD + res.y) % MOD) %= MOD;
	}
	return mp(ans, sum);
}
int solve(ll x){
	for (n = 0; x; x /= 10) a[++n] = x % 10;
	reverse(a + 1, a + n + 1);
	memset(f, -1, sizeof(f)), memset(g, 0, sizeof(g));
	return dfs(1, 0, 1, 1).y;
}

int main(){
	rep(i, 1, (1 << 10) - 1) d[i] = d[i>>1] + (i & 1);
	fac[0] = 1; rep(i, 1, N - 1) fac[i] = (ll)fac[i-1] * 10 % MOD;
	read(l), read(r), read(k);
	printf("%d\n", (solve(r) - solve(l - 1) + MOD) % MOD);
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<int,int> pii;
ll dp[20][1<<10][2][11];
ll dp1[20][1<<10][2][11];
ll p[20];
ll mod=998244353;
vector<ll>v;
int k;
ll DP1(int i,int msk,int t,int cnt){
    if(i==v.size()){
        //cout<<val<<endl;
        return 1;
    }
    ll &ret=dp1[i][msk][t][cnt];
    if(ret!=-1)return ret;
    ret=0;
    int en=9;
    if(!t)en=v[i];
    for(int j=0;j<=en;j++){
        int c1=cnt;
        if(!(msk&(1<<j)))c1++;
        if(c1<=k){
            ret=(ret+DP1(i+1,msk|(1<<j),t|(j<en),c1))%mod;
        }

    }
    ///cout<<val<<' '<<i<<' '<<ret<<' '<<v[i]<<endl;
    return ret;
}
ll DP(int i,int msk,int t,int cnt){
    if(i==v.size()){
        //cout<<val<<endl;
        return 0;
    }
    ll &ret=dp[i][msk][t][cnt];
    //if(ret!=-1)return ret;
    ret=0;
    int en=9;
    if(!t)en=v[i];
    for(int j=0;j<=en;j++){
        int c1=cnt;
        if(!(msk&(1<<j)))c1++;
        if(c1<=k){
            ll cal=((j*p[v.size()-i-1])%mod*DP1(i+1,msk|(1<<j),t|(j<en),c1))%mod;
            ret=((ret+cal)+DP(i+1,msk|(1<<j),t|(j<en),c1))%mod;
        }

    }
    ///cout<<val<<' '<<i<<' '<<ret<<' '<<v[i]<<endl;
    return ret;
}
ll fun(ll n){
    v.clear();
    while(n){
        v.push_back(n%10);
        n/=10;
    }
    reverse(v.begin(),v.end());
    memset(dp,-1,sizeof  dp);
    memset(dp1,-1,sizeof  dp1);
    //cout<<DP1(0,0,0,0)<<endl;;
    return DP(0,0,0,0);
}
int main(){
    //cout<<pow(2,10)<<endl;
    p[0]=1;
    for(int i=1;i<20;i++)p[i]=(p[i-1]*10)%mod;
    ll l,r;
    cin>>l>>r>>k;
    //cout<<fun(r)<<endl;
    cout<<fun(r)-fun(l-1)<<endl;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<int,int> pii;
ll dp[20][1<<10][2][11];
ll dp1[20][1<<10][2][11];
ll p[20];
ll mod=998244353;
vector<ll>v;
int k;
ll DP1(int i,int msk,int t,int cnt){
    if(i==v.size()){
        //cout<<val<<endl;
        return 1;
    }
    ll &ret=dp1[i][msk][t][cnt];
    if(ret!=-1)return ret;
    ret=0;
    int en=9;
    if(!t)en=v[i];
    for(int j=0;j<=en;j++){
        int c1=cnt;
        if(!(msk&(1<<j)))c1++;
        if(c1<=k){
            ret=(ret+DP1(i+1,msk|(1<<j),t|(j<en),c1))%mod;
        }

    }
    ///cout<<val<<' '<<i<<' '<<ret<<' '<<v[i]<<endl;
    return ret;
}
ll DP(int i,int msk,int t,int cnt){
    if(i==v.size()){
        //cout<<val<<endl;
        return 0;
    }
    ll &ret=dp[i][msk][t][cnt];
    //if(ret!=-1)return ret;
    ret=0;
    int en=9;
    if(!t)en=v[i];
    for(int j=0;j<=en;j++){
        int c1=cnt;
        if(!(msk&(1<<j)))c1++;
        if(c1<=k){
            ll cal=((j*p[v.size()-i-1])%mod*DP1(i+1,msk|(1<<j),t|(j<en),c1))%mod;
            ret=((ret+cal)%mod+DP(i+1,msk|(1<<j),t|(j<en),c1))%mod;
        }

    }
    ///cout<<val<<' '<<i<<' '<<ret<<' '<<v[i]<<endl;
    return ret;
}
ll fun(ll n){
    v.clear();
    while(n){
        v.push_back(n%10);
        n/=10;
    }
    reverse(v.begin(),v.end());
    memset(dp,-1,sizeof  dp);
    memset(dp1,-1,sizeof  dp1);
    //cout<<DP1(0,0,0,0)<<endl;;
    return DP(0,0,0,0);
}
int main(){
    //cout<<mod*mod<<endl;
    //cout<<pow(2,10)<<endl;
    p[0]=1;
    for(int i=1;i<20;i++)p[i]=(p[i-1]*10)%mod;
    ll l,r;
    cin>>l>>r>>k;
    //cout<<l<<' '<<r<<' '<<k<<endl;
    //cout<<fun(r)<<endl;
    cout<<(mod+fun(r)-fun(l-1))%mod<<endl;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<int,int> pii;
ll dp[20][1<<10][2][11][2];
ll dp1[20][1<<10][2][11][2];
ll p[20];
ll mod=998244353;
vector<ll>v;
int k;
ll DP1(int i,int msk,int t,int cnt,int cp){
    if(i==v.size()){
        //cout<<val<<endl;
        if(msk==1)return 0;
        return 1;
    }
    ll &ret=dp1[i][msk][t][cnt][cp];
    if(ret!=-1)return ret;
    ret=0;
    int en=9;
    if(!t)en=v[i];
    for(int j=0;j<=en;j++){
        int c1=cnt;
        if(j==0 && cp==0){
            ret=(ret+DP1(i+1,msk,1,cnt,cp))%mod;
        }else{
            if(!(msk&(1<<j)))c1++;
            if(c1<=k){
                ret=(ret+DP1(i+1,msk|(1<<j),t|(j<en),c1,1))%mod;
            }
        }

    }
    ///cout<<val<<' '<<i<<' '<<ret<<' '<<v[i]<<endl;
    return ret;
}
ll DP(int i,int msk,int t,int cnt,int cp){
    if(i==v.size()){
        //cout<<val<<endl;
        return 0;
    }
    ll &ret=dp[i][msk][t][cnt][cp];
    //if(ret!=-1)return ret;
    ret=0;
    int en=9;
    if(!t)en=v[i];
    for(int j=0;j<=en;j++){
        if(j==0 && cp==0){
            ret=(ret+DP(i+1,msk,1,cnt,cp))%mod;
        }else{
            int c1=cnt;
            if(!(msk&(1<<j)))c1++;
            if(c1<=k){
                ll cal=((j*p[v.size()-i-1])%mod*DP1(i+1,msk|(1<<j),t|(j<en),c1,1))%mod;
                ret=((ret+cal)%mod+DP(i+1,msk|(1<<j),t|(j<en),c1,1))%mod;
            }
        }

    }
    ///cout<<val<<' '<<i<<' '<<ret<<' '<<v[i]<<endl;
    return ret;
}
ll fun(ll n){
    v.clear();
    while(n){
        v.push_back(n%10);
        n/=10;
    }
    reverse(v.begin(),v.end());
    memset(dp,-1,sizeof  dp);
    memset(dp1,-1,sizeof  dp1);
    //cout<<DP1(0,0,0,0)<<endl;;
    return DP(0,0,0,0,0);
}
int main(){
    //cout<<mod*mod<<endl;
    //cout<<pow(2,10)<<endl;
    p[0]=1;
    for(int i=1;i<20;i++)p[i]=(p[i-1]*10)%mod;
    ll l,r;
    cin>>l>>r>>k;
    //cout<<l<<' '<<r<<' '<<k<<endl;
    //cout<<fun(r)<<endl;
    cout<<(mod+fun(r)-fun(l-1))%mod<<endl;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<int,int> pii;
ll dp[20][1<<10][2][11][2];
ll dp1[20][1<<10][2][11][2];
ll p[20];
ll mod=998244353;
vector<ll>v;
int k;
ll DP1(int i,int msk,int t,int cnt,int cp){
    if(i==v.size()){
        //cout<<val<<endl;
        if(msk==1)return 0;
        return 1;
    }
    ll &ret=dp1[i][msk][t][cnt][cp];
    if(ret!=-1)return ret;
    ret=0;
    int en=9;
    if(!t)en=v[i];
    for(int j=0;j<=en;j++){
        int c1=cnt;
        if(j==0 && cp==0){
            ret=(ret+DP1(i+1,msk,1,cnt,cp))%mod;
        }else{
            if(!(msk&(1<<j)))c1++;
            if(c1<=k){
                ret=(ret+DP1(i+1,msk|(1<<j),t|(j<en),c1,1))%mod;
            }
        }

    }
    ///cout<<val<<' '<<i<<' '<<ret<<' '<<v[i]<<endl;
    return ret;
}
ll DP(int i,int msk,int t,int cnt,int cp){
    if(i==v.size()){
        //cout<<val<<endl;
        return 0;
    }
    ll &ret=dp[i][msk][t][cnt][cp];
    if(ret!=-1)return ret;
    ret=0;
    int en=9;
    if(!t)en=v[i];
    for(int j=0;j<=en;j++){
        if(j==0 && cp==0){
            ret=(ret+DP(i+1,msk,1,cnt,cp))%mod;
        }else{
            int c1=cnt;
            if(!(msk&(1<<j)))c1++;
            if(c1<=k){
                ll cal=((j*p[v.size()-i-1])%mod*DP1(i+1,msk|(1<<j),t|(j<en),c1,1))%mod;
                ret=((ret+cal)%mod+DP(i+1,msk|(1<<j),t|(j<en),c1,1))%mod;
            }
        }

    }
    ///cout<<val<<' '<<i<<' '<<ret<<' '<<v[i]<<endl;
    return ret;
}
ll fun(ll n){
    v.clear();
    while(n){
        v.push_back(n%10);
        n/=10;
    }
    reverse(v.begin(),v.end());
    memset(dp,-1,sizeof  dp);
    memset(dp1,-1,sizeof  dp1);
    //cout<<DP1(0,0,0,0)<<endl;;
    return DP(0,0,0,0,0);
}
int main(){
//    cout<<44*20*1024<<endl;
    //cout<<mod*mod<<endl;
    //cout<<pow(2,10)<<endl;
    p[0]=1;
    for(int i=1;i<20;i++)p[i]=(p[i-1]*10)%mod;
    ll l,r;
    cin>>l>>r>>k;
    //cout<<l<<' '<<r<<' '<<k<<endl;
    //cout<<fun(r)<<endl;
    cout<<(mod+fun(r)-fun(l-1))%mod<<endl;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<int,int> pii;
ll dp[20][1<<10][2][11];
ll dp1[20][1<<10][2][11];
ll p[20];
ll mod=998244353;
vector<ll>v;
int k;
ll DP1(int i,int msk,int t,int cnt){
    if(i==v.size()){
        //cout<<val<<endl;
        return 1;
    }
    ll &ret=dp1[i][msk][t][cnt];
    if(ret!=-1)return ret;
    ret=0;
    int en=9;
    if(!t)en=v[i];
    for(int j=0;j<=en;j++){
        int c1=cnt;
        if(!(msk&(1<<j)))c1++;
        if(c1<=k){
            ret=(ret+DP1(i+1,msk|(1<<j),t|(j<en),c1))%mod;
        }

    }
    ///cout<<val<<' '<<i<<' '<<ret<<' '<<v[i]<<endl;
    return ret;
}
ll DP(int i,int msk,int t,int cnt){
    if(i==v.size()){
        //cout<<val<<endl;
        return 0;
    }
    ll &ret=dp[i][msk][t][cnt];
    //if(ret!=-1)return ret;
    ret=0;
    int en=9;
    if(!t)en=v[i];
    for(int j=0;j<=en;j++){
        int c1=cnt;
        if(!(msk&(1<<j)))c1++;
        if(c1<=k){
            ll cal=((j*p[v.size()-i-1])%mod*DP1(i+1,msk|(1<<j),t|(j<en),c1))%mod;
            ret=((ret+cal)%mod+DP(i+1,msk|(1<<j),t|(j<en),c1))%mod;
        }

    }
    ///cout<<val<<' '<<i<<' '<<ret<<' '<<v[i]<<endl;
    return ret;
}
ll fun(ll n){
    v.clear();
    while(n){
        v.push_back(n%10);
        n/=10;
    }
    reverse(v.begin(),v.end());
    memset(dp,-1,sizeof  dp);
    memset(dp1,-1,sizeof  dp1);
    //cout<<DP1(0,0,0,0)<<endl;;
    return DP(0,0,0,0);
}
int main(){
    //cout<<mod*mod<<endl;
    //cout<<pow(2,10)<<endl;
    p[0]=1;
    for(int i=1;i<20;i++)p[i]=(p[i-1]*10)%mod;
    ll l,r;
    cin>>l>>r>>k;
    cout<<l<<' '<<r<<' '<<k<<endl;
    //cout<<fun(r)<<endl;
    cout<<(mod+fun(r)-fun(l-1))%mod<<endl;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<int,int> pii;
ll dp[20][1<<10][2][11][2];
ll dp1[20][1<<10][2][11][2];
ll p[20];
ll mod=998244353;
vector<ll>v;
int k;
ll DP1(int i,int msk,int t,int cnt,int cp){
    if(i==v.size()){
        //cout<<val<<endl;
        if(msk==1)return 0;
        return 1;
    }
    ll &ret=dp1[i][msk][t][cnt][cp];
    if(ret!=-1)return ret;
    ret=0;
    int en=9;
    if(!t)en=v[i];
    for(int j=0;j<=en;j++){
        int c1=cnt;
        if(j==0 && cp==0){
            ret=(ret+DP1(i+1,msk,1,cnt,cp))%mod;
        }else{
            if(!(msk&(1<<j)))c1++;
            if(c1<=k){
                ret=(ret+DP1(i+1,msk|(1<<j),t|(j<en),c1,1))%mod;
            }
        }

    }
    ///cout<<val<<' '<<i<<' '<<ret<<' '<<v[i]<<endl;
    return ret;
}
ll DP(int i,int msk,int t,int cnt,int cp){
    if(i==v.size()){
        //cout<<val<<endl;
        return 0;
    }
    ll &ret=dp[i][msk][t][cnt][cp];
    if(ret!=-1)return ret;
    ret=0;
    int en=9;
    if(!t)en=v[i];
    for(int j=0;j<=en;j++){
        if(j==0 && cp==0){
            ret=(ret+DP(i+1,msk,1,cnt,cp))%mod;
        }else{
            int c1=cnt;
            if(!(msk&(1<<j)))c1++;
            if(c1<=k){
                ll cal=((j*p[v.size()-i-1])%mod*DP1(i+1,msk|(1<<j),t|(j<en),c1,1))%mod;
                ret=((ret+cal)%mod+DP(i+1,msk|(1<<j),t|(j<en),c1,1))%mod;
            }
        }

    }
    ///cout<<val<<' '<<i<<' '<<ret<<' '<<v[i]<<endl;
    return ret;
}
ll fun(ll n){
    v.clear();
    while(n){
        v.push_back(n%10);
        n/=10;
    }
    reverse(v.begin(),v.end());
    memset(dp,-1,sizeof  dp);
    memset(dp1,-1,sizeof  dp1);
    //cout<<DP1(0,0,0,0)<<endl;;
    return DP(0,0,0,0,0);
}
int main(){
    cout<<44*20*1024<<endl;
    //cout<<mod*mod<<endl;
    //cout<<pow(2,10)<<endl;
    p[0]=1;
    for(int i=1;i<20;i++)p[i]=(p[i-1]*10)%mod;
    ll l,r;
    cin>>l>>r>>k;
    //cout<<l<<' '<<r<<' '<<k<<endl;
    //cout<<fun(r)<<endl;
    cout<<(mod+fun(r)-fun(l-1))%mod<<endl;
}


//Wrong answer on test inf.
#include<bits/stdc++.h>
#define rep(i,x,y) for (int i=(x);i<=(y);i++)
#define ll long long
#define y1 ___y1
#define pll pair<ll,ll>
#define fi first
#define se second
using namespace std;
char gc(){
	static char buf[100000],*p1=buf,*p2=buf;
	return p1==p2&&(p2=(p1=buf)+fread(buf,1,100000,stdin),p1==p2)?EOF:*p1++;
}
#define gc getchar
ll read(){
	char ch=gc();ll x=0;int op=1;
	for (;!isdigit(ch);ch=gc()) if (ch=='-') op=-1;
	for (;isdigit(ch);ch=gc()) x=(x<<1)+(x<<3)+ch-'0';
	return x*op;
}
const int N=25,M=1500,mod=998244353;
ll l,r,pw[N]; pll f[N][M]; bool vis[N][M]; int k,num[M],di[N];
pll dfs(int len,int pre,int sta){
	if (!len) return pll(num[sta]<=k,0);
	if (!pre&&vis[len][sta]) return f[len][sta];
	vis[len][sta]=1;
	int ed=pre?di[len]:9; pll ret(0,0);
	rep (i,0,ed){
		pll now=dfs(len-1,pre&&i==ed,sta|1<<i);
		ret.fi=(ret.fi+now.fi)%mod;
		ret.se=((ret.se+now.se)%mod+now.fi*i%mod*pw[len-1]%mod)%mod;
	}
	f[len][sta]=ret;
	return ret;
}
ll solve(ll x){
	int len=0;
	while (x) di[++len]=x%10,x/=10;
	return dfs(len,1,0).se;
}
int main(){
	rep (i,1,1023) num[i]=num[i-(i&-i)]+1;
	pw[0]=1; rep (i,1,18) pw[i]=pw[i-1]*10ll%mod;
	cin>>l>>r>>k;
	cout<<solve(r)-solve(l-1);
	return 0;
}


//Wrong answer on test inf.
#include<bits/stdc++.h>
#define rep(i,x,y) for (int i=(x);i<=(y);i++)
#define ll long long
#define y1 ___y1
#define pll pair<ll,ll>
#define fi first
#define se second
using namespace std;
char gc(){
	static char buf[100000],*p1=buf,*p2=buf;
	return p1==p2&&(p2=(p1=buf)+fread(buf,1,100000,stdin),p1==p2)?EOF:*p1++;
}
#define gc getchar
ll read(){
	char ch=gc();ll x=0;int op=1;
	for (;!isdigit(ch);ch=gc()) if (ch=='-') op=-1;
	for (;isdigit(ch);ch=gc()) x=(x<<1)+(x<<3)+ch-'0';
	return x*op;
}
const int N=25,M=1500,mod=998244353;
ll l,r,pw[N]; pll f[N][M]; bool vis[N][M]; int k,num[M],di[N];
pll dfs(int len,int pre,int zero,int sta){
	if (!len) return pll(num[sta]<=k,0);
	if (!pre&&vis[len][sta]) return f[len][sta];
	int ed=pre?di[len]:9; pll ret(0,0);
	rep (i,0,ed){
		pll now=dfs(len-1,pre&&i==ed,zero&&i==0,!(zero&&i==0)?sta|1<<i:sta);
		ret.fi=(ret.fi+now.fi)%mod;
		ret.se=((ret.se+now.se)%mod+now.fi*i%mod*pw[len-1]%mod)%mod;
	}
	if (!pre) vis[len][sta]=1,f[len][sta]=ret;
	return ret;
}
ll solve(ll x){
	int len=0;
	while (x) di[++len]=x%10,x/=10;
	return dfs(len,1,1,0).se;
}
int main(){
	rep (i,1,1023) num[i]=num[i-(i&-i)]+1;
	pw[0]=1; rep (i,1,18) pw[i]=pw[i-1]*10ll%mod;
	cin>>l>>r>>k;
	cout<<(solve(r)+mod-solve(l-1))%mod;
	return 0;
}


//Wrong answer on test inf.
#include<bits/stdc++.h>
#define rep(i,x,y) for (int i=(x);i<=(y);i++)
#define ll long long
#define y1 ___y1
#define pll pair<ll,ll>
#define fi first
#define se second
using namespace std;
char gc(){
	static char buf[100000],*p1=buf,*p2=buf;
	return p1==p2&&(p2=(p1=buf)+fread(buf,1,100000,stdin),p1==p2)?EOF:*p1++;
}
#define gc getchar
ll read(){
	char ch=gc();ll x=0;int op=1;
	for (;!isdigit(ch);ch=gc()) if (ch=='-') op=-1;
	for (;isdigit(ch);ch=gc()) x=(x<<1)+(x<<3)+ch-'0';
	return x*op;
}
const int N=25,M=1500,mod=998244353;
ll l,r,pw[N]; pll f[N][M]; bool vis[N][M]; int k,num[M],di[N];
pll dfs(int len,int pre,int sta){
	if (!len) return pll(num[sta]<=k,0);
	if (!pre&&vis[len][sta]) return f[len][sta];
	int ed=pre?di[len]:9; pll ret(0,0);
	rep (i,0,ed){
		pll now=dfs(len-1,pre&&i==ed,sta|1<<i);
		ret.fi=(ret.fi+now.fi)%mod;
		ret.se=((ret.se+now.se)%mod+now.fi*i%mod*pw[len-1]%mod)%mod;
	}
	if (!pre) vis[len][sta]=1,f[len][sta]=ret;
	return ret;
}
ll solve(ll x){
	int len=0;
	while (x) di[++len]=x%10,x/=10;
	return dfs(len,1,0).se;
}
int main(){
	rep (i,1,1023) num[i]=num[i-(i&-i)]+1;
	pw[0]=1; rep (i,1,18) pw[i]=pw[i-1]*10ll%mod;
	cin>>l>>r>>k;
	cout<<(solve(r)+mod-solve(l-1))%mod;
	return 0;
}


//Wrong answer on test inf.
#include<bits/stdc++.h>
#define rep(i,x,y) for (int i=(x);i<=(y);i++)
#define ll long long
#define y1 ___y1
#define pll pair<ll,ll>
#define fi first
#define se second
using namespace std;
char gc(){
	static char buf[100000],*p1=buf,*p2=buf;
	return p1==p2&&(p2=(p1=buf)+fread(buf,1,100000,stdin),p1==p2)?EOF:*p1++;
}
#define gc getchar
ll read(){
	char ch=gc();ll x=0;int op=1;
	for (;!isdigit(ch);ch=gc()) if (ch=='-') op=-1;
	for (;isdigit(ch);ch=gc()) x=(x<<1)+(x<<3)+ch-'0';
	return x*op;
}
const int N=25,M=1500,mod=998244353;
ll l,r,pw[N]; pll f[N][M]; bool vis[N][M]; int k,num[M],di[N];
pll dfs(int len,int pre,int sta){
	if (!len) return pll(num[sta]<=k,0);
	if (!pre&&vis[len][sta]) return f[len][sta];
	int ed=pre?di[len]:9; pll ret(0,0);
	rep (i,0,ed){
		pll now=dfs(len-1,pre&&i==ed,sta|1<<i);
		ret.fi=(ret.fi+now.fi)%mod;
		ret.se=((ret.se+now.se)%mod+now.fi*i%mod*pw[len-1]%mod)%mod;
	}
	if (!pre) vis[len][sta]=1,f[len][sta]=ret;
	return ret;
}
ll solve(ll x){
	int len=0;
	while (x) di[++len]=x%10,x/=10;
	return dfs(len,1,0).se;
}
int main(){
	rep (i,1,1023) num[i]=num[i-(i&-i)]+1;
	pw[0]=1; rep (i,1,18) pw[i]=pw[i-1]*10ll%mod;
	cin>>l>>r>>k;
	cout<<solve(r)-solve(l-1);
	return 0;
}


#include <iostream>
#include <vector>
#include <cstdio>
using namespace std;
int64_t MOD = 998244353;
int k;
struct Ret {
	int64_t numways;
	int64_t sum;
};
int getlen(int64_t v) {
	int len = 0;
	if (!v) return 1;
	while (v) {
		len += 1;
		v/=10;
	}
	return len;
}
int getdigit(int64_t v, int pos) {
	int len = getlen(v);
	int shift = len - 1 - pos;
	while (shift) {
		v/=10;
		shift--;
	}
	return v%10;
}
int64_t pow10(int len) {
	int64_t p = 1;
	while (len) {
		p *= 10;
		p %= MOD;
		len--;
	}
	return p;
}
Ret dfs(int bmask, int pos, bool prefix, int len, int64_t upper) {
	if (upper == 0) return {0, 0};
	int chosen = 0;
	for (int i = 0; i < 10; ++i) {
		if (bmask & (1<<i)) chosen++;
	}
	Ret ans = {0, 0};
	for (int i = 0; i < 10; ++i) {
		if (pos == 0 && i == 0) continue;
		int curdigit = getdigit(upper, pos);
		bool cur_is_prefix = prefix && (curdigit == i);
		if (bmask & (1<<i) || chosen < k) {
			//for (int j=0;j<pos;++j) printf(">>"); printf("%d\n", i);
			if (pos == len-1) {
				ans.numways += 1;
				ans.sum += i;
			} else {
				Ret res = dfs(bmask | (1 << i), pos+1, cur_is_prefix, len, upper);
				ans.numways += res.numways;
				ans.sum += (i * pow10(len-pos-1) * res.numways) % MOD + res.sum;
			}
		}
		ans.numways %= MOD;
		ans.sum %= MOD;
		if (cur_is_prefix) break;
	}
	return ans;
}

int64_t find(int64_t upper) {
	int len = getlen(upper);
	Ret ans = dfs(0, 0, 1, len, upper);
	if (len > 1) {
		int64_t res = find(pow10(len-1) - 1);
		ans.sum += res;
		ans.sum %= MOD;
	}
	return ans.sum;
}

int64_t norm(int64_t x) {
	x = x%MOD;
	if (x < 0) x += MOD;
	return x;
}

int main() {
	int64_t L, R;
	cin >> L >> R >> k;

	cout << norm(find(R) - find(L-1)) << endl;
	return 0;
}


#include <iostream>
#include <vector>
#include <cstdio>
using namespace std;
int64_t MOD = 998244353;
int k;
struct Ret {
	int64_t numways;
	int64_t sum;
};

int getlen(int64_t v) {
	int len = 0;
	if (!v) return 1;
	while (v) {
		len += 1;
		v/=10;
	}
	return len;
}
int getdigit(int64_t v, int pos) {
	int len = getlen(v);
	int shift = len - 1 - pos;
	while (shift) {
		v/=10;
		shift--;
	}
	return v%10;
}
int64_t pow10(int len) {
	int64_t p = 1;
	while (len) {
		p *= 10;
		len--;
	}
	return p;
}
Ret dfs(int bmask, int pos, bool prefix, int len, int64_t upper) {
	if (upper == 0) return {0, 0};
	int chosen = 0;
	for (int i = 0; i < 10; ++i) {
		if (bmask & (1<<i)) chosen++;
	}
	Ret ans = {0, 0};
	for (int i = 0; i < 10; ++i) {
		if (pos == 0 && i == 0) continue;
		int curdigit = getdigit(upper, pos);
		bool cur_is_prefix = prefix && (curdigit == i);
		if (bmask & (1<<i) || chosen < k) {
			//for (int j=0;j<pos;++j) printf(">>"); printf("%d\n", i);
			if (pos == len-1) {
				ans.numways += 1;
				ans.sum += i;
			} else {
				Ret res = dfs(bmask | (1 << i), pos+1, cur_is_prefix, len, upper);
				ans.numways += res.numways;
				ans.sum += (i * (pow10(len-pos-1) % MOD) * res.numways) % MOD + res.sum;
			}
		}
		ans.numways %= MOD;
		ans.sum %= MOD;
		if (cur_is_prefix) break;
	}
	return ans;
}

int64_t find(int64_t upper) {
	int len = getlen(upper);
	Ret ans = dfs(0, 0, 1, len, upper);
	if (len > 1) {
		int64_t res = find(pow10(len-1) - 1);
		ans.sum += res;
		ans.sum %= MOD;
	}
	return ans.sum;
}

int64_t norm(int64_t x) {
	x = x%MOD;
	if (x < 0) x += MOD;
	return x;
}

int main() {
	int64_t L, R;
	cin >> L >> R >> k;

	cout << norm(find(R) - find(L-1)) << endl;
	return 0;
}


#include <iostream>
#include <vector>
#include <cstdio>
using namespace std;
int64_t MOD = 998244353;
int k;
struct Ret {
	int64_t numways;
	int64_t sum;
};
Ret dp[1<<10][20][2];
int getlen(int64_t v) {
	int len = 0;
	if (!v) return 1;
	while (v) {
		len += 1;
		v/=10;
	}
	return len;
}
int getdigit(int64_t v, int pos) {
	int len = getlen(v);
	int shift = len - 1 - pos;
	while (shift) {
		v/=10;
		shift--;
	}
	return v%10;
}
int64_t pow10(int len) {
	int64_t p = 1;
	while (len) {
		p *= 10;
		len--;
	}
	return p;
}
Ret dfs(int bmask, int pos, bool prefix, int len, int64_t upper) {
	if (upper == 0) return {0, 0};
	if (dp[bmask][pos][prefix].sum >= 0) return dp[bmask][pos][prefix];
	int chosen = 0;
	for (int i = 0; i < 10; ++i) {
		if (bmask & (1<<i)) chosen++;
	}
	Ret ans = {0, 0};
	for (int i = 0; i < 10; ++i) {
		if (pos == 0 && i == 0) continue;
		int curdigit = getdigit(upper, pos);
		bool cur_is_prefix = prefix && (curdigit == i);
		if (bmask & (1<<i) || chosen < k) {
			//for (int j=0;j<pos;++j) printf(">>"); printf("%d\n", i);
			if (pos == len-1) {
				ans.numways += 1;
				ans.sum += i;
			} else {
				Ret res = dfs(bmask | (1 << i), pos+1, cur_is_prefix, len, upper);
				ans.numways += res.numways;
				ans.sum += (i * (pow10(len-pos-1) % MOD) * res.numways) % MOD + res.sum;
			}
		}
		ans.numways %= MOD;
		ans.sum %= MOD;
		if (cur_is_prefix) break;
	}
	dp[bmask][pos][prefix] = ans;
	return ans;
}

int64_t find(int64_t upper) {
	int len = getlen(upper);
	for (int i = 0; i < (1<<10); ++i) {
		for (int j = 0; j < 20; ++j) {
			for (int k = 0; k < 2; ++k) {
				dp[i][j][k].sum = -1;
			}
		}
	}
	Ret ans = dfs(0, 0, 1, len, upper);
	if (len > 1) {
		int64_t res = find(pow10(len-1) - 1);
		ans.sum += res;
		ans.sum %= MOD;
	}
	return ans.sum;
}

int64_t norm(int64_t x) {
	x = x%MOD;
	if (x < 0) x += MOD;
	return x;
}

int main() {
	int64_t L, R;
	cin >> L >> R >> k;

	cout << norm(find(R) - find(L-1)) << endl;
	return 0;
}


#include <iostream>
#include <vector>
#include <cstdio>
using namespace std;
int k;
struct Ret {
	int64_t numways;
	int64_t sum;
};
int getlen(int64_t v) {
	int len = 0;
	if (!v) return 1;
	while (v) {
		len += 1;
		v/=10;
	}
	return len;
}
int getdigit(int64_t v, int pos) {
	int len = getlen(v);
	int shift = len - 1 - pos;
	while (shift) {
		v/=10;
		shift--;
	}
	return v%10;
}
int64_t pow10(int len) {
	int64_t p = 1;
	while (len) {
		p *= 10;
		len--;
	}
	return p;
}
Ret dfs(int bmask, int pos, bool prefix, int len, int64_t upper) {
	if (upper == 0) return {0, 0};
	int chosen = 0;
	for (int i = 0; i < 10; ++i) {
		if (bmask & (1<<i)) chosen++;
	}
	Ret ans = {0, 0};
	for (int i = 0; i < 10; ++i) {
		if (pos == 0 && i == 0) continue;
		int curdigit = getdigit(upper, pos);
		bool cur_is_prefix = prefix && (curdigit == i);
		if (bmask & (1<<i) || chosen < k) {
			//for (int j=0;j<pos;++j) printf(">>"); printf("%d\n", i);
			if (pos == len-1) {
				ans.numways += 1;
				ans.sum += i;
			} else {
				Ret res = dfs(bmask | (1 << i), pos+1, cur_is_prefix, len, upper);
				ans.numways += res.numways;
				ans.sum += i * pow10(len-pos-1) * res.numways + res.sum;
			}
		}
		if (cur_is_prefix) break;
	}
	return ans;
}

int64_t find(int64_t upper) {
	int len = getlen(upper);
	Ret ans = dfs(0, 0, 1, len, upper);
	if (len > 1) {
		int64_t res = find(pow10(len-1) - 1);
		ans.sum += res;
	}
	return ans.sum;
}

int main() {
	int64_t L, R;
	cin >> L >> R >> k;
	cout << (find(R) - find(L-1)) << endl;
	return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#define mod 998244353

using namespace std;
typedef long long ll;
const int MAXN = 1050;
ll f[20][10][MAXN],g[20][10][MAXN],l,r,k;
inline int count(int x)
{
	int res = 0;
	for(; x; x -= x&-x)
	    res++;
	return res;
}
inline ll qpow(ll a, int b)
{
	ll res = 1;
	for(; b; a = a*a%mod, b >>= 1)
	    if(b&1)
	        res = res*a%mod;
	return res;
}
inline ll calc(ll x)
{
	//cout << "calc " << x << endl;
	int dig[20],tot = 0;
	if(x==0)
	    return 0;
	while(x)
	    dig[++tot] = x%10, x /= 10;
	ll sum = 0, res = 0;
    int tst = 0;
	for(int i = tot; i>=1; i--)
	{
	    ll tmp1 = 0, tmp2 = 0;
	    if(dig[i])
			for(int h = 1; h<i; h++)
		    	for(int j = 0; j<=9; j++)
		        	for(int st = 0; st<(1<<10); st++)
		            	if((st&(1<<j))&&count(st|tst|(i!=tot))<=k)
		            	{
		                	tmp1 = (tmp1+f[h][j][st])%mod;
		                	tmp2 = (tmp2+g[h][j][st])%mod;
	//	                	cout << "f " << i << " " << h << " " << j << " " << st << " " << g[h][j][st] << " " << f[h][j][st] << endl;
		            	}
		for(int j = 0; j<dig[i]+(i==1); j++)
		    for(int st = 0; st<(1<<10); st++)
		        if((st&(1<<j))&&count(st|tst)<=k)
		        {
		            tmp1 = (tmp1+f[i][j][st])%mod;
		            tmp2 = (tmp2+g[i][j][st])%mod;
	//	            cout << "f " << i << " " << j << " " << st << " " << g[i][j][st] << " " << f[i][j][st] << endl;
				}
	//	cout << "tmp2 " << i << " " << tmp1 << " " << tmp2 << endl;
	    res = (res+sum*tmp2%mod+tmp1)%mod;
	//    cout << "test " << i << " " << res << endl;
	    sum = (sum+dig[i]*qpow(10,i-1)%mod)%mod;
	    tst |= 1<<dig[i];
	}
	return res;
}

int main()
{
    cin >> l >> r >> k;
    for(int i = 0; i<=9; i++)
    {
        f[1][i][1<<i] = i;
        g[1][i][1<<i] = 1;
    }
	for(int i = 1; i<18; i++)
	    for(int st = 0; st<(1<<10); st++)
		    for(int j = 1; j<=9; j++)
			    if(st&(1<<j))
				    for(int k = 0; k<=9; k++)
				        g[i+1][j][st|(1<<k)] = (g[i+1][j][st|(1<<k)]+g[i][j][st])%mod;
	for(int i = 1; i<18; i++)
	    for(int st = 0; st<(1<<10); st++)
	        for(int j = 1; j<=9; j++)
	            if(st&(1<<j))
	                for(int k = 0; k<=9; k++)
	                    f[i+1][j][st|(1<<k)] = (f[i+1][j][st|(1<<k)]+g[i][j][st]*k%mod+f[i][j][st]*10)%mod;
    cout << (calc(r)-calc(l-1)+mod)%mod << endl;
	return 0;
}
/*
1 100000000000000000 1
*/


#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#define mod 998244353

using namespace std;
typedef long long ll;
const int MAXN = 1050;
ll f[20][10][MAXN],g[20][10][MAXN],l,r,k;
inline int count(int x)
{
	int res = 0;
	for(; x; x -= x&-x)
	    res++;
	return res;
}
inline ll qpow(ll a, int b)
{
	ll res = 1;
	for(; b; a = a*a%mod, b >>= 1)
	    if(b&1)
	        res = res*a%mod;
	return res;
}
inline ll calc(ll x)
{
//	cout << "calc " << x << endl;
	int dig[20],tot = 0;
	if(x==0)
	    return 0;
	while(x)
	    dig[++tot] = x%10, x /= 10;
	ll sum = 0, res = 0;
    int tst = 0;
	for(int i = tot; i>=1; i--)
	{
	    ll tmp1 = 0, tmp2 = 0;
		for(int h = 1; h<i; h++)
		    for(int j = 0; j<=9; j++)
		        for(int st = 0; st<(1<<10); st++)
		            if((st&(1<<j))&&count(st|tst|(i!=tot))<=k)
		            {
		                tmp1 = (tmp1+f[h][j][st])%mod;
		                tmp2 = (tmp2+g[h][j][st])%mod;
		               // cout << "f " << i << " " << h << " " << j << " " << st << " " << g[h][j][st] << " " << f[h][j][st] << endl;
		            }
		for(int j = 0; j<dig[i]+(i==1); j++)
		    for(int st = 0; st<(1<<10); st++)
		        if((st&(1<<j))&&count(st|tst)<=k)
		        {
		            tmp1 = (tmp1+f[i][j][st])%mod;
		            tmp2 = (tmp2+g[i][j][st])%mod;
		          //  cout << "f " << i << " " << j << " " << st << " " << g[i][j][st] << " " << f[i][j][st] << endl;
				}
	//	cout << "tmp2 " << i << " " << tmp2 << endl;
	    res = (res+sum*tmp2%mod+tmp1)%mod;
	//    cout << "test " << i << " " << res << endl;
	    sum = (sum+dig[i]*qpow(10,i-1)%mod)%mod;
	    tst |= 1<<dig[i];
	}
	return res;
}

int main()
{
    cin >> l >> r >> k;
    for(int i = 0; i<=9; i++)
    {
        f[1][i][1<<i] = i;
        g[1][i][1<<i] = 1;
    }
	for(int i = 1; i<18; i++)
	    for(int st = 0; st<(1<<10); st++)
		    for(int j = 1; j<=9; j++)
			    if(st&(1<<j))
				    for(int k = 0; k<=9; k++)
				        g[i+1][j][st|(1<<k)] = (g[i+1][j][st|(1<<k)]+g[i][j][st])%mod;
	for(int i = 1; i<18; i++)
	    for(int st = 0; st<(1<<10); st++)
	        for(int j = 1; j<=9; j++)
	            if(st&(1<<j))
	                for(int k = 0; k<=9; k++)
	                    f[i+1][j][st|(1<<k)] = (f[i+1][j][st|(1<<k)]+g[i][j][st]*k%mod+f[i][j][st]*10)%mod;
    cout << (calc(r)-calc(l-1)+mod)%mod << endl;
	return 0;
}
/*
1 999999999999999999 1
*/


#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#define mod 998244353

using namespace std;
typedef long long ll;
const int MAXN = 1050;
ll f[20][10][MAXN],g[20][10][MAXN],l,r,k;
inline int count(int x)
{
	int res = 0;
	for(; x; x -= x&-x)
	    res++;
	return res;
}
inline ll qpow(ll a, int b)
{
	ll res = 1;
	for(; b; a = a*a%mod, b >>= 1)
	    if(b&1)
	        res = res*a%mod;
	return res;
}
inline int calc(int x)
{
//	cout << "calc " << x << endl;
	int dig[20],tot = 0;
	if(x==0)
	    return 0;
	while(x)
	    dig[++tot] = x%10, x /= 10;
	ll sum = 0, res = 0;
//	for(int i = 1; i<tot; i++)
	//    for(int j = i==1; j<=9; j++)
	 //       for(int st = 0; st<(1<<10); st++)
	 //           if((st&(1<<j))&&count(st)<=k)
	  //              res = (res+f[i][j][st])%mod;
//	cout << "test1 " << res << endl;
    int tst = 0;
	for(int i = tot; i>=1; i--)
	{
	    ll tmp1 = 0, tmp2 = 0;
        for(int j = 0; j<dig[i]+(i==1); j++)
        {
            for(int st = 0; st<(1<<10); st++)
                if((st&(1<<j))&&count(st|tst)<=k)
                {
                    tmp1 = (tmp1+f[i][j][st])%mod;
				    tmp2 = (tmp2+g[i][j][st])%mod;
				    //cout << "f " << i << " " << j << " " << st << " " << g[i][j][st] << endl;
				}
		}
	//	cout << "tmp2 " << i << " " << tmp2 << endl;
	    res = (res+sum*tmp2%mod+tmp1)%mod;
	//    cout << "test " << i << " " << res << endl;
	    sum = (sum+dig[i]*qpow(10,i-1)%mod)%mod;
	    tst |= 1<<dig[i];
	}
	return res;
}

int main()
{
    cin >> l >> r >> k;
    for(int i = 0; i<=9; i++)
    {
        f[1][i][1<<i] = i;
        g[1][i][1<<i] = 1;
    }
	for(int i = 1; i<18; i++)
	    for(int st = 0; st<(1<<10); st++)
		    for(int j = 0; j<=9; j++)
			    if(st&(1<<j))
				    for(int k = 0; k<=9; k++)
				        g[i+1][j][st|(1<<k)] = (g[i+1][j][st|(1<<k)]+g[i][j][st])%mod;
	for(int i = 1; i<18; i++)
	    for(int st = 0; st<(1<<10); st++)
	        for(int j = 0; j<=9; j++)
	            if(st&(1<<j))
	                for(int k = 0; k<=9; k++)
	                    f[i+1][j][st|(1<<k)] = (f[i+1][j][st|(1<<k)]+g[i][j][st]*k%mod+f[i][j][st]*10)%mod;
	int res = 0;
	for(int st = 0; st<(1<<10); st++)
	    if(count(st)<=k)
	        res += g[3][1][st];
	//cout << "res " << res << endl;
//	for(int i = 1; i<=9; i++)
	    //for(int st = 0; st<(1<<10); st++)
		 //   if(st&(1<<i))
	       //     cout << 2 << " " << i << " " << st << " " << g[2][i][st] << " " << f[2][i][st] << endl;
    cout << (calc(r)-calc(l-1)+mod)%mod << endl;
	return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#define mod 998244353

using namespace std;
typedef long long ll;
const int MAXN = 1050;
ll f[20][10][MAXN],g[20][10][MAXN],l,r,k;
inline int count(int x)
{
	int res = 0;
	for(; x; x -= x&-x)
	    res++;
	return res;
}
inline ll qpow(ll a, int b)
{
	ll res = 1;
	for(; b; a = a*a%mod, b >>= 1)
	    if(b&1)
	        res = res*a%mod;
	return res;
}
inline ll calc(ll x)
{
//	cout << "calc " << x << endl;
	int dig[20],tot = 0;
	if(x==0)
	    return 0;
	while(x)
	    dig[++tot] = x%10, x /= 10;
	ll sum = 0, res = 0;
//	for(int i = 1; i<tot; i++)
	//    for(int j = i==1; j<=9; j++)
	 //       for(int st = 0; st<(1<<10); st++)
	 //           if((st&(1<<j))&&count(st)<=k)
	  //              res = (res+f[i][j][st])%mod;
//	cout << "test1 " << res << endl;
    int tst = 0;
	for(int i = tot; i>=1; i--)
	{
	    ll tmp1 = 0, tmp2 = 0;
        for(int j = 0; j<dig[i]+(i==1); j++)
        {
            for(int st = 0; st<(1<<10); st++)
                if((st&(1<<j))&&count(st|tst)<=k)
                {
                    tmp1 = (tmp1+f[i][j][st])%mod;
				    tmp2 = (tmp2+g[i][j][st])%mod;
				    //cout << "f " << i << " " << j << " " << st << " " << g[i][j][st] << endl;
				}
		}
	//	cout << "tmp2 " << i << " " << tmp2 << endl;
	    res = (res+sum*tmp2%mod+tmp1)%mod;
	//    cout << "test " << i << " " << res << endl;
	    sum = (sum+dig[i]*qpow(10,i-1)%mod)%mod;
	    tst |= 1<<dig[i];
	}
	return res;
}

int main()
{
    cin >> l >> r >> k;
    for(int i = 0; i<=9; i++)
    {
        f[1][i][1<<i] = i;
        g[1][i][1<<i] = 1;
    }
	for(int i = 1; i<18; i++)
	    for(int st = 0; st<(1<<10); st++)
		    for(int j = 0; j<=9; j++)
			    if(st&(1<<j))
				    for(int k = 0; k<=9; k++)
				        g[i+1][j][st|(1<<k)] = (g[i+1][j][st|(1<<k)]+g[i][j][st])%mod;
	for(int i = 1; i<18; i++)
	    for(int st = 0; st<(1<<10); st++)
	        for(int j = 0; j<=9; j++)
	            if(st&(1<<j))
	                for(int k = 0; k<=9; k++)
	                    f[i+1][j][st|(1<<k)] = (f[i+1][j][st|(1<<k)]+g[i][j][st]*k%mod+f[i][j][st]*10)%mod;
    cout << (calc(r)-calc(l-1)+mod)%mod << endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int>vi;
typedef pair<ll,ll>pii;
#define sz(a) ((int)(a).size())
#define rep(i,a,b) for(int i=(a);i<(b);++i)
#define per(i,a,b)  for(int i=(a);i>(b);--i)
#define de(a) cout << #a << " = " << a << endl;
#define dd(a) cout << #a << " = " << a << "  ";
#define file freopen("in.txt","r",stdin)
#define mem(a,b) memset(a,b,sizeof(a))
#define fi first
#define se second
/*********************************************/
const int N=2e5+5;
const ll mod=998244353;
int k;
ll bit[30],ten[100];
pii dp[20][15][1025];
void init(){
    ten[0]=1;
    for(int i=1;i<=22;i++)
		ten[i] = ten[i-1]*10%mod;
}
pii solve(int num,int pos,bool up,ll sum,bool zero){
   // de(pos);
    pii tmp;
	tmp.fi=tmp.se=0;
	if(num>k)
	{
		tmp.fi = tmp.se = 0;
		return tmp;
	}
	if(pos==0)
	{
		tmp.fi = 0, tmp.se = 1;
		return tmp;
	}
	if(!up&& !zero && dp[pos][num][sum].se!=-1)
		return dp[pos][num][sum];
    int ma=9;
    ll ans=0;
    if(up)ma=bit[pos];
    ll cnt=0;
    for(ll i=0;i<=ma;++i){
        if(sum&(1<<i)){
        	 pii p=solve(num,pos-1,up&&i==ma,sum,i==0&&zero);
            cnt+=p.se;
            ans=((ans+p.fi+i*ten[pos-1]%mod*p.se)%mod+mod)%mod;
		}
        else{
           /* int m=num+1;
            ll res=0;
            if(i==0&&zero)m--;
            else res=(1<<i);
            pii p=solve(m,pos-1,up&&i==ma,sum+res,i==0&&zero);
           // cout<<m<<" "<<p.fi<<" "<<p.se<<endl;
            cnt+=p.se;
            ans=((ans+p.fi+i*ten[pos-1]%mod*p.se)%mod+mod)%mod;*/
            if(zero && i==0)
			{
				pii p = solve(num, pos-1, up&&i==ma,sum, 1);
				cnt += p.se;
				ans = (ans+p.fi)%mod;
			}
			else
			{
				pii p = solve(num+1, pos-1, up&&i==ma,sum+(1<<i), 0);
				cnt += p.se;
				ans=((ans+p.fi+i*ten[pos-1]%mod*p.se)%mod+mod)%mod;
			}
        }
    //    dd(i);
      //  dd(pos);
       // dd(num);
        //de(ans);
    }

    tmp.fi=ans;
    tmp.se=cnt;
   	if(!up&&!zero)
		dp[pos][num][sum] = tmp;
    return tmp;
}
ll calc(ll x){
    int len=0;
    while(x>0){
        bit[++len]=x%10;
        x/=10;

    }
    int vis[10];

    for(int i=0;i<=9;++i)
        vis[i]=0;
    return solve(0,len,1,0,1).fi;
}
int main()
{
    ll l,r;
    cin>>l>>r>>k;
    init();
    /*for(int i=0;i<=10;++i){
        for(int j=0;j<10;++j){
            cout<<mp[j][i]<<" ";
        }
        cout<<endl;
    }*/
    memset(dp,-1,sizeof(dp));
    ll ans=((calc(r)-calc(l-1))%mod+mod)%mod;
    cout<<ans<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;typedef long long ll;
typedef vector<int>vi;typedef pair<ll,ll>pii;
#define sz(a) ((int)(a).size())
#define rep(i,a,b) for(int i=(a);i<(b);++i)
#define per(i,a,b)  for(int i=(a);i>(b);--i)
#define de(a) cout << #a << " = " << a << endl;
#define dd(a) cout << #a << " = " << a << "  ";
#define file freopen("in.txt","r",stdin)
#define mem(a,b) memset(a,b,sizeof(a))
#define fi first
#define se second
/*********************************************/
const int N=2e5+5;
const ll mod=998244353;
int k;
ll bit[30],ten[100],dp[100][100];
void init(){
    ll tmp=1;
    ten[0]=1;
    for(int i=1;i<=30;++i){
        tmp=tmp*10%mod;
        ten[i]=tmp;
    }
}
pii solve(int num,int pos,bool up,int *vis,bool zero){
   // de(pos);
    pii tmp(0,0);

    if(num>k){
        return tmp;
    }
    if(pos==0){
        tmp.se=1;
        return tmp;
    }
    int ma=9;
    ll ans=0;
    if(up)ma=bit[pos];
    bool f=false;
    ll cnt=0;
    for(ll i=0;i<=ma;++i){
        if(!vis[i]){
            int tmp[10];
            rep(j,0,10)
                tmp[j]=vis[j];
            tmp[i]=1;
            int m=num+1;
            if(i==0&&zero)m--;
            pii p=solve(m,pos-1,up&&i==ma,tmp,i==0&&zero);
           // cout<<m<<" "<<p.fi<<" "<<p.se<<endl;
            cnt+=p.se;
            ans=((ans+p.fi+i*ten[pos-1]%mod*p.se)%mod+mod)%mod;
        }
        else{
            pii p=solve(num,pos-1,up&&i==ma,vis,i==0&&zero);
            cnt+=p.se;
            ans=((ans+p.fi+i*ten[pos-1]%mod*p.se)%mod+mod)%mod;
        }
    //    dd(i);
      //  dd(pos);
       // dd(num);
        //de(ans);
    }

    tmp.fi=ans;
    tmp.se=cnt;
    return tmp;
}
ll calc(ll x){
    int len=0;
    while(x>0){
        bit[++len]=x%10;
        x/=10;

    }
    int vis[10];

    for(int i=0;i<=9;++i)
        vis[i]=0;
    return solve(0,len,1,vis,1).fi;
}
int main()
{
    ll l,r;
    cin>>l>>r>>k;
    init();
    /*for(int i=0;i<=10;++i){
        for(int j=0;j<10;++j){
            cout<<mp[j][i]<<" ";
        }
        cout<<endl;
    }*/
    memset(dp,-1,sizeof(dp));
    ll ans=((calc(r)-calc(l-1))%mod+mod)%mod;
    cout<<ans<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int>vi;
typedef pair<ll,ll>pii;
#define sz(a) ((int)(a).size())
#define rep(i,a,b) for(int i=(a);i<(b);++i)
#define per(i,a,b)  for(int i=(a);i>(b);--i)
#define de(a) cout << #a << " = " << a << endl;
#define dd(a) cout << #a << " = " << a << "  ";
#define file freopen("in.txt","r",stdin)
#define mem(a,b) memset(a,b,sizeof(a))
#define fi first
#define se second
/*********************************************/
const int N=2e5+5;
const ll mod=998244353;
int k;
ll bit[30],ten[100];
pii dp[20][15][1025];
void init(){
    ten[0]=1;
    for(int i=1;i<=22;i++)
		ten[i] = ten[i-1]*10%mod;
}
pii solve(int num,int pos,bool up,ll sum,bool zero){
   // de(pos);
    pii tmp;
	tmp.fi=tmp.se=0;
	if(num>k)
	{
		tmp.fi = tmp.se = 0;
		return tmp;
	}
	if(pos==0)
	{
		tmp.fi = 0, tmp.se = 1;
		return tmp;
	}
	if(!up&& !zero && dp[pos][num][sum].fi!=-1)
		return dp[pos][num][sum];
    int ma=9;
    ll ans=0;
    if(up)ma=bit[pos];
    ll cnt=0;
    for(ll i=0;i<=ma;++i){
        if(sum&(1<<i)){
        	 pii p=solve(num,pos-1,up&&i==ma,sum,i==0&&zero);
            cnt+=p.se;
           ans=((ans+p.fi+p.se%mod*i%mod*ten[pos-1]%mod)%mod+mod)%mod;
		}
        else{
           /* int m=num+1;
            ll res=0;
            if(i==0&&zero)m--;
            else res=(1<<i);
            pii p=solve(m,pos-1,up&&i==ma,sum+res,i==0&&zero);
           // cout<<m<<" "<<p.fi<<" "<<p.se<<endl;
            cnt+=p.se;
            ans=((ans+p.fi+i*ten[pos-1]%mod*p.se)%mod+mod)%mod;*/
            if(zero && i==0)
			{
				pii p = solve(num, pos-1, up&&i==ma,sum, 1);
				cnt += p.se;
				ans = (ans+p.fi)%mod;
			}
			else
			{

				pii p = solve(num+1, pos-1, up&&i==ma,sum+(1<<i), 0);
				cnt += p.se;
				ans=((ans+p.fi+p.se%mod*i%mod*ten[pos-1]%mod)%mod+mod)%mod;
			}
        }
    //    dd(i);
      //  dd(pos);
       // dd(num);
        //de(ans);
    }

    tmp.fi=ans;
    tmp.se=cnt;
   	if(!up&&!zero)
		dp[pos][num][sum] = tmp;
    return tmp;
}
ll calc(ll x){
    int len=0;
    while(x>0){
        bit[++len]=x%10;
        x/=10;

    }
    return solve(0,len,1,0,1).fi;
}
int main()
{
    ll l,r;
    cin>>l>>r>>k;
    init();
    /*for(int i=0;i<=10;++i){
        for(int j=0;j<10;++j){
            cout<<mp[j][i]<<" ";
        }
        cout<<endl;
    }*/
    memset(dp,-1,sizeof(dp));
   // de(calc(r));
   // de(calc(l-1));
    ll ans=((calc(r)-calc(l-1))%mod+mod)%mod;
    cout<<ans<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int>vi;
typedef pair<ll,ll>pii;
#define sz(a) ((int)(a).size())
#define rep(i,a,b) for(int i=(a);i<(b);++i)
#define per(i,a,b)  for(int i=(a);i>(b);--i)
#define de(a) cout << #a << " = " << a << endl;
#define dd(a) cout << #a << " = " << a << "  ";
#define file freopen("in.txt","r",stdin)
#define mem(a,b) memset(a,b,sizeof(a))
#define fi first
#define se second
/*********************************************/
const int N=2e5+5;
const ll mod=998244353;
int k;
ll bit[30],ten[100];
pii dp[20][15][1025];
void init(){
    ten[0]=1;
    for(int i=1;i<=22;i++)
		ten[i] = ten[i-1]*10%mod;
}
pii solve(int num,int pos,bool up,ll sum,bool zero){
   // de(pos);
    pii tmp;
	tmp.fi=tmp.se=0;
	if(num>k)
	{
		tmp.fi = tmp.se = 0;
		return tmp;
	}
	if(pos==0)
	{
		tmp.fi = 0, tmp.se = 1;
		return tmp;
	}
	if(!up&& !zero && dp[pos][num][sum].fi!=-1)
		return dp[pos][num][sum];
    int ma=9;
    ll ans=0;
    if(up)ma=bit[pos];
    ll cnt=0;
    for(ll i=0;i<=ma;++i){
        if(sum&(1<<i)){
        	 pii p=solve(num,pos-1,up&&i==ma,sum,i==0&&zero);
            cnt+=p.se;
           ans=((ans+p.fi+p.se%mod*i%mod*ten[pos-1]%mod)%mod+mod)%mod;
		}
        else{
            int m=num+1;
            ll res=0;
            if(i==0&&zero)m--;
            else res=(1<<i);
            pii p=solve(m,pos-1,up&&i==ma,sum+res,i==0&&zero);
           // cout<<m<<" "<<p.fi<<" "<<p.se<<endl;
            cnt+=p.se;
            ans=((ans+p.fi+p.se%mod*i%mod*ten[pos-1]%mod)%mod+mod)%mod;

            /*if(zero && i==0)
			{
				pii p = solve(num, pos-1, up&&i==ma,sum, 1);
				cnt += p.se;
				ans = (ans+p.fi)%mod;
			}
			else
			{

				pii p = solve(num+1, pos-1, up&&i==ma,sum+(1<<i), 0);
				cnt += p.se;
				ans=((ans+p.fi+p.se%mod*i%mod*ten[pos-1]%mod)%mod+mod)%mod;
			}*/
        }
    //    dd(i);
      //  dd(pos);
       // dd(num);
        //de(ans);
    }

    tmp.fi=ans;
    tmp.se=cnt;
   	if(!up&&!zero)
		dp[pos][num][sum] = tmp;
    return tmp;
}
ll calc(ll x){
    int len=0;
    while(x>0){
        bit[++len]=x%10;
        x/=10;

    }
    return solve(0,len,1,0,1).fi;
}
int main()
{
    ll l,r;
    cin>>l>>r>>k;
    init();
    /*for(int i=0;i<=10;++i){
        for(int j=0;j<10;++j){
            cout<<mp[j][i]<<" ";
        }
        cout<<endl;
    }*/
    memset(dp,-1,sizeof(dp));
   // de(calc(r));
   // de(calc(l-1));
    ll ans=((calc(r)-calc(l-1))%mod+mod)%mod;
    cout<<ans<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int>vi;
typedef pair<ll,ll>pii;
#define sz(a) ((int)(a).size())
#define rep(i,a,b) for(int i=(a);i<(b);++i)
#define per(i,a,b)  for(int i=(a);i>(b);--i)
#define de(a) cout << #a << " = " << a << endl;
#define dd(a) cout << #a << " = " << a << "  ";
#define file freopen("in.txt","r",stdin)
#define mem(a,b) memset(a,b,sizeof(a))
#define fi first
#define se second
/*********************************************/
const int N=2e5+5;
const ll mod=998244353;
int k;
ll bit[30],ten[100];
pii dp[100][100];
void init(){
    ten[0]=1;
    for(int i=1;i<=22;i++)
		ten[i] = ten[i-1]*10%mod;
}
pii solve(int num,int pos,bool up,int *vis,bool zero){
   // de(pos);
    pii tmp(0,0);

    if(num>k){
        return tmp;
    }
    if(pos==0){
        tmp.se=1;
        return tmp;
    }
   //if(!up&&!zero&&dp[pos][num].fi!=-1)return dp[pos][num];
    int ma=9;
    ll ans=0;
    if(up)ma=bit[pos];
    ll cnt=0;
    for(ll i=0;i<=ma;++i){
        if(!vis[i]){
            int tmp[10];
            rep(j,0,10)
                tmp[j]=vis[j];

            int m=num+1;
            if(i==0&&zero)m--;
            else tmp[i]=1;
            pii p=solve(m,pos-1,up&&i==ma,tmp,i==0&&zero);
           // cout<<m<<" "<<p.fi<<" "<<p.se<<endl;
            cnt+=p.se;
            ans=((ans+p.fi+i*ten[pos-1]%mod*p.se)%mod+mod)%mod;
        }
        else{
            pii p=solve(num,pos-1,up&&i==ma,vis,i==0&&zero);
            cnt+=p.se;
            ans=((ans+p.fi+i*ten[pos-1]%mod*p.se)%mod+mod)%mod;
        }
    //    dd(i);
      //  dd(pos);
       // dd(num);
        //de(ans);
    }

    tmp.fi=ans;
    tmp.se=cnt;
   //if(!up&&!zero)dp[pos][num]=tmp;
    return tmp;
}
ll calc(ll x){
    int len=0;
    while(x>0){
        bit[++len]=x%10;
        x/=10;

    }
    int vis[10];

    for(int i=0;i<=9;++i)
        vis[i]=0;
    return solve(0,len,1,vis,1).fi;
}
int main()
{
    ll l,r;
    cin>>l>>r>>k;
    init();
    /*for(int i=0;i<=10;++i){
        for(int j=0;j<10;++j){
            cout<<mp[j][i]<<" ";
        }
        cout<<endl;
    }*/
    for(int i=0;i<100;++i)
    	for(int j=0;j<100;++j)
    		dp[i][j].fi=dp[i][j].se=-1;
    ll ans=((calc(r)-calc(l-1))%mod+mod)%mod;
    cout<<ans<<endl;
    return 0;
}


#include <cstdio>
#include <cmath>
#include <algorithm>
#include <cstring>
#include <bitset>
#include <iostream>

using namespace std;

const int MAXN = 19;
const int MAXK = (1 << 10);
const int MOD = 998244353;

long long l, r;
int k;
long long T[MAXN][MAXK][2][2];
long long b_pow[MAXN];
int atIndex[MAXN];

void read_input()
{
    scanf("%I64d %I64d %d", &l, &r, &k);

    b_pow[0] = 1;
    for(int i = 1; i < 18; i++)
    {
        b_pow[i] = (1LL * b_pow[i - 1] * 10) % MOD;
    }
}

void init()
{
    for(int i = 0; i < MAXN; i ++)
    {
        for(int j = 0; j < MAXK; j++)
        {
            T[i][j][0][0] = -1;
            T[i][j][1][0] = -1;
            T[i][j][0][1] = 0;
            T[i][j][1][1] = 0;
        }
    }
}

long long rec(int index, int mask, int f, int len)
{
    if(index == len)
    {
        T[index][mask][f][1] = 1;
        return 0;
    }
    if(T[index][mask][f][0] != -1)
    {
        return T[index][mask][f][0];
    }

    int start = index == 0? 1 : 0;

    long long ans = 0;

    if(f == 0)
    {
        for(int i = start; i < 10; i++)
        {
            if((mask & (1 << i)) == 1)
            {
                ans += rec(index + 1, mask, 0, len) + ((1LL * i * b_pow[len - index - 1] * T[index + 1][mask][0][1]) % MOD);
                if(ans >= MOD) ans %= MOD;
                T[index][mask][0][1] += T[index + 1][mask][0][1];
                T[index][mask][0][1] %= MOD;
            }
            else if(__builtin_popcount(mask) < k)
            {
                ans += rec(index + 1, mask ^ (1 << i), 0, len) + ((1LL * i * b_pow[len - index - 1] * (T[index + 1][mask ^ (1 << i)][0][1])) % MOD);
                if(ans >= MOD) ans %= MOD;
                T[index][mask][f][1] += T[index + 1][mask ^ (1 << i)][0][1];
                T[index][mask][f][1] %= MOD;
            }
        }
    }
    else
    {
        for(int i = start; i <= atIndex[index]; i++)
        {
            if((mask & (1 << i)))
            {
                if(i == atIndex[index])
                {
                    ans += rec(index + 1, mask, 1, len) + ((1LL * i * b_pow[len - index - 1] * T[index + 1][mask][1][1]) % MOD);
                    if(ans >= MOD) ans %= MOD;
                    T[index][mask][f][1] += T[index + 1][mask][1][1];
                    T[index][mask][f][1] %= MOD;
                    //printf("%d %d\n", i, i * b_pow[len - index - 1] *T[index + 1][mask][f][1]);
                }
                else
                {
                    ans += rec(index + 1, mask, 0, len) + ((1LL * i * b_pow[len - index - 1] * T[index + 1][mask][0][1]) % MOD);
                    if(ans >= MOD) ans %= MOD;
                    T[index][mask][f][1] += T[index + 1][mask][0][1];
                    T[index][mask][f][1] %= MOD;
                    //printf("%d %d\n", i, i * b_pow[len - index - 1] * T[index + 1][mask][f][1]);
                }
            }
            else if(__builtin_popcount(mask) < k)
            {
                if(i == atIndex[index])
                {
                    ans += rec(index + 1, mask ^ (1 << i), 1, len) + ((1LL * i * b_pow[len - index - 1] * T[index + 1][mask ^ (1 << i)][1][1]) % MOD);
                    if(ans >= MOD) ans %= MOD;
                    T[index][mask][f][1] += T[index + 1][mask ^ (1 << i)][1][1];
                    T[index][mask][f][1] %= MOD;
                    //printf("%d %d\n", i, i * b_pow[len - index - 1] * T[index + 1][mask ^ (1 << i)][f][1]);
                }
                else
                {
                    ans += rec(index + 1, mask ^ (1 << i), 0, len) + ((1LL * i * b_pow[len - index - 1] * T[index + 1][mask ^ (1 << i)][0][1]) % MOD);
                    if(ans >= MOD) ans %= MOD;
                    T[index][mask][f][1] += T[index + 1][mask ^ (1 << i)][0][1];
                    T[index][mask][f][1] %= MOD;
                    //printf("%d %d\n", i, i * b_pow[len - index - 1] * T[index + 1][mask ^ (1 << i)][0][1]);
                }
            }
        }
    }
    //printf("%d\n", ans);
    return T[index][mask][f][0] = (ans % MOD);
}

long long solve(long long temp)
{
    int len = 0;
    while(temp)
    {
        atIndex[len++] = temp % 10;
        temp /= 10;
    }
    for(int i = 0; i < len / 2; i++)
    {
        swap(atIndex[i], atIndex[len - i - 1]);
    }
    /*for(int i = 0; i < len; i++)
    {
        printf("%d", atIndex[i]);
    }
    printf("\n");*/
    long long ans = 0, ans2 = 0;

    init();
    ans += rec(0, 0, 1, len);

    //printf("%d\n", ans);
    for(int i = 0; i < len; i++)
    {
        atIndex[i] = 9;
    }

    for(int i = len - 1; i > 0; i--)
    {
        init();
        ans += rec(0, 0, 1, i);
        //ans2 += rec(0, 0, 1, i);
        if(ans >= MOD) ans %= MOD;
    }
    return ans;
}

int main()
{
    read_input();
    printf("%I64d\n", (solve(r) - solve(l - 1)));

    return 0;
}

/*
2 2345 10

*/


#include <cstdio>
#include <cmath>
#include <algorithm>
#include <cstring>

using namespace std;

const int MAXN = 19;
const int MAXK = (1 << 10);

int l, r, k;
int T[MAXN][MAXK][2][2];
int atIndex[MAXN];

void read_input()
{
    scanf("%d %d %d", &l, &r, &k);
}

int rec(int index, int mask, int f, int len)
{
    if(index == len)
    {
        T[index][mask][f][1] = 1;
        return 1;
    }
    if(T[index][mask][f][0] != -1)
    {
        return T[index][mask][f][0];
    }

    int start = index == 0? 1 : 0;

    int ans = 0;

    if(!f)
    {
        for(int i = start; i < 10; i++)
        {
            if((mask & (1 << i)) == 1)
            {
                ans += rec(index + 1, mask, f, len) + (pow(10, (len - index - 1)) * (T[index + 1][mask][1][1] ));
                T[index][mask][f][1] += T[index + 1][mask][0][1];
            }
        }
    }
    else
    {
        for(int i = start; i <= atIndex[index]; i++)
        {
            if((mask & (1 << i)) == 1)
            {
                if(i == atIndex[index])
                {
                    ans += rec(index + 1, mask, 1, len) + (pow(10, (len - index - 1)) * (T[index + 1][mask][1][1]));
                    T[index][mask][f][1] += T[index + 1][mask][1][1];
                }
                else
                {
                    ans += rec(index + 1, mask, 0, len) + (pow(10, (len - index - 1)) * (T[index + 1][mask][1][1]));
                    T[index][mask][f][1] += T[index + 1][mask][0][1];
                }
            }
        }
    }
    //printf("%d\n", ans);
    return T[index][mask][f][0] = ans;
}

int solve(int temp)
{
    int len = 0;
    while(temp)
    {
        atIndex[len++] = temp % 10;
        temp /= 10;
    }
    for(int i = 0; i < len / 2; i++)
    {
        swap(atIndex[i], atIndex[len - i - 1]);
    }
    /*for(int i = 0; i < len; i++)
    {
        printf("%d", atIndex[i]);
    }
    printf("\n");*/
    memset(T, -1, sizeof(T));
    int ans = 0;
    for(int mask = (1 << 10) - 1; mask > 0; mask--)
    {
        if(__builtin_popcount(mask) <= k)
        {
            ans += rec(0, mask, 0, len);
        }
    }
    for(int i = len - 1; i >= 0; i--)
    {
        atIndex[i] = 9;
    }

    /*for(int i = len - 1; i > 0; i--)
    {
        for(int mask = (1 << 10) - 1; mask > 0; mask--)
        {
            if(__builtin_popcount(mask) <= k)
            {
                memset(T, -1, sizeof(T));
                ans += rec(0, mask, 0, i);
            }
        }
    }*/
    printf("%d\n", ans);
    return ans;
}

int main()
{
    read_input();
    printf("%d\n", (solve(r) - solve(l - 1)));

    return 0;
}


#include <cstdio>
#include <cstring>
#include <algorithm>
#include <iostream>
#include <bitset>

using namespace std;

const int MAXN = 20;
const int MAXK = (1 << 10);
const int MOD = 998244353;

struct pt
{
    int x, y;
    pt()
    {
        x = 0;
        y = 0;
    }
    pt(int _x, int _y)
    {
        x = _x; y = _y;
    }
};

long long l, r;
int k;
int b_pow[MAXN];
int b_count[MAXK];
pt T[MAXN][MAXK][2];

int add(int f1, int f2)
{
    f1 += f2;
    if(f1 >= MOD) f1 %= MOD;
    if(f1 < 0) f1 += MOD;
    return f1;
}

int mult(int f1, int f2)
{
    return (1LL * f1 * f2) % MOD;
}

void read_input()
{
    scanf("%I64d %I64d %d", &l, &r, &k);

    b_pow[0] = 1;
    for(int i = 1; i < MAXN; i++)
    {
        b_pow[i] = mult(b_pow[i - 1], 10);
    }

    for(int i = 0; i < MAXK; i++)
    {
        b_count[i] = __builtin_popcount(i);
    }
}

int calcDp(string s, int len)
{
    for(int i = 0; i < MAXN; i++)
    {
        for(int j = 0; j < MAXK; j++)
        {
            T[i][j][0] = pt();
            T[i][j][1] = pt();
        }
    }

    T[0][0][1] = pt(0, 1);

    for(int i = 0; i < len; i++)
    {
        int temp = s[i] - '0';
        for(int mask = 0; mask < MAXK; mask++)
        {
            if(T[i][mask][0].y == 0 && T[i][mask][1].y == 0) continue;
            for(int j = (i == 0); j < 10; j++)
            {
                int nmask = mask | (1 << j);
                int cnt = T[i][mask][0].y;
                int sum = add(T[i][mask][0].x, mult(j, mult(b_pow[len - i - 1], cnt)));

                T[i + 1][nmask][0].x = add(T[i + 1][nmask][0].x, sum);
                T[i + 1][nmask][0].y = add(T[i + 1][nmask][0].y, cnt);
            }
            for(int j = (i == 0); j <= temp; j++)
            {
                int nmask = mask | (1 << j);
                int cnt = T[i][mask][1].y;
                int sum = add(T[i][mask][1].x, mult(j, mult(b_pow[len - i - 1], cnt)));

                T[i + 1][nmask][j == temp].x = add(T[i + 1][nmask][j == temp].x, sum);
                T[i + 1][nmask][j == temp].y = add(T[i + 1][nmask][j == temp].y, cnt);
            }
        }
    }

    int ans = 0;

    for(int i = 0; i < MAXK; i++)
    {
        if(b_count[i] <= k)
        {
            ans = add(ans, T[len][i][0].x);
            ans = add(ans, T[len][i][1].x);
        }
    }

    return ans;
}

int calc(long long t)
{
    int len = to_string(t).size();

    int ans = 0;

    for(int i = 1; i < len; i++)
    {
        ans = add(ans, calcDp(string(i, '9'), i));
    }

    ans = add(ans, calcDp(to_string(t), len));

    return ans;
}

int main()
{
    read_input();
    printf("%d\n", add(calc(r), -calc(l - 1)));

    return 0;
}

/*
1 10 2
*/