function generalisedFizzBuzz m, f1, f2, f3 put f1 & cr & f2 & cr & f3 into factors sort factors ascending numeric repeat with i = 1 to m put false into flag if i mod (word 1 of line 1 of factors) = 0 then put word 2 of line 1 of factors after fizzbuzz put true into flag end if if i mod (word 1 of line 2 of factors) = 0 then put word 2 of line 2 of factors after fizzbuzz put true into flag end if if i mod (word 1 of line 3 of factors) = 0 then put word 2 of line 3 of factors after fizzbuzz put true into flag end if if flag is false then put i after fizzbuzz put cr after fizzbuzz end repeat return fizzbuzz end generalisedFizzBuzz