'''simple docstring'''




from collections import defaultdict





class     __magic_name__						:







			def __init__(	self				:  Optional[Any]				,			lowercase_				:  Dict				,			lowercase_				:  List[str]    ):
										lowercase_					:			Any										=       total  # total no of tasks (N)

										# DP table will have a dimension of (2^M)*N
										# initially all values are set to -1
										lowercase_					:			Union[str, Any]										=       [
										    [-1 for i in range(total + 1    )] for j in range(2 ** len(lowercase_    )    )
										]

										lowercase_					:			int										=       defaultdict(lowercase_    )  # stores the list of persons for each task

										# final_mask is used to check if all persons are included by setting all bits
										# to 1
										lowercase_					:			List[str]										=       (1 << len(lowercase_    )) - 1







			def 	SCREAMING_SNAKE_CASE_     (	self				:  str				,			lowercase_				:  Union[str, Any]				,			lowercase_				:  str    ):
										# if mask == self.finalmask all persons are distributed tasks, return 1
										if mask == self.final_mask:
																	return 1

										# if not everyone gets the task and no more tasks are available, return 0
										if task_no > self.total_tasks:
																	return 0

										# if case already considered
										if self.dp[mask][task_no] != -1:
																	return self.dp[mask][task_no]

										# Number of ways when we don't this task in the arrangement
										lowercase_					:			int										=       self.count_ways_until(lowercase_				,			task_no + 1    )

										# now assign the tasks one by one to all possible persons and recursively
										# assign for the remaining tasks.
										if task_no in self.task:
																	for p in self.task[task_no]:
																								# if p is already given a task
																								if mask & (1 << p):
																															continue

																								# assign this task to p and change the mask value. And recursively
																								# assign tasks with the new mask value.
																								total_ways_util += self.count_ways_until(mask | (1 << p)				,			task_no + 1    )

        # save the value.
										lowercase_					:			Tuple										=       total_ways_util

										return self.dp[mask][task_no]







			def 	SCREAMING_SNAKE_CASE_     (	self				:  List[Any]				,			lowercase_				:  Any    ):
										# Store the list of persons for each task
										for i in range(len(lowercase_    )    ):
																	for j in task_performed[i]:
																								self.task[j].append(lowercase_    )

        # call the function to fill the DP table, final answer is stored in dp[0][1]
										return self.count_ways_until(0				,			1    )


if __name__ == "__main__":
						_lowercase						: List[str]						=						5  # total no of tasks (the value of N)

						# the list of tasks that can be done by M persons.
						_lowercase						: Dict						=						[[1, 3, 4], [1, 2, 5], [3, 4]]
						print(
						    AssignmentUsingBitmask(task_performed, total_tasks).count_no_of_ways(
						        task_performed
						    )
						)






'''simple docstring'''




from collections import defaultdict




def 							lowerCamelCase	(      UpperCAmelCase__       :					str      ,      UpperCAmelCase__       :					str )			->      bool:
							lowercase_					:			Tuple										=       first_str.lower().strip()
							lowercase_					:			List[Any]										=       second_str.lower().strip()

							# Remove whitespace
							lowercase_					:			Dict										=       first_str.replace(""" """      ,      """""" )
							lowercase_					:			Tuple										=       second_str.replace(""" """      ,      """""" )

							# Strings of different lengths are not anagrams
							if len(UpperCAmelCase__ ) != len(UpperCAmelCase__ ):
														return False

							# Default values for count should be 0
							lowercase_					:			defaultdict[str, int]										=       defaultdict(UpperCAmelCase__ )

							# For each character in input strings,
							# increment count in the corresponding
							for i in range(len(UpperCAmelCase__ ) ):
														count[first_str[i]] += 1
														count[second_str[i]] -= 1

							return all(_count == 0 for _count in count.values() )


if __name__ == "__main__":
						from doctest import testmod

						testmod()
						_lowercase						: int						=						input("Enter the first string ").strip()
						_lowercase						: Tuple						=						input("Enter the second string ").strip()

						_lowercase						: Union[str, Any]						=						check_anagrams(input_a, input_b)
						print(f"""{input_a} and {input_b} are {"" if status else "not "}anagrams.""")





