Divisibility by seven Given number n, whose decimal representation contains digits only $1, 6, 8, 9$. Rearrange the digits in its decimal representation so that the resulting number will be divisible by 7.
If number is m digited after rearrangement it should be still $m$ digited.
If not possible then i need to tell "not possible".
EXAMPLE : 
$1689$ 
After rearrangement we can have $1869$, which is divisible by $7$
How to tackle his problem

If there is no condition that each of these digits need appear at least once, then it is not possible. Consider $1111$.
