generate a random list and write them to a file.