# Bank robber interview puzzle

Posted by CodeGuru
A year ago the famous gangster Vito woke up in the morning and realized that he was bored of robbing banks of round sums.

So, for the last year he has been taking from banks sums that have only digits 1 and 2 in their decimal notation. After each robbery, Vito divides the money between N members of his gang.

Your task is to determine the minimal stolen sum which is a multiple of N, where N is in the following range (1 ≤ N ≤ 106).

Your function should output the minimal number which is a multiple of N and whose decimal notation contains only digits 1 and 2. If it contains more than 30 digits or if there are no such numbers, then output the word "Impossible".

5 - "Impossible"

26836 - 2111222121212

26837 - 211211212222212

So, for the last year he has been taking from banks sums that have only digits 1 and 2 in their decimal notation. After each robbery, Vito divides the money between N members of his gang.

Your task is to determine the minimal stolen sum which is a multiple of N, where N is in the following range (1 ≤ N ≤ 106).

Your function should output the minimal number which is a multiple of N and whose decimal notation contains only digits 1 and 2. If it contains more than 30 digits or if there are no such numbers, then output the word "Impossible".

__Sample:__5 - "Impossible"

26836 - 2111222121212

26837 - 211211212222212