




from __future__ import annotations

from collections.abc import Iterable

class      UpperCAmelCase						:






   def __init__(	self   :       int						,					UpperCamelCase_   :       Optional[int]						,					UpperCamelCase_   :       Optional[Any]     )->			Union[str, Any]:
     _lowercase     ,					_lowercase: List[Any]						     =    float(UpperCamelCase_     ), float(UpperCamelCase_     )






   def __eq__(	self   :       List[str]						,					UpperCamelCase_   :       str     )->			Tuple:
     return self.x == other.x and self.y == other.y






   def __ne__(	self   :       Optional[Any]						,					UpperCamelCase_   :       Union[str, Any]     )->			List[Any]:
     return not self == other






   def __gt__(	self   :       Dict						,					UpperCamelCase_   :       Union[str, Any]     )->			Dict:
     if self.x > other.x:
       return True
     elif self.x == other.x:
       return self.y > other.y
     return False






   def __lt__(	self   :       int						,					UpperCamelCase_   :       List[str]     )->			List[str]:
     return not self > other






   def __ge__(	self   :       Optional[int]						,					UpperCamelCase_   :       Dict     )->			Any:
     if self.x > other.x:
       return True
     elif self.x == other.x:
       return self.y >= other.y
     return False






   def __le__(	self   :       Union[str, Any]						,					UpperCamelCase_   :       List[str]     )->			List[Any]:
     if self.x < other.x:
       return True
     elif self.x == other.x:
       return self.y <= other.y
     return False






   def __repr__(	self   :       List[str]     )->			str:
     return f'({self.x}, {self.y})'






   def __hash__(	self   :       Optional[Any]     )->			Dict:
     return hash(self.x     )


def 		_lowerCamelCase				(					UpperCamelCase					,     )			->		list[Point]:





  """simple docstring"""





  _lowercase: list[Point]						     =    []
  if list_of_tuples:
    for p in list_of_tuples:
      if isinstance(UpperCamelCase					,     UpperCamelCase							):
        points.append(UpperCamelCase							)
      else:
        try:
          points.append(Point(p[0]					,     p[1]							)							)
        except (IndexError, TypeError):
          print(
              F'Ignoring deformed point {p}. All points'
              ' must have at least 2 coordinates.'							)
  return points


def 		_lowerCamelCase				(					UpperCamelCase							)			->		list[Point]:





  """simple docstring"""





  if not hasattr(UpperCamelCase					,     '__iter__'							):
    _lowercase: Union[str, Any]						     =    F'Expecting an iterable object but got an non-iterable type {points}'
    raise ValueError(UpperCamelCase							)

  if not points:
    _lowercase: str						     =    F'Expecting a list of points but got {points}'
    raise ValueError(UpperCamelCase							)

  return _construct_points(UpperCamelCase							)


def 		_lowerCamelCase				(					UpperCamelCase					,     UpperCamelCase					,     UpperCamelCase							)			->		float:





  """simple docstring"""





  _lowercase: List[str]						     =    (a.x * b.y + b.x * c.y + c.x * a.y) - (a.y * b.x + b.y * c.x + c.y * a.x)
  return det


def 		_lowerCamelCase				(					UpperCamelCase							)			->		list[Point]:





  """simple docstring"""





  _lowercase: Dict						     =    sorted(_validate_input(UpperCamelCase							)							)
  _lowercase: Tuple						     =    len(UpperCamelCase							)
  _lowercase: Tuple						     =    set()

  for i in range(n - 1							):
    for j in range(i + 1					,     UpperCamelCase							):
      _lowercase: List[str]						     =    False
      _lowercase: Any						     =    True
      for k in range(UpperCamelCase							):
        if k != i and k != j:
          _lowercase: List[Any]						     =    _det(points[i]					,     points[j]					,     points[k]							)

          if det_k > 0:
            _lowercase: str						     =    True
          elif det_k < 0:
            _lowercase: List[Any]						     =    True
          else:
            # point[i], point[j], point[k] all lie on a straight line
            # if point[k] is to the left of point[i] or it's to the
            # right of point[j], then point[i], point[j] cannot be
            # part of the convex hull of A
            if points[k] < points[i] or points[k] > points[j]:
              _lowercase: Optional[int]						     =    False
              break

        if points_left_of_ij and points_right_of_ij:
          _lowercase: int						     =    False
          break

      if ij_part_of_convex_hull:
        convex_set.update([points[i], points[j]]							)

  return sorted(UpperCamelCase							)


