#include <cstdio> #include <iostream> using namespace std; long long n,k,ans; string m; int main(){ cin>>m>>k; long long x=0,sum=0,y=1; for(int i=0;i<m.size();i++){ x=x*10+m[i]-48; sum+=x-y+1; y*=10; } if(k<sum){printf("0 "); return 0;} if(k==sum){cout<<m<<endl; return 0;} long long i; for(i=1;i<=1000;i++){ x*=10; sum+=x-y; if(sum>=k)break; y*=10; } if(i==1001){printf("0 "); return 0;} sum-=x-y; x/=10; y+=k-sum; printf("%lld ",y-1); return 0; }