#include <cstdio>
#include <cstdlib>

const int pot10[] = { 1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000 };

int main(void) {
	int x, n, pot, a, b;
	scanf("%d%d", &x, &n);
	pot = pot10[n];
	
	a = x / pot * pot;
	b = ( x + pot - 1 ) / pot * pot;
	printf("%d\n", abs( x - a ) < abs( x - b ) ? a : b );
	return 0;
}
