Qubole interview question

find next lexicographical seq after a given sequence