def 		_lowerCamelCase				(					UpperCamelCase							)			->		list[Point]:





  """simple docstring"""





  _lowercase: List[Any]						     =    sorted(_validate_input(UpperCamelCase							)							)
  _lowercase: List[Any]						     =    len(UpperCamelCase							)

  # divide all the points into an upper hull and a lower hull
  # the left most point and the right most point are definitely
  # members of the convex hull by definition.
  # use these two anchors to divide all the points into two hulls,
  # an upper hull and a lower hull.

  # all points to the left (above) the line joining the extreme points belong to the
  # upper hull
  # all points to the right (below) the line joining the extreme points below to the
  # lower hull
  # ignore all points on the line joining the extreme points since they cannot be
  # part of the convex hull

  _lowercase: Optional[Any]						     =    points[0]
  _lowercase: Union[str, Any]						     =    points[n - 1]

  _lowercase: Union[str, Any]						     =    {left_most_point, right_most_point}
  _lowercase: int						     =    []
  _lowercase: str						     =    []

  for i in range(1					,     n - 1							):
    _lowercase: str						     =    _det(UpperCamelCase					,     UpperCamelCase					,     points[i]							)

    if det > 0:
      upper_hull.append(points[i]							)
    elif det < 0:
      lower_hull.append(points[i]							)

  _construct_hull(UpperCamelCase					,     UpperCamelCase					,     UpperCamelCase					,     UpperCamelCase							)
  _construct_hull(UpperCamelCase					,     UpperCamelCase					,     UpperCamelCase					,     UpperCamelCase							)

  return sorted(UpperCamelCase							)


def 		_lowerCamelCase				(					UpperCamelCase					,     UpperCamelCase					,     UpperCamelCase					,     UpperCamelCase							)			->		None:





  """simple docstring"""





  if points:
    _lowercase: List[Any]						     =    None
    _lowercase: Any						     =    float('-inf'							)
    _lowercase: int						     =    []

    for p in points:
      _lowercase: str						     =    _det(UpperCamelCase					,     UpperCamelCase					,     UpperCamelCase							)

      if det > 0:
        candidate_points.append(UpperCamelCase							)

        if det > extreme_point_distance:
          _lowercase: Optional[Any]						     =    det
          _lowercase: Dict						     =    p

    if extreme_point:
      _construct_hull(UpperCamelCase					,     UpperCamelCase					,     UpperCamelCase					,     UpperCamelCase							)
      convex_set.add(UpperCamelCase							)
      _construct_hull(UpperCamelCase					,     UpperCamelCase					,     UpperCamelCase					,     UpperCamelCase							)


def 		_lowerCamelCase				(					UpperCamelCase							)			->		list[Point]:





  """simple docstring"""





  _lowercase: Tuple						     =    sorted(_validate_input(UpperCamelCase							)							)
  _lowercase: Tuple						     =    len(UpperCamelCase							)

  _lowercase: Dict						     =    points[:2]
  for i in range(2					,     UpperCamelCase							):
    _lowercase: int						     =    _det(convex_hull[1]					,     convex_hull[0]					,     points[i]							)
    if det > 0:
      convex_hull.insert(0					,     points[i]							)
      break
    elif det < 0:
      convex_hull.append(points[i]							)
      break
    else:
      _lowercase: Any						     =    points[i]
  i += 1

  for j in range(UpperCamelCase					,     UpperCamelCase							):
    if (
        _det(convex_hull[0]					,     convex_hull[-1]					,     points[j]							) > 0
        and _det(convex_hull[-1]					,     convex_hull[0]					,     points[1]							) < 0
    ):
      # The point lies within the convex hull
      continue

    convex_hull.insert(0					,     points[j]							)
    convex_hull.append(points[j]							)
    while _det(convex_hull[0]					,     convex_hull[1]					,     convex_hull[2]							) >= 0:
      del convex_hull[1]
    while _det(convex_hull[-1]					,     convex_hull[-2]					,     convex_hull[-3]							) <= 0:
      del convex_hull[-2]

    # `convex_hull` is contains the convex hull in circular order
  return sorted(convex_hull[1:] if len(UpperCamelCase							) > 3 else convex_hull							)


def 		_lowerCamelCase				(					)			->		Dict:





  """simple docstring"""





  _lowercase: List[str]						     =    [
      (0, 3),
      (2, 2),
      (1, 1),
      (2, 1),
      (3, 0),
      (0, 0),
      (3, 3),
      (2, -1),
      (2, -4),
      (1, -3),
  ]
  # the convex set of points is
  # [(0, 0), (0, 3), (1, -3), (2, -4), (3, 0), (3, 3)]
  _lowercase: Optional[Any]						     =    convex_hull_bf(UpperCamelCase							)

  _lowercase: Optional[Any]						     =    convex_hull_recursive(UpperCamelCase							)
  assert results_bf == results_recursive

  _lowercase: Tuple						     =    convex_hull_melkman(UpperCamelCase							)
  assert results_bf == results_melkman

  print(UpperCamelCase							)


if __name__ == "__main__":
   main()






import math


def 		_lowerCamelCase				(					UpperCamelCase							)			->		int:





  """simple docstring"""





  return sum(int(UpperCamelCase							) for digit in str(UpperCamelCase							)							)


def 		_lowerCamelCase				(					UpperCamelCase = 30							)			->		int:





  """simple docstring"""





  _lowercase: int						     =    []
  for digit in range(2					,     100							):
    for power in range(2					,     100							):
      _lowercase: int						     =    int(math.pow(UpperCamelCase					,     UpperCamelCase							)							)
      if digit == digit_sum(UpperCamelCase							):
        digit_to_powers.append(UpperCamelCase							)

  digit_to_powers.sort()
  return digit_to_powers[n - 1]


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