#include <iostream>
using namespace std;
// exponentiating functions
long long power(long long base, long long exp)
{
long long result = 1;
for (int i = 0; i < exp; ++i) {
result *= base;
}
return result;
}
/*
// recursive version
int rPower(int base, int exp)
{
if (exp == 0)
return 1;
return base = base * rPower(base, --exp);
}
// ------------------------------------
*/
int main()
{
int *k = new int;
long long *core = new long long, *eq = new long long, *n = new long long;
*core = 0;
cin >> *n >> *k;
for (int i = 0; i < *k; ++i) {
*core += 5 * power(10, i);
}
*eq = power(10, (*k));
while (*core <= *n) {
*core += *eq;
}
cout << *core << endl;
delete n; delete k; delete core;; delete eq;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKLy8gIGV4cG9uZW50aWF0aW5nIGZ1bmN0aW9ucwpsb25nIGxvbmcgcG93ZXIobG9uZyBsb25nIGJhc2UsIGxvbmcgbG9uZyBleHApCnsKCWxvbmcgbG9uZyByZXN1bHQgPSAxOwoJZm9yIChpbnQgaSA9IDA7IGkgPCBleHA7ICsraSkgewoJCXJlc3VsdCAqPSBiYXNlOwoJfQoJcmV0dXJuIHJlc3VsdDsgCn0KLyoKLy8gcmVjdXJzaXZlIHZlcnNpb24KaW50IHJQb3dlcihpbnQgYmFzZSwgaW50IGV4cCkKewoJaWYgKGV4cCA9PSAwKQoJCXJldHVybiAxOyAKCglyZXR1cm4gYmFzZSA9IGJhc2UgKiByUG93ZXIoYmFzZSwgLS1leHApOwp9CgovLyAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKi8KCmludCBtYWluKCkKewoJaW50ICprID0gbmV3IGludDsKCWxvbmcgbG9uZyAqY29yZSA9IG5ldyBsb25nIGxvbmcsICplcSA9IG5ldyBsb25nIGxvbmcsICpuID0gbmV3IGxvbmcgbG9uZzsKCSpjb3JlID0gMDsgCgoJY2luID4+ICpuID4+ICprOwoKCWZvciAoaW50IGkgPSAwOyBpIDwgKms7ICsraSkgewoJCSpjb3JlICs9IDUgKiBwb3dlcigxMCwgaSk7Cgl9CgoJKmVxID0gcG93ZXIoMTAsICgqaykpOwoJd2hpbGUgKCpjb3JlIDw9ICpuKSB7CgkJKmNvcmUgKz0gKmVxOwoJfQoKCWNvdXQgPDwgKmNvcmUgPDwgZW5kbDsKCglkZWxldGUgbjsgZGVsZXRlIGs7IGRlbGV0ZSBjb3JlOzsgZGVsZXRlIGVxOwoJcmV0dXJuIDA7Cn0=