def flatten(a):
    """recursively flatten n-nested array
    example:
    >>> flatten([[1,2],[3,4],[5,6,[7,8],]])
    [1, 2, 3, 4, 5, 6, 7, 8]
    """
    if isinstance(a, list):
        b = list()
        for a_ in a:
            if isinstance(a_, list):
                b.extend(flatten(a_))
            else:
                b.append(a_)
        return(b)
    else:
        return(a)