Now there is a twofold order in ends, the order of intention and the order of execution, and in either order there must be something first. That which is first in the order of intention is by way of a principle moving the appetite; hence if this principle be removed desire would not be moved at all. The principle in the order of execution is that from which action begins; hence if this principle be removed, no one would begin doing anything.
Now the principle with respect to intention is the ultimate end; the principle with respect to execution is the first means related to the end. To go on without end with respect to either is therefore impossible, for if there were no ultimate end nothing would be desired, nor would any act be terminated, nor would the intention of the agent ever be at rest; and if there were no first means in relation to the end, no one would begin to do anything and deliberation would never end, but go on infinitely. On the other hand, nothing prevents an infinite series in things which do not have a per se order one to another, but are joined accidentally to each other, for accidental causes are indeterminate. In this case, in fact, there may also be an infinity accidentally in ends and in means to the end.
From Saint Thomas Aquinas, Treatise on Happiness, trans. by John A Oesterle (Notre Dame: Univ. of Notre Dame Press, 1983), p. 9. Question 1, Art. 4, of the First Part of the Second Part.