import re
def natural_sort_with_indices(l):
convert = lambda text: int(text) if text.isdigit() else text.lower()
alphanum_key = lambda key: [convert(c) for c in re.split(r'(\d+)', key) if c]
# Create a list of tuples (index, element) to maintain the original indices after sorting
indexed_list = list(enumerate(l))
# Sort the list of tuples using the alphanum_key function on the second element of each tuple (the string)
indexed_list.sort(key=lambda x: alphanum_key(x[1]))
# Extract the sorted elements and their corresponding original indices
sorted_list = [item[1] for item in indexed_list]
original_indices = [item[0] for item in indexed_list]
return sorted_list, original_indices
# Call the function and store the sorted result and original indices
sorted_list, original_indices = natural_sort_with_indices(strings)
# Assign results to variables a and b
a = sorted_list
b = original_indices
but now I get individual letters as output.