
import random







def        A__					(						lowerCamelCase     ,    lowerCamelCase						)  ->	tuple:
				UpperCamelCase_:							Tuple	=						[], [], []
				for element in data:
								if element < pivot:
												less.append(lowerCamelCase						)
								elif element > pivot:
												greater.append(lowerCamelCase						)
								else:
												equal.append(lowerCamelCase						)
				return less, equal, greater







def        A__					(						lowerCamelCase     ,    lowerCamelCase						)  ->	Optional[int]:
				# index = len(items) // 2 when trying to find the median
				#   (value of index when items is sorted)

				# invalid input
				if index >= len(lowerCamelCase						) or index < 0:
								return None

				UpperCamelCase_:							List[Any]	=						items[random.randint(0     ,    len(lowerCamelCase						) - 1						)]
				UpperCamelCase_:							List[str]	=						0
				UpperCamelCase_:							List[Any]	=						_partition(lowerCamelCase     ,    lowerCamelCase						)
				UpperCamelCase_:							str	=						len(lowerCamelCase						)
				UpperCamelCase_:							int	=						len(lowerCamelCase						)

				# index is the pivot
				if m <= index < m + count:
								return pivot
				# must be in smaller
				elif m > index:
								return quick_select(lowerCamelCase     ,    lowerCamelCase						)
				# must be in larger
				else:
								return quick_select(lowerCamelCase     ,    index - (m + count)						)








def        A__					(						lowerCamelCase = 50						)  ->	int:
				UpperCamelCase_:							List[Any]	=						[[0] * 3 for _ in range(length + 1						)]

				for row_length in range(length + 1						):
								for tile_length in range(2     ,    5						):
												for tile_start in range(row_length - tile_length + 1						):
																different_colour_ways_number[row_length][tile_length - 2] += (
																    different_colour_ways_number[row_length - tile_start - tile_length][
																        tile_length - 2
																    ]
																    + 1
																)

				return sum(different_colour_ways_number[length]						)


if __name__ == "__main__":
							print(F"""{solution() = }""")






