def solution(strings, n):
    strings.sort()
    return sorted(strings, key=lambda strings: strings[n])


print(solution(['sun', 'bed', 'car'], 1))
print(solution(['abce', 'abcd', 'cdx'], 2))

0516c53a601e5ce7795660919909d41e526269e3
<mask token>

def solution(strings, n):
    strings.sort()
    return sorted(strings, key=lambda strings: strings[n])


<mask token>

def solution(strings, n):
    strings.sort()
    return sorted(strings, key=lambda strings: strings[n])


print(solution(['sun', 'bed', 'car'], 1))
print(solution(['abce', 'abcd', 'cdx'], 2))
