Some combinatorial applications of spacefilling curves