Complete program to find all solution of the puzzle