Solve the characters sorting by its order in another given string.