Printing all rotations of a given number