def sort_by_index_with_for_loop(index, array):
    """
    Sort the array with the given index and return a list of
    (<element>, <original index>, <new index>) tuples.

    Parameters:
        index: List of length n that contains interger 0 to n-1.
        array: List of length n.
    Returns:
        A list of length n containing
        (<element>, <original index>, <new index>) tuples or an empty list
        if n is 0.

    >>> sort_by_index_with_for_loop([ 0, 4, 2, 3, 1], ["zero", "four", "two", \
"three", "one"])
    [('zero', 0, 0), ('one', 4, 1), ('two', 2, 2), ('three', 3, 3), \
('four', 1, 4)]
    """
    sorted_list = []
    for i in range(0, len(array)):
        sorted_list.append((array[index[i]], index[i], i))
    return sorted_list