def flatten_(structure):
  if isinstance(structure, dict):
    if structure:
      structure = zip(*sorted(structure.items(), key=lambda x: x[0]))[1]
    else:
      structure = ()
  if isinstance(structure, (tuple, list)):
    result = []
    for element in structure:
      result += flatten_(element)
    return tuple(result)
  return (structure,)