sort (n.) Look up sort at Dictionary.com
late 14c., from Old French sorte "class, kind," from Latin sortem (nominative sors) "lot, fate, share, portion, rank, category," from PIE root *ser- "to line up" (cf. Latin serere "to arrange, attach, join;" see series). The sense evolution in V.Latin is from "what is allotted to one by fate," to "fortune, condition," to "rank, class, order." Out of sorts "not in usual good condition" is attested from 1620s, with literal sense of "out of stock."
sort (v.) Look up sort at Dictionary.com
mid-14c., "to arrange according to type or quality," from Old French sortir "allot, sort, assort," from Latin sortiri "draw lots, divide, choose," from sors (see sort (n.)). In some senses, the verb is a shortened form of assort.