CF121B Lucky Transformation
Description
Petya loves lucky numbers. Everybody knows that lucky numbers are positive integers whose decimal representation contains only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not.
Petya has a number consisting of $ n $ digits without leading zeroes. He represented it as an array of digits without leading zeroes. Let's call it $ d $ . The numeration starts with $ 1 $ , starting from the most significant digit. Petya wants to perform the following operation $ k $ times: find the minimum $ x $ $ (1
Input Format
The first line contains two integers $ n $ and $ k $ $ (1
Output Format
In the single line print the result without spaces — the number after the $ k $ operations are fulfilled.
Explanation/Hint
In the first sample the number changes in the following sequence: $ 4727447→4427447→4427477→4427447→4427477 $ .
In the second sample: $ 4478→4778→4478 $ .