



def 					__snake_case     (      _UpperCAmelCase    ):

    if len(_UpperCAmelCase    ) <= 1:
        return [tuple(_UpperCAmelCase    )]

    __a							=    []

    def generate(_UpperCAmelCase       ,			_UpperCAmelCase    ):
        __a							=    [0] * n
        res.append(tuple(_UpperCAmelCase    )    )

        __a							=    0
        while i < n:
            if c[i] < i:
                if i % 2 == 0:
                    __a	,       __a							=    arr[i], arr[0]
                else:
                    __a	,       __a							=    arr[i], arr[c[i]]
                res.append(tuple(_UpperCAmelCase    )    )
                c[i] += 1
                __a							=    0
            else:
                __a							=    0
                i += 1

    generate(len(_UpperCAmelCase    )       ,			_UpperCAmelCase    )
    return res


if __name__ == "__main__":
 __snake_case						:str						=					input('''Enter numbers separated by a comma:\n''').strip()
 __snake_case						:List[Any]						=					[int(item) for item in user_input.split(''',''')]
 print(heaps(arr))










def 					__snake_case     (      _UpperCAmelCase    ):
    if not isinstance(_UpperCAmelCase       ,			_UpperCAmelCase    ):
        raise TypeError('''Input value must be an \'int\' type'''    )

    __a							=    0
    while number:
        position += 1
        number >>= 1

    return position


if __name__ == "__main__":
 import doctest

 doctest.testmod()





