modified the 8queen code to print all solutions