




def 					_a							(					lowerCAmelCase    ,						lowerCAmelCase )->	list:
		SCREAMING_SNAKE_CASE_					      =							word.split()

		def justify(lowerCAmelCase    ,						lowerCAmelCase    ,						lowerCAmelCase ) -> str:
				SCREAMING_SNAKE_CASE_					      =							max_width - width
				SCREAMING_SNAKE_CASE_					      =							len(lowerCAmelCase )
				if len(lowerCAmelCase ) == 1:
						# if there is only word in line
						# just insert overall_spaces_count for the remainder of line
						return line[0] + " " * overall_spaces_count
				else:
						SCREAMING_SNAKE_CASE_					      =							words_count - 1
						# num_spaces_between_words_list[i] : tells you to insert
						# num_spaces_between_words_list[i] spaces
						# after word on line[i]
						SCREAMING_SNAKE_CASE_					      =							spaces_to_insert_between_words * [
						    overall_spaces_count // spaces_to_insert_between_words
						]
						SCREAMING_SNAKE_CASE_					      =							(
						    overall_spaces_count % spaces_to_insert_between_words
						)
						# distribute spaces via round robin to the left words
						for i in range(lowerCAmelCase ):
								num_spaces_between_words_list[i] += 1
						SCREAMING_SNAKE_CASE_					      =							[]
						for i in range(lowerCAmelCase ):
								# add the word
								aligned_words_list.append(line[i] )
								# add the spaces to insert
								aligned_words_list.append(num_spaces_between_words_list[i] * ' ' )
						# just add the last word to the sentence
						aligned_words_list.append(line[-1] )
						# join the aligned words list to form a justified line
						return "".join(lowerCAmelCase )

		SCREAMING_SNAKE_CASE_					      =							[]
		SCREAMING_SNAKE_CASE_					      =							[]
		SCREAMING_SNAKE_CASE_					      =							0
		for word in words:
				if width + len(lowerCAmelCase ) + len(lowerCAmelCase ) <= max_width:
						# keep adding words until we can fill out max_width
						# width = sum of length of all words (without overall_spaces_count)
						# len(word) = length of current word
						# len(line) = number of overall_spaces_count to insert between words
						line.append(lowerCAmelCase )
						width += len(lowerCAmelCase )
				else:
						# justify the line and add it to result
						answer.append(justify(lowerCAmelCase    ,						lowerCAmelCase    ,						lowerCAmelCase ) )
						# reset new line and new width
						SCREAMING_SNAKE_CASE_      ,				SCREAMING_SNAKE_CASE_					      =							[word], len(lowerCAmelCase )
		SCREAMING_SNAKE_CASE_					      =							max_width - width - len(lowerCAmelCase )
		answer.append(' '.join(lowerCAmelCase ) + (remaining_spaces + 1) * ' ' )
		return answer


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

						testmod()





SCREAMING_SNAKE_CASE:     dict[tuple[int, int, int], int]									= {}


def 					_a							(					lowerCAmelCase    ,						lowerCAmelCase    ,						lowerCAmelCase )->	int:

		# if we are absent twice, or late 3 consecutive days,
		# no further prize strings are possible
		if late == 3 or absent == 2:
				return 0

		# if we have no days left, and have not failed any other rules,
		# we have a prize string
		if days == 0:
				return 1

		# No easy solution, so now we need to do the recursive calculation

		# First, check if the combination is already in the cache, and
		# if yes, return the stored value from there since we already
		# know the number of possible prize strings from this point on
		SCREAMING_SNAKE_CASE_					      =							(days, absent, late)
		if key in cache:
				return cache[key]

		# now we calculate the three possible ways that can unfold from
		# this point on, depending on our attendance today

		# 1) if we are late (but not absent), the "absent" counter stays as
		# it is, but the "late" counter increases by one
		SCREAMING_SNAKE_CASE_					      =							_calculate(days - 1    ,						lowerCAmelCase    ,						late + 1 )

		# 2) if we are absent, the "absent" counter increases by 1, and the
		# "late" counter resets to 0
		SCREAMING_SNAKE_CASE_					      =							_calculate(days - 1    ,						absent + 1    ,						0 )

		# 3) if we are on time, this resets the "late" counter and keeps the
		# absent counter
		SCREAMING_SNAKE_CASE_					      =							_calculate(days - 1    ,						lowerCAmelCase    ,						0 )

		SCREAMING_SNAKE_CASE_					      =							state_late + state_absent + state_ontime

		SCREAMING_SNAKE_CASE_					      =							prizestrings
		return prizestrings


def 					_a							(					lowerCAmelCase = 30 )->	int:
		return _calculate(lowerCAmelCase    ,						absent=0    ,						late=0 )


if __name__ == "__main__":
						print(solution())