Race results form a directed graph with no cycles: an arrow goes from the faster horse to the slower one. It defines a partial order: for some pairs of horses we know which is faster, for others we do not. The true speeds are one of the linear orders consistent with all the arrows.
A horse's ancestors are all horses with a path of arrows leading to it, that is, all surely faster horses. A horse can finish k-th in some consistent order if and only if it has at most k − 1 ancestors (and not too many descendants). Just place all its ancestors first, then the horse itself. So only horses with 0, 1 or 2 ancestors can still make the top 3.
After the sixth race, the horse that finished j-th in the heat with letter number i has exactly (i − 1) + (j − 1) ancestors. Click a circle to see them. A graph without a single redundant edge, like this one, is called a Hasse diagram.