def argmin2(l):
    """Return the indexes of the smalles two items in l."""
    (j1, m1) = (-1, float('inf'))
    (j2, m2) = (-1, float('inf'))
    for ix, x in enumerate(l):
        if x <= m1:
            (j2, m2) = (j1, m1)
            (j1, m1) = (ix, x)
        elif x < m2:
            (j2, m2) = (ix, x)
    return (j1, j2)