Getting Rid of Coins

No attempts yetTime limit1sMemory limit256 MB

Problem

While Per was living in New York, he could not use his debit card as often as in Sweden. He had to carry cash all the time, and his wallet kept getting heavier from the coins in it. One day he was buying a few kilos of candy in a candy store and wanted to hand over as many coins as possible without getting any change back, but he could not work out how.

You are given the price PP that Per was going to pay, and the number of 1-, 5-, 10- and 25-cent coins in his wallet. He had no notes. Find the maximum number of coins he could use to pay exactly PP without getting any change back.

Input

The first line contains the price PP that Per was going to pay. (1P1000000001 \le P \le 100\,000\,000)

The second line contains four integers separated by spaces, N1N_1, N5N_5, N10N_{10}, N25N_{25}, the number of 1-, 5-, 10- and 25-cent coins in Per's wallet. (0N1,N5,N10,N251000000000 \le N_1, N_5, N_{10}, N_{25} \le 100\,000\,000)

Output

If Per can pay exactly PP without getting any change back, print on one line the maximum number of coins he can use. Otherwise print Impossible on the first line.