#include<stdio.h>
#include<math.h>
int main(){
  long n,m;
  while(scanf("%d %d",&n,&m),n||m){
    for(;m;n++){
      if((long)log10(n)+1>m)n/=((long)pow(10,log10(n)+1-m));
      printf("%ld",n);
      m-=(long)log10(n)+1;
    }
    printf("\n");
  }	
  return 0;
}