Smallest Number with Fives

Time limit1sMemory limit128 MB

Problem

Given natural numbers N and K, find the smallest natural number greater than N whose decimal representation contains the digit 5 at least K times.

Input

The first line contains two natural numbers N and K separated by a space.

  • 1 <= N <= 10^15
  • 1 <= K <= 15

Output

Print the smallest natural number greater than N whose decimal representation contains the digit 5 at least K times.