def find_minimum(diff):
    """
    Find unaccessed track which is
    at minimum distance from head
    """
    index = -1
    minimum = 999999999

    for i in range(len(diff)):
        if (not diff[i][1] and
                minimum > diff[i][0]):
            minimum = diff[i][0]
            index = i
    return index