def replace(tpl, ind, var):
    """
    (TUPLE FUNCTION)
    Replace tpl[ind] with var
    """
    tpl = list(tpl)
    if type(ind) == str:
        ind = tpl.index(ind)
    tpl[ind] = var
    return tuple(tpl)
