


from __future__ import annotations






def 							__lowercase       (			__lowerCAmelCase							:    list ,   __lowerCAmelCase							:    int ,   __lowerCAmelCase							:    int ,   __lowerCAmelCase							:    int       ):
							a__					=					[]
							a__				, a__					=					input_list[low:mid], input_list[mid : high + 1]
							while left and right:
														result.append((left if left[0] <= right[0] else right).pop(0       )       )
							a__					=					result + left + right
							return input_list






def 							__lowercase       (			__lowerCAmelCase							:    list       ):
							if len(__lowerCAmelCase       ) <= 1:
														return input_list
							a__					=					list(__lowerCAmelCase       )

							# iteration for two-way merging
							a__					=					2
							while p <= len(__lowerCAmelCase       ):
														# getting low, high and middle value for merge-sort of single list
														for i in range(0 ,   len(__lowerCAmelCase       ) ,   __lowerCAmelCase       ):
																					a__					=					i
																					a__					=					i + p - 1
																					a__					=					(low + high + 1) // 2
																					a__					=					merge(__lowerCAmelCase ,   __lowerCAmelCase ,   __lowerCAmelCase ,   __lowerCAmelCase       )
														# final merge of last two parts
														if p * 2 >= len(__lowerCAmelCase       ):
																					a__					=					i
																					a__					=					merge(__lowerCAmelCase ,   0 ,   __lowerCAmelCase ,   len(__lowerCAmelCase       ) - 1       )
																					break
														p *= 2

							return input_list


if __name__ == "__main__":
						snake_case							:	List[Any]					      =				input('''Enter numbers separated by a comma:\n''').strip()
						if user_input == "":
												snake_case							:	int					      =				[]
						else:
												snake_case							:	int					      =				[int(item.strip()) for item in user_input.split(''',''')]
						print(iter_merge_sort(unsorted))








from __future__ import annotations







class 	snake_case_       :
					def __init__(				self       :List[str]      ,__snake_case       :int				) ->   None:
												a__					=					data
												a__					=					None
												a__					=					None






def 							__lowercase       (			__lowerCAmelCase							:    Node | None       ):  # In Order traversal of the tree
							if tree:
														display(tree.left       )
														print(tree.data       )
														display(tree.right       )






def 							__lowercase       (			__lowerCAmelCase							:    Node | None       ):
							return 1 + max(depth_of_tree(tree.left       ) ,   depth_of_tree(tree.right       )       ) if tree else 0






def 							__lowercase       (			__lowerCAmelCase							:    Node       ):
							if not tree:
														return True
							if tree.left and tree.right:
														return is_full_binary_tree(tree.left       ) and is_full_binary_tree(tree.right       )
							else:
														return not tree.left and not tree.right






def 							__lowercase       (			):  # Main function for testing.
							a__					=					Node(1       )
							a__					=					Node(2       )
							a__					=					Node(3       )
							a__					=					Node(4       )
							a__					=					Node(5       )
							a__					=					Node(6       )
							a__					=					Node(7       )
							a__					=					Node(8       )
							a__					=					Node(9       )

							print(is_full_binary_tree(__lowerCAmelCase       )       )
							print(depth_of_tree(__lowerCAmelCase       )       )
							print('Tree is: '       )
							display(__lowerCAmelCase       )


if __name__ == "__main__":
						main()




