





from __future__ import annotations



def 		A_				(     _lowerCAmelCase     )						-> list[int]:  # This function is recursive
 UpperCamelCase	:					Union[str, Any]       	=   len(_lowerCAmelCase     )
 # If the array contains only one element, we return it (it's the stop condition of
 # recursion)
 if array_length <= 1:
  return array
  # Else
 UpperCamelCase	:					Tuple       	=   array[0]
 UpperCamelCase	:					int       	=   False
 UpperCamelCase	:					int       	=   1
 UpperCamelCase	:					list[int]       	=   []
 while not is_found and i < array_length:
  if array[i] < pivot:
   UpperCamelCase	:					int       	=   True
   UpperCamelCase	:					Dict       	=   [element for element in array[i:] if element >= array[i]]
   UpperCamelCase	:					List[Any]       	=   longest_subsequence(_lowerCAmelCase     )
   if len(_lowerCAmelCase     ) > len(_lowerCAmelCase     ):
    UpperCamelCase	:					List[str]       	=   temp_array
  else:
   i += 1

 UpperCamelCase	:					Any       	=   [element for element in array[1:] if element >= pivot]
 UpperCamelCase	:					List[str]       	=   [pivot, *longest_subsequence(_lowerCAmelCase     )]
 if len(_lowerCAmelCase     ) > len(_lowerCAmelCase     ):
  return temp_array
 else:
  return longest_subseq


if __name__ == "__main__":
    import doctest

    doctest.testmod()







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() = }""")
