Problem statement

There are two integers $ A $ and $ B $. The process of finding $ A --B $ by writing in decimal is shown below.

1. Express $ A $ and $ B $ in decimal. Subscripts are $ 0,1,2, ..., n-1 $ in order from the bottom, $ A = A_ {n-1} A_ {n-2} ... A_ {0} $, $ B = B_ { n-1} B_ {n-2} ... B_ {0} $. $ n $ is the number of digits of $ A $ when expressed in decimal. When the number of digits of $ B $ is less than $ n $, the upper digit is supplemented with $ 0 $.
2. Set $ ​​borrow_ {0} = 0 $.
3. Repeat the following process from $ i = 0 $ to $ n-1 $.
3.1. If $ A_ {i} --borrow_ {i} \ geq B_ {i} $, then $ C_ {i} = A_ {i} --borrow_ {i} --B_ {i} $, $ borrow_ {i + 1 } = 0 $.
3.2. If $ A_ {i} --borrow_ {i} \ lt B_ {i} $, then $ C_ {i} = A_ {i} --borrow_ {i} + 10 --B_ {i} $, $ borrow_ {i Let +1} = 1 $.

The calculation result of $ A --B $ is $ C_ {n-1} C_ {n-2} ... C_ {0} $. However, the top-level consecutive $ 0 $ is removed.

If you forget to carry down, $ borrow_ {i + 1} = 1 $ in the process of 3.2 becomes $ borrow_ {i + 1} = 0 $. Find the maximum value of the calculation result when you forget to carry down the maximum $ K $ times.

Constraint

* $ 1 \ leq B \ lt A \ leq 10 ^ 9 $
* $ 1 \ leq K \ leq 9 $



input

Input follows the following format. All given numbers are integers.




$ A $ $ B $ $ K $

output

Output the maximum value of the calculation result on one line.

Examples

Input

99 98 1


Output

1


Input

100 2 3


Output

198


Input

538 84 1


Output

554


Input

2012 1987 1


Output

1025
#include <cstdio>
#include <iostream>
#include <vector>
#include <list>
#include <cmath>
#include <fstream>
#include <algorithm>
#include <string>
#include <queue>
#include <set>
#include <map>
#include <complex>
#include <iterator>
#include <cstdlib>
#include <cstring>
#include <sstream>
#include <stack>

using namespace std;

const double EPS=(1e-10);
typedef long long ll;
typedef pair<int,int> pii;
bool EQ(double a,double b){
  return abs((a)-(b))<EPS;
}
void fast_stream(){
	std::ios_base::sync_with_stdio(0);
}

int getLen(int n){
    int cnt=0;
    if(n==0)return 1;
    while(n){
        cnt++;
        n/=10;
    }
    return cnt;
}

void solve(){
    int A,B,K;
    cin>>A>>B>>K;
    int n=getLen(A);
    string as,bs;
    for(int i=0;i<n;i++){
        as+=(A%10)+'0';
        A/=10;
    }
    reverse(as.begin(),as.end());
    for(int i=0;i<n;i++){
        bs+=(B%10)+'0';
        B/=10;
    }
    reverse(bs.begin(),bs.end());
    // ツづつアツづーツ繰ツづィツ可コツつーツつオツづ按つ「ツつゥ
    ll maxnum=0;
    for(int mask=0;mask<(1<<n);mask++){
        int cnt=0;
        for(int i=0;i<n;i++){
            if((mask>>i)&1)cnt++;
        }
        if(cnt>K)continue;
        string c;
        // ツ可コツ暗環個つゥツづァツ渉氾板づ可計ツ算
        int bor=0;
        for(int i=n-1;i>=0;i--){
            if(as[i]-'0'-bor>=bs[i]-'0'){
                c+=as[i]-bor-bs[i]+'0';
                bor=0;
            }
            else{
                c+=as[i]-bor-bs[i]+'0'+10;
                if((mask>>i)&1)bor=0;
                else bor=1;
            }
        }
        ll num=0;
        for(int i=c.size()-1;i>=0;i--){
            num=num*10+(c[i]-'0');
        }
        maxnum=max(maxnum,num);
    }
    cout<<maxnum<<endl;
}
int main(){
    solve();

    return 0;
}