def METHOD_NAME(l1, l2, f):
    l1_type = isinstance(l1, (list, tuple))
    l2_type = isinstance(l2, (list, tuple))
    if not (l1_type or l2_type):
        return f(l1, l2)
    elif l1_type and l2_type:
        fl = l2[-1] if len(l1) > len(l2) else l1[-1]
        res = []
        res_append = res.append
        for x, y in zip_longest(l1, l2, fillvalue=fl):
            res_append(METHOD_NAME(x, y, f))
        return res
    elif l1_type and not l2_type:
        return [METHOD_NAME(x, l2, f) for x in l1]
    else: #not l1_type and l2_type
        return [METHOD_NAME(l1, y, f) for y in l2]