


"""simple docstring"""






from __future__ import annotations

import json

import requests
from bsa import BeautifulSoup
from fake_useragent import UserAgent

_lowerCamelCase     =  {'UserAgent': UserAgent().random}


def __lowercase     (      lowerCamelCase_  :      Dict  ):
				SCREAMING_SNAKE_CASE__     							=				script.contents[0]
				SCREAMING_SNAKE_CASE__     							=				json.loads(data[data.find("{\"config\""  ) : -1]  )
				return info["entry_data"]["ProfilePage"][0]["graphql"]["user"]


class 			lowerCamelCase_		:





				"""simple docstring"""







				def __init__(						self       ,		UpperCAmelCase__     ):
								SCREAMING_SNAKE_CASE__     							=				f'''https://www.instagram.com/{username}/'''
								SCREAMING_SNAKE_CASE__     							=				self.get_json()



				def   lowerCAmelCase__		(						self     ):
								SCREAMING_SNAKE_CASE__     							=				requests.get(self.url       ,		headers=UpperCAmelCase__     ).text
								SCREAMING_SNAKE_CASE__     							=				BeautifulSoup(UpperCAmelCase__       ,		"html.parser"     ).find_all("script"     )
								try:
												return extract_user_profile(scripts[4]     )
								except (json.decoder.JSONDecodeError, KeyError):
												return extract_user_profile(scripts[3]     )



				def __repr__(						self     ):
								return f'''{self.__class__.__name__}(\'{self.username}\')'''



				def __str__(						self     ):
								return f'''{self.fullname} ({self.username}) is {self.biography}'''



				@property
				def   lowerCAmelCase__		(						self     ):
								return self.user_data["username"]



				@property
				def   lowerCAmelCase__		(						self     ):
								return self.user_data["full_name"]



				@property
				def   lowerCAmelCase__		(						self     ):
								return self.user_data["biography"]



				@property
				def   lowerCAmelCase__		(						self     ):
								return self.user_data["business_email"]



				@property
				def   lowerCAmelCase__		(						self     ):
								return self.user_data["external_url"]



				@property
				def   lowerCAmelCase__		(						self     ):
								return self.user_data["edge_followed_by"]["count"]



				@property
				def   lowerCAmelCase__		(						self     ):
								return self.user_data["edge_follow"]["count"]



				@property
				def   lowerCAmelCase__		(						self     ):
								return self.user_data["edge_owner_to_timeline_media"]["count"]



				@property
				def   lowerCAmelCase__		(						self     ):
								return self.user_data["profile_pic_url_hd"]



				@property
				def   lowerCAmelCase__		(						self     ):
								return self.user_data["is_verified"]






				@property
				def   lowerCAmelCase__		(						self     ):
								return self.user_data["is_private"]


def __lowercase     (      lowerCamelCase_  :      str = "github"  ):
				import os

				if os.environ.get("CI"  ):
								return  # test failing on GitHub Actions
				SCREAMING_SNAKE_CASE__     							=				InstagramUser(lowerCamelCase_  )
				assert instagram_user.user_data
				assert isinstance(instagram_user.user_data						,					lowerCamelCase_  )
				assert instagram_user.username == username
				if username != "github":
								return
				assert instagram_user.fullname == "GitHub"
				assert instagram_user.biography == "Built for developers."
				assert instagram_user.number_of_posts > 150
				assert instagram_user.number_of_followers > 120000
				assert instagram_user.number_of_followings > 15
				assert instagram_user.email == "support@github.com"
				assert instagram_user.website == "https://github.com/readme"
				assert instagram_user.profile_picture_url.startswith("https://instagram."  )
				assert instagram_user.is_verified is True
				assert instagram_user.is_private is False


if __name__ == "__main__":
	import doctest

	doctest.testmod()
	_lowerCamelCase     =  InstagramUser('github')
	print(instagram_user)
	print(f"""{instagram_user.number_of_posts = }""")
	print(f"""{instagram_user.number_of_followers = }""")
	print(f"""{instagram_user.number_of_followings = }""")
	print(f"""{instagram_user.email = }""")
	print(f"""{instagram_user.website = }""")
	print(f"""{instagram_user.profile_picture_url = }""")
	print(f"""{instagram_user.is_verified = }""")
	print(f"""{instagram_user.is_private = }""")




"""simple docstring"""






from __future__ import annotations


def __lowercase     (      lowerCamelCase_  :      list						,					lowerCamelCase_  :      int						,					lowerCamelCase_  :      int						,					lowerCamelCase_  :      int  ):
				SCREAMING_SNAKE_CASE__     							=				[]
				SCREAMING_SNAKE_CASE__							,      SCREAMING_SNAKE_CASE__     							=				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  )  )
				SCREAMING_SNAKE_CASE__     							=				result + left + right
				return input_list


def __lowercase     (      lowerCamelCase_  :      list  ):
				if len(lowerCamelCase_  ) <= 1:
								return input_list
				SCREAMING_SNAKE_CASE__     							=				list(lowerCamelCase_  )

				# iteration for two-way merging
				SCREAMING_SNAKE_CASE__     							=				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_  ):
												SCREAMING_SNAKE_CASE__     							=				i
												SCREAMING_SNAKE_CASE__     							=				i + p - 1
												SCREAMING_SNAKE_CASE__     							=				(low + high + 1) // 2
												SCREAMING_SNAKE_CASE__     							=				merge(lowerCamelCase_						,					lowerCamelCase_						,					lowerCamelCase_						,					lowerCamelCase_  )
								# final merge of last two parts
								if p * 2 >= len(lowerCamelCase_  ):
												SCREAMING_SNAKE_CASE__     							=				i
												SCREAMING_SNAKE_CASE__     							=				merge(lowerCamelCase_						,					0						,					lowerCamelCase_						,					len(lowerCamelCase_  ) - 1  )
												break
								p *= 2

				return input_list


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