generate array of possible triples