  In this paper, we characterize by lexicographic order all finite Sturmian and
episturmian words, i.e., all (finite) factors of such infinite words.
Consequently, we obtain a characterization of infinite episturmian words in a
"wide sense" (episturmian and episkew infinite words). That is, we characterize
the set of all infinite words whose factors are (finite) episturmian.
Similarly, we characterize by lexicographic order all balanced infinite words
over a 2-letter alphabet; in other words, all Sturmian and skew infinite words,
the factors of which are (finite) Sturmian.
