Sort List Lexicographically Python