
"""simple docstring"""


import flax.linen as nn
import jax
import jax.numpy as jnp



class   __a  (      nn.Module	):
       UpperCamelCase_		:					int
       UpperCamelCase_		:					jnp.dtype   =			jnp.floataa






       def 	_SCREAMING_SNAKE_CASE       (  self :							Optional[int]			)->  Dict:







              """simple docstring"""
              UpperCamelCase					 =		nn.Conv(
                  self.out_channels       ,      kernel_size=(3, 3)       ,      strides=(1, 1)       ,      padding=((1, 1), (1, 1))       ,      dtype=self.dtype       ,      )






       def __call__(  self :							Union[str, Any]       ,      UpperCAmelCase_ :							Optional[Any]			)->  Any:







              """simple docstring"""
              UpperCamelCase ,       UpperCamelCase ,       UpperCamelCase ,       UpperCamelCase					 =		hidden_states.shape
              UpperCamelCase					 =		jax.image.resize(
                  UpperCAmelCase_       ,      shape=(batch, height * 2, width * 2, channels)       ,      method="nearest"       ,      )
              UpperCamelCase					 =		self.conv(UpperCAmelCase_			)
              return hidden_states





class   __a  (      nn.Module	):
       UpperCamelCase_		:					int
       UpperCamelCase_		:					jnp.dtype   =			jnp.floataa






       def 	_SCREAMING_SNAKE_CASE       (  self :							Optional[int]			)->  Any:







              """simple docstring"""
              UpperCamelCase					 =		nn.Conv(
                  self.out_channels       ,      kernel_size=(3, 3)       ,      strides=(2, 2)       ,      padding=((1, 1), (1, 1))       ,      dtype=self.dtype       ,      )






       def __call__(  self :							str       ,      UpperCAmelCase_ :							Union[str, Any]			)->  Optional[Any]:







              """simple docstring"""
              # pad = ((0, 0), (0, 1), (0, 1), (0, 0))  # pad height and width dim
              # hidden_states = jnp.pad(hidden_states, pad_width=pad)
              UpperCamelCase					 =		self.conv(UpperCAmelCase_			)
              return hidden_states





class   __a  (      nn.Module	):
       UpperCamelCase_		:					int
       UpperCamelCase_		:					int   =			None
       UpperCamelCase_		:					float   =			0.0
       UpperCamelCase_		:					bool   =			None
       UpperCamelCase_		:					jnp.dtype   =			jnp.floataa






       def 	_SCREAMING_SNAKE_CASE       (  self :							Tuple			)->  List[Any]:







              """simple docstring"""
              UpperCamelCase					 =		self.in_channels if self.out_channels is None else self.out_channels

              UpperCamelCase					 =		nn.GroupNorm(num_groups=32       ,      epsilon=1e-5			)
              UpperCamelCase					 =		nn.Conv(
                  UpperCAmelCase_       ,      kernel_size=(3, 3)       ,      strides=(1, 1)       ,      padding=((1, 1), (1, 1))       ,      dtype=self.dtype       ,      )

              UpperCamelCase					 =		nn.Dense(UpperCAmelCase_       ,      dtype=self.dtype			)

              UpperCamelCase					 =		nn.GroupNorm(num_groups=32       ,      epsilon=1e-5			)
              UpperCamelCase					 =		nn.Dropout(self.dropout_prob			)
              UpperCamelCase					 =		nn.Conv(
                  UpperCAmelCase_       ,      kernel_size=(3, 3)       ,      strides=(1, 1)       ,      padding=((1, 1), (1, 1))       ,      dtype=self.dtype       ,      )

              UpperCamelCase					 =		self.in_channels != out_channels if self.use_nin_shortcut is None else self.use_nin_shortcut

              UpperCamelCase					 =		None
              if use_nin_shortcut:
                     UpperCamelCase					 =		nn.Conv(
                         UpperCAmelCase_       ,      kernel_size=(1, 1)       ,      strides=(1, 1)       ,      padding="VALID"       ,      dtype=self.dtype       ,      )






       def __call__(  self :							str       ,      UpperCAmelCase_ :							Tuple       ,      UpperCAmelCase_ :							str       ,      UpperCAmelCase_ :							Dict=True			)->  Any:







              """simple docstring"""
              UpperCamelCase					 =		hidden_states
              UpperCamelCase					 =		self.norma(UpperCAmelCase_			)
              UpperCamelCase					 =		nn.swish(UpperCAmelCase_			)
              UpperCamelCase					 =		self.conva(UpperCAmelCase_			)

              UpperCamelCase					 =		self.time_emb_proj(nn.swish(UpperCAmelCase_			)			)
              UpperCamelCase					 =		jnp.expand_dims(jnp.expand_dims(UpperCAmelCase_       ,      1			)       ,      1			)
              UpperCamelCase					 =		hidden_states + temb

              UpperCamelCase					 =		self.norma(UpperCAmelCase_			)
              UpperCamelCase					 =		nn.swish(UpperCAmelCase_			)
              UpperCamelCase					 =		self.dropout(UpperCAmelCase_       ,      UpperCAmelCase_			)
              UpperCamelCase					 =		self.conva(UpperCAmelCase_			)

              if self.conv_shortcut is not None:
                     UpperCamelCase					 =		self.conv_shortcut(UpperCAmelCase_			)

              return hidden_states + residual







"""simple docstring"""


def 	lowerCamelCase__			(							UpperCAmelCase_				)->							list:







       """simple docstring"""

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

       UpperCamelCase					 =		[]

       def generate(UpperCAmelCase_		,      UpperCAmelCase_				):
              if k == 1:
                     res.append(tuple(arr[:]				)				)
                     return

              generate(k - 1		,      UpperCAmelCase_				)

              for i in range(k - 1				):
                     if k % 2 == 0:  # k is even
                            UpperCamelCase ,       UpperCamelCase					 =		arr[k - 1], arr[i]
                     else:  # k is odd
                            UpperCamelCase ,       UpperCamelCase					 =		arr[k - 1], arr[0]
                     generate(k - 1		,      UpperCAmelCase_				)

       generate(len(UpperCAmelCase_				)		,      UpperCAmelCase_				)
       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))





