





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




class 			__UpperCamelCase    (							nn.Module    ):
     __A	:  int
     __A	:  jnp.dtype							  =   jnp.floataa





     def 		UpperCamelCase(     self					):
        _UpperCAmelCase           =   nn.Conv(
            self.out_channels				,							kernel_size=(3, 3)				,							strides=(1, 1)				,							padding=((1, 1), (1, 1))				,							dtype=self.dtype				,							)





     def __call__(     self				,							_UpperCamelCase					):
        _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 			__UpperCamelCase    (							nn.Module    ):
     __A	:  int
     __A	:  jnp.dtype							  =   jnp.floataa





     def 		UpperCamelCase(     self					):
        _UpperCAmelCase           =   nn.Conv(
            self.out_channels				,							kernel_size=(3, 3)				,							strides=(2, 2)				,							padding=((1, 1), (1, 1))				,							dtype=self.dtype				,							)





     def __call__(     self				,							_UpperCamelCase					):
        # 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 			__UpperCamelCase    (							nn.Module    ):
     __A	:  int
     __A	:  int							  =   None
     __A	:  float							  =   0.0
     __A	:  bool							  =   None
     __A	:  jnp.dtype							  =   jnp.floataa





     def 		UpperCamelCase(     self					):
        _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				,							_UpperCamelCase				,							_UpperCamelCase				,							_UpperCamelCase=True					):
        _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






from __future__ import annotations
def      A__       (    SCREAMING_SNAKE_CASE_   :      int						)  ->  bool:






   """simple docstring"""







   _UpperCAmelCase           =   str(SCREAMING_SNAKE_CASE_						)
   return len(SCREAMING_SNAKE_CASE_						) == 9 and set(SCREAMING_SNAKE_CASE_						) == set('''123456789'''						)
def      A__       (    )  ->  int | None:






   """simple docstring"""







   for base_num in range(99_99				,	49_99				,	-1						):
      _UpperCAmelCase           =   10_00_02 * base_num
      if is_9_pandigital(SCREAMING_SNAKE_CASE_						):
         return candidate

   for base_num in range(3_33				,	99				,	-1						):
      _UpperCAmelCase           =   1_00_20_03 * base_num
      if is_9_pandigital(SCREAMING_SNAKE_CASE_						):
         return candidate

   return None


if __name__ == "__main__":
   print(f'''{solution() = }''')