Proper output for the program
<pre><code>import itertools 

file = open('out.txt', 'w')
variations = itertools.product('abc', repeat=3) 

for variations in variations: 
    variation_string = "" 

    for letter in variations: 
        variation_string += letter 

    file.write(variation_string)

file.close()
</code></pre>

<p>The output from the above program is like a clustered state:</p>

<pre><code>aaaaabaacabaabbabcacaacbaccbaababbacbbabbbbbcbcabcbbcccaacabcaccbacbbcbcccaccb­ccc
</code></pre>

<p>Can you modify the program so that the output would be in a line after line that is the first line of the output would be <code>aaa</code> and the next line would be <code>aab</code> and the next would be <code>aac</code> and so on...</p>

<pre><code>aaa
aab
aac
</code></pre>
