

'''simple docstring'''



def      a__ (						a__		):




     """simple docstring"""


     if len(a__		) == 1:
          return a[0], a[0]
     else:
          # split A into half.
          __SCREAMING_SNAKE_CASE						     =   a[: len(a__		) // 2]
          __SCREAMING_SNAKE_CASE						     =   a[len(a__		) // 2 :]

          # 2 sub problems, 1/2 of original size.
          __SCREAMING_SNAKE_CASE     ,    __SCREAMING_SNAKE_CASE						     =   max_difference(a__		)
          __SCREAMING_SNAKE_CASE     ,    __SCREAMING_SNAKE_CASE						     =   max_difference(a__		)

          # get min of first and max of second
          # linear time
          __SCREAMING_SNAKE_CASE						     =   min(a__		)
          __SCREAMING_SNAKE_CASE						     =   max(a__		)

          # 3 cases, either (small1, big1),
          # (min_first, max_second), (small2, big2)
          # constant comparisons
          if biga - smalla > max_second - min_first and biga - smalla > biga - smalla:
               return smalla, biga
          elif biga - smalla > max_second - min_first:
               return smalla, biga
          else:
               return min_first, max_second


if __name__ == "__main__":
  import doctest

  doctest.testmod()









'''simple docstring'''



def      a__ (						):




     """simple docstring"""


     __SCREAMING_SNAKE_CASE						     =   1

     while True:
          if (
              sorted(str(a__		)		)
              == sorted(str(2 * i		)		)
              == sorted(str(3 * i		)		)
              == sorted(str(4 * i		)		)
              == sorted(str(5 * i		)		)
              == sorted(str(6 * i		)		)
          ):
               return i

          i += 1


if __name__ == "__main__":
  print(solution())






