A__						:						Optional[int]          =      (1, 153, 370, 371, 1634, 2467_8051, 115_1322_1901_8763_9925_6509_5597_9739_7152_2401)
A__						:						tuple          =      (-153, -1, 0, 1.2, 200, "A", [], {}, None)


def     UpperCamelCase(						__UpperCamelCase							:	int				):
		if not isinstance(__UpperCamelCase  ,__UpperCamelCase				) or n < 1:
				return False

		# Initialization of sum and number of digits.
		lowerCAmelCase_    :  Optional[Any]             =				0
		lowerCAmelCase_    :  List[str]             =				0
		lowerCAmelCase_    :  Optional[Any]             =				n
		# Calculation of digits of the number
		while temp > 0:
				number_of_digits += 1
				temp //= 10
		# Dividing number into separate digits and find Armstrong number
		lowerCAmelCase_    :  str             =				n
		while temp > 0:
				lowerCAmelCase_    :  Optional[Any]             =				temp % 10
				total += rem**number_of_digits
				temp //= 10
		return n == total


def     UpperCamelCase(						__UpperCamelCase							:	int				):
		if not isinstance(__UpperCamelCase  ,__UpperCamelCase				) or n < 1:
				return False

		# Init a "histogram" of the digits
		lowerCAmelCase_    :  Optional[int]             =				[0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
		lowerCAmelCase_    :  Union[str, Any]             =				0
		lowerCAmelCase_    :  Tuple             =				0
		lowerCAmelCase_    :  Union[str, Any]             =				n
		while temp > 0:
				lowerCAmelCase_    :  Union[str, Any]             =				divmod(__UpperCamelCase  ,10				)
				digit_histogram[rem] += 1
				digit_total += 1

		for cnt, i in zip(__UpperCamelCase  ,range(len(__UpperCamelCase				)				)				):
				total += cnt * i**digit_total

		return n == total


def     UpperCamelCase(						__UpperCamelCase							:	int				):
		if not isinstance(__UpperCamelCase  ,__UpperCamelCase				) or n < 1:
				return False
		lowerCAmelCase_    :  List[str]             =				len(str(__UpperCamelCase				)				)  # the power that all digits will be raised to
		# check if sum of each digit multiplied expo times is equal to number
		return n == sum(int(__UpperCamelCase				) ** expo for i in str(__UpperCamelCase				)				)


def     UpperCamelCase(						):
		lowerCAmelCase_    :  Union[str, Any]             =				int(input('''Enter an integer to see if it is an Armstrong number: '''				).strip()				)
		print(f"""{num} is {"" if armstrong_number(__UpperCamelCase				) else "not "}an Armstrong number."""				)
		print(f"""{num} is {"" if narcissistic_number(__UpperCamelCase				) else "not "}an Armstrong number."""				)
		print(f"""{num} is {"" if pluperfect_number(__UpperCamelCase				) else "not "}an Armstrong number."""				)


if __name__ == "__main__":
						import doctest

						doctest.testmod()
						main()










from __future__ import annotations

from typing import Generic, TypeVar

A__						:						Dict          =      TypeVar('''T''')



class        __snake_case		(  Generic[T]		):




							def __init__( self  : List[Any]       ,       A_  : T):
									lowerCAmelCase_    :  Optional[Any]             =				data  # Assign data
									lowerCAmelCase_    :  Node[T] | None             =				None  # Initialize next as null
									lowerCAmelCase_    :  Node[T] | None             =				None  # Initialize prev as null





class        __snake_case		(  Generic[T]		):




							def __init__( self  : Union[str, Any]):
									lowerCAmelCase_    :  Node[T] | None             =				None




							def      UpperCAmelCase__    ( self  : List[str]       ,       A_  : T):
									if self.head is None:
											lowerCAmelCase_    :  List[Any]             =				Node(A_)
									else:
											lowerCAmelCase_    :  Tuple             =				Node(A_)
											lowerCAmelCase_    :  Optional[int]             =				new_node
											lowerCAmelCase_    :  Optional[int]             =				self.head
											lowerCAmelCase_    :  Optional[Any]             =				None
											lowerCAmelCase_    :  Dict             =				new_node




							def      UpperCAmelCase__    ( self  : List[str]):
									if self.head is None:
											return None
									else:
											assert self.head is not None
											lowerCAmelCase_    :  Tuple             =				self.head.data
											lowerCAmelCase_    :  Any             =				self.head.next
											if self.head is not None:
													lowerCAmelCase_    :  Optional[Any]             =				None
											return temp




							def      UpperCAmelCase__    ( self  : Union[str, Any]):
									return self.head.data if self.head is not None else None




							def __len__( self  : Dict):
									lowerCAmelCase_    :  List[str]             =				self.head
									lowerCAmelCase_    :  str             =				0
									while temp is not None:
											count += 1
											lowerCAmelCase_    :  Union[str, Any]             =				temp.next
									return count




							def      UpperCAmelCase__    ( self  : Dict):
									return self.head is None







							def      UpperCAmelCase__    ( self  : Dict):
									print('''stack elements are:''')
									lowerCAmelCase_    :  Optional[Any]             =				self.head
									while temp is not None:
											print(temp.data       ,       end='''->''')
											lowerCAmelCase_    :  List[str]             =				temp.next


# Code execution starts here
if __name__ == "__main__":
						# Start with the empty stack
						A__						:						Stack[int]          =      Stack()

						# Insert 4 at the beginning. So stack becomes 4->None
						print('''Stack operations using Doubly LinkedList''')
						stack.push(4)

						# Insert 5 at the beginning. So stack becomes 4->5->None
						stack.push(5)

						# Insert 6 at the beginning. So stack becomes 4->5->6->None
						stack.push(6)

						# Insert 7 at the beginning. So stack becomes 4->5->6->7->None
						stack.push(7)

						# Print the stack
						stack.print_stack()

						# Print the top element
						print('''\nTop element is ''', stack.top())

						# Print the stack size
						print('''Size of the stack is ''', len(stack))

						# pop the top element
						stack.pop()

						# pop the top element
						stack.pop()

						# two elements have now been popped off
						stack.print_stack()

						# Print True if the stack is empty else False
						print('''\nstack is empty:''', stack.is_empty())





