import numpy as np
# create a 3D numpy array of size 10x10x10
arr = np.random.rand(10,10,10)
# use argsort to get the index of the 100th smallest value
flat_idx = np.argsort(arr.flatten())[99]
# use unravel_index to get the corresponding (x,y,z) indices
x,y,z = np.unravel_index(flat_idx, arr.shape)
print(f"The 100th element is located at ({x},{y},{z})")