
'''simple docstring'''





import torch

from diffusers import DiffusionPipeline






class 							UpperCAmelCase_							(    A				):

 '''simple docstring'''







 def __init__(					self		:  int			,				snake_case__		:  str			,				snake_case__		:  List[Any] ):



   '''simple docstring'''




   super().__init__()

   self.register_modules(unet=snake_case__			,				scheduler=snake_case__ )







 def __call__(					self		:  Optional[Any] ):



   '''simple docstring'''




   UpperCAmelCase__      :					Dict				       =							torch.randn(
       (1, self.unet.config.in_channels, self.unet.config.sample_size, self.unet.config.sample_size)			,				)
   UpperCAmelCase__      :					int				       =							1

   UpperCAmelCase__      :					Optional[int]				       =							self.unet(snake_case__			,				snake_case__ ).sample
   UpperCAmelCase__      :					int				       =							self.scheduler.step(snake_case__			,				snake_case__			,				snake_case__ ).prev_sample

   UpperCAmelCase__      :					Dict				       =							scheduler_output - scheduler_output + torch.ones_like(snake_case__ )

   return result





'''simple docstring'''





def snake_case_     (					lowercase__		):

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

  UpperCAmelCase__      :					Union[str, Any]				       =							[]

  def generate(lowercase__   ,       lowercase__		):
    UpperCAmelCase__      :					str				       =							[0] * n
    res.append(tuple(lowercase__		)		)

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

  generate(len(lowercase__		)   ,       lowercase__		)
  return res


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



