Prints fractions to a file