



'''simple docstring'''






def       lowerCamelCase__       (						_A				):





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

  a						:					Tuple        =     []

  def generate(_A ,			_A				):
    a						:					str        =     [0] * n
    res.append(tuple(UpperCAmelCase_				)				)

    a						:					Optional[Any]        =     0
    while i < n:
      if c[i] < i:
        if i % 2 == 0:
          a						:					str        =     arr[i], arr[0]
        else:
          a						:					List[str]        =     arr[i], arr[c[i]]
        res.append(tuple(UpperCAmelCase_				)				)
        c[i] += 1
        a						:					int        =     0
      else:
        a						:					List[str]        =     0
        i += 1

  generate(len(UpperCAmelCase_				) ,			UpperCAmelCase_				)
  return res


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



from __future__ import annotations
def 				__lowerCamelCase						( UpperCAmelCase_						:		dict ,  UpperCAmelCase_						:		str						):




      """simple docstring"""





      a							,				a						:Optional[Any] 							=       set(UpperCAmelCase_						), [start]

      while stack:
            a						:Optional[int] 							=       stack.pop()
            explored.add(UpperCAmelCase_						)
            # Differences from BFS:
            # 1) pop last element instead of first one
            # 2) add adjacent elements to stack without exploring them
            for adj in reversed(graph[v]						):
                  if adj not in explored:
                        stack.append(UpperCAmelCase_						)
      return explored


snake_case				:    Optional[int]       				=     {
    '''A''': ['''B''', '''C''', '''D'''],
    '''B''': ['''A''', '''D''', '''E'''],
    '''C''': ['''A''', '''F'''],
    '''D''': ['''B''', '''D'''],
    '''E''': ['''B''', '''F'''],
    '''F''': ['''C''', '''E''', '''G'''],
    '''G''': ['''F'''],
}

if __name__ == "__main__":
     import doctest

     doctest.testmod()
     print(depth_first_search(G, '''A'''))





