


def 				UpperCamelCase_(      lowerCamelCase_ )    ->						bool:
    _lowercase       :							str      		=		(1 + 24 * n) ** 0.5
    return ((1 + root) / 6) % 1 == 0



def 				UpperCamelCase_(      lowerCamelCase_ = 5000 )    ->						int:
    _lowercase       :							Optional[Any]      		=		[(i * (3 * i - 1)) // 2 for i in range(1							, lowerCamelCase_ )]
    for i, pentagonal_i in enumerate(lowerCamelCase_ ):
        for j in range(lowerCamelCase_							, len(lowerCamelCase_ ) ):
            _lowercase       :							List[Any]      		=		pentagonal_nums[j]
            _lowercase       :							Optional[int]      		=		pentagonal_i + pentagonal_j
            _lowercase       :							str      		=		pentagonal_j - pentagonal_i
            if is_pentagonal(lowerCamelCase_ ) and is_pentagonal(lowerCamelCase_ ):
                return b

    return -1


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






from __future__ import annotations

from fractions import Fraction
from math import gcd, sqrt



def 				UpperCamelCase_(      lowerCamelCase_ )    ->						bool:
    _lowercase       :							int      		=		int(number**0.5 )
    return number == sq * sq



def 				UpperCamelCase_(      lowerCamelCase_							, lowerCamelCase_							, lowerCamelCase_							, lowerCamelCase_							, lowerCamelCase_							, lowerCamelCase_ )    ->						tuple[int, int]:
    _lowercase       :							int      		=		x_num * y_den * z_den + y_num * x_den * z_den + z_num * x_den * y_den
    _lowercase       :							int      		=		x_den * y_den * z_den
    _lowercase       :							int      		=		gcd(lowerCamelCase_							, lowerCamelCase_ )
    top //= hcf
    bottom //= hcf
    return top, bottom



def 				UpperCamelCase_(      lowerCamelCase_ = 35 )    ->						int:
    _lowercase       :							set      		=		set()
    _lowercase       :							int
    _lowercase       :							Fraction      		=		Fraction(0 )
    _lowercase       :							tuple[int, int]

    for x_num in range(1							, order + 1 ):
        for x_den in range(x_num + 1							, order + 1 ):
            for y_num in range(1							, order + 1 ):
                for y_den in range(y_num + 1							, order + 1 ):
                    # n=1
                    _lowercase       :							int      		=		x_num * y_den + x_den * y_num
                    _lowercase       :							int      		=		x_den * y_den
                    _lowercase       :							str      		=		gcd(lowerCamelCase_							, lowerCamelCase_ )
                    z_num //= hcf
                    z_den //= hcf
                    if 0 < z_num < z_den <= order:
                        _lowercase       :							List[Any]      		=		add_three(
                            lowerCamelCase_							, lowerCamelCase_							, lowerCamelCase_							, lowerCamelCase_							, lowerCamelCase_							, lowerCamelCase_ )
                        unique_s.add(lowerCamelCase_ )

                    # n=2
                    _lowercase       :							Dict      		=		(
                        x_num * x_num * y_den * y_den + x_den * x_den * y_num * y_num
                    )
                    _lowercase       :							List[Any]      		=		x_den * x_den * y_den * y_den
                    if is_sq(lowerCamelCase_ ) and is_sq(lowerCamelCase_ ):
                        _lowercase       :							Tuple      		=		int(sqrt(lowerCamelCase_ ) )
                        _lowercase       :							int      		=		int(sqrt(lowerCamelCase_ ) )
                        _lowercase       :							Any      		=		gcd(lowerCamelCase_							, lowerCamelCase_ )
                        z_num //= hcf
                        z_den //= hcf
                        if 0 < z_num < z_den <= order:
                            _lowercase       :							Optional[int]      		=		add_three(
                                lowerCamelCase_							, lowerCamelCase_							, lowerCamelCase_							, lowerCamelCase_							, lowerCamelCase_							, lowerCamelCase_ )
                            unique_s.add(lowerCamelCase_ )

                    # n=-1
                    _lowercase       :							Any      		=		x_num * y_num
                    _lowercase       :							str      		=		x_den * y_num + x_num * y_den
                    _lowercase       :							Any      		=		gcd(lowerCamelCase_							, lowerCamelCase_ )
                    z_num //= hcf
                    z_den //= hcf
                    if 0 < z_num < z_den <= order:
                        _lowercase       :							int      		=		add_three(
                            lowerCamelCase_							, lowerCamelCase_							, lowerCamelCase_							, lowerCamelCase_							, lowerCamelCase_							, lowerCamelCase_ )
                        unique_s.add(lowerCamelCase_ )

                    # n=2
                    _lowercase       :							str      		=		x_num * x_num * y_num * y_num
                    _lowercase       :							Optional[Any]      		=		(
                        x_den * x_den * y_num * y_num + x_num * x_num * y_den * y_den
                    )
                    if is_sq(lowerCamelCase_ ) and is_sq(lowerCamelCase_ ):
                        _lowercase       :							Tuple      		=		int(sqrt(lowerCamelCase_ ) )
                        _lowercase       :							List[str]      		=		int(sqrt(lowerCamelCase_ ) )
                        _lowercase       :							Union[str, Any]      		=		gcd(lowerCamelCase_							, lowerCamelCase_ )
                        z_num //= hcf
                        z_den //= hcf
                        if 0 < z_num < z_den <= order:
                            _lowercase       :							Tuple      		=		add_three(
                                lowerCamelCase_							, lowerCamelCase_							, lowerCamelCase_							, lowerCamelCase_							, lowerCamelCase_							, lowerCamelCase_ )
                            unique_s.add(lowerCamelCase_ )

    for num, den in unique_s:
        total += Fraction(lowerCamelCase_							, lowerCamelCase_ )

    return total.denominator + total.numerator


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


