




import logging

# standard libraries
import sys

import numpy as np
import pytest  # type: ignore

# Custom/local libraries
from matrix import matrix_operation as matop

__A						:		Dict          =						[[12, 10], [3, 9]]
__A						:		str          =						[[3, 4], [7, 4]]
__A						:		Optional[int]          =						[[3, 0, 2], [2, 0, -2], [0, 1, 1]]
__A						:		str          =						[[3, 0, -2], [2, 0, 2], [0, 1, 1]]
__A						:		Tuple          =						[[3, 0, 2], [2, 0, -2], [0, 1, 1], [2, 0, -2]]
__A						:		Tuple          =						[1]
__A						:		str          =						[2]

__A						:		int          =						logging.getLogger()
__A						:		str          =						logging.DEBUG
__A						:		Union[str, Any]          =						logging.StreamHandler(sys.stdout)
logger.addHandler(stream_handler)





@pytest.mark.mat_ops
@pytest.mark.parametrize(
    ("""mat1""", """mat2""")						,			[(mat_a, mat_b), (mat_c, mat_d), (mat_d, mat_e), (mat_f, mat_h)]   )
def      UpperCAmelCase  (						UpperCamelCase__						,			UpperCamelCase__   )     ->     str:







				'''simple docstring'''


				if (np.array(UpperCamelCase__   )).shape < (2, 2) or (np.array(UpperCamelCase__   )).shape < (2, 2):
								with pytest.raises(UpperCamelCase__   ):
												logger.info(F'''\n\t{test_addition.__name__} returned integer'''   )
												matop.add(UpperCamelCase__						,			UpperCamelCase__   )
				elif (np.array(UpperCamelCase__   )).shape == (np.array(UpperCamelCase__   )).shape:
								logger.info(F'''\n\t{test_addition.__name__} with same matrix dims'''   )
								__lowerCAmelCase					=  (np.array(UpperCamelCase__   ) + np.array(UpperCamelCase__   )).tolist()
								__lowerCAmelCase					=  matop.add(UpperCamelCase__						,			UpperCamelCase__   )
								assert theo == act
				else:
								with pytest.raises(UpperCamelCase__   ):
												logger.info(F'''\n\t{test_addition.__name__} with different matrix dims'''   )
												matop.add(UpperCamelCase__						,			UpperCamelCase__   )





@pytest.mark.mat_ops
@pytest.mark.parametrize(
    ("""mat1""", """mat2""")						,			[(mat_a, mat_b), (mat_c, mat_d), (mat_d, mat_e), (mat_f, mat_h)]   )
def      UpperCAmelCase  (						UpperCamelCase__						,			UpperCamelCase__   )     ->     List[str]:







				'''simple docstring'''


				if (np.array(UpperCamelCase__   )).shape < (2, 2) or (np.array(UpperCamelCase__   )).shape < (2, 2):
								with pytest.raises(UpperCamelCase__   ):
												logger.info(F'''\n\t{test_subtraction.__name__} returned integer'''   )
												matop.subtract(UpperCamelCase__						,			UpperCamelCase__   )
				elif (np.array(UpperCamelCase__   )).shape == (np.array(UpperCamelCase__   )).shape:
								logger.info(F'''\n\t{test_subtraction.__name__} with same matrix dims'''   )
								__lowerCAmelCase					=  (np.array(UpperCamelCase__   ) - np.array(UpperCamelCase__   )).tolist()
								__lowerCAmelCase					=  matop.subtract(UpperCamelCase__						,			UpperCamelCase__   )
								assert theo == act
				else:
								with pytest.raises(UpperCamelCase__   ):
												logger.info(F'''\n\t{test_subtraction.__name__} with different matrix dims'''   )
												assert matop.subtract(UpperCamelCase__						,			UpperCamelCase__   )





@pytest.mark.mat_ops
@pytest.mark.parametrize(
    ("""mat1""", """mat2""")						,			[(mat_a, mat_b), (mat_c, mat_d), (mat_d, mat_e), (mat_f, mat_h)]   )
def      UpperCAmelCase  (						UpperCamelCase__						,			UpperCamelCase__   )     ->     List[Any]:







				'''simple docstring'''


				if (np.array(UpperCamelCase__   )).shape < (2, 2) or (np.array(UpperCamelCase__   )).shape < (2, 2):
								logger.info(F'''\n\t{test_multiplication.__name__} returned integer'''   )
								with pytest.raises(UpperCamelCase__   ):
												matop.add(UpperCamelCase__						,			UpperCamelCase__   )
				elif (np.array(UpperCamelCase__   )).shape == (np.array(UpperCamelCase__   )).shape:
								logger.info(F'''\n\t{test_multiplication.__name__} meets dim requirements'''   )
								__lowerCAmelCase					=  (np.matmul(UpperCamelCase__						,			UpperCamelCase__   )).tolist()
								__lowerCAmelCase					=  matop.multiply(UpperCamelCase__						,			UpperCamelCase__   )
								assert theo == act
				else:
								with pytest.raises(UpperCamelCase__   ):
												logger.info(
												    F'''\n\t{test_multiplication.__name__} does not meet dim requirements'''   )
												assert matop.subtract(UpperCamelCase__						,			UpperCamelCase__   )





@pytest.mark.mat_ops
def      UpperCAmelCase  (						)     ->     Dict:







				'''simple docstring'''


				__lowerCAmelCase					=  (3.5 * np.array(UpperCamelCase__   )).tolist()
				__lowerCAmelCase					=  matop.scalar_multiply(UpperCamelCase__						,			3.5   )
				assert theo == act





@pytest.mark.mat_ops
def      UpperCAmelCase  (						)     ->     Union[str, Any]:







				'''simple docstring'''


				__lowerCAmelCase					=  (np.identity(5   )).tolist()
				__lowerCAmelCase					=  matop.identity(5   )
				assert theo == act





@pytest.mark.mat_ops
@pytest.mark.parametrize("""mat"""						,			[mat_a, mat_b, mat_c, mat_d, mat_e, mat_f]   )
def      UpperCAmelCase  (						UpperCamelCase__   )     ->     Any:







				'''simple docstring'''


				if (np.array(UpperCamelCase__   )).shape < (2, 2):
								with pytest.raises(UpperCamelCase__   ):
												logger.info(F'''\n\t{test_transpose.__name__} returned integer'''   )
												matop.transpose(UpperCamelCase__   )
				else:
								__lowerCAmelCase					=  (np.transpose(UpperCamelCase__   )).tolist()
								__lowerCAmelCase					=  matop.transpose(UpperCamelCase__						,			return_map=UpperCamelCase__   )
								assert theo == act













"""simple docstring"""

from __future__ import annotations

lowercase           =							{1: 1}






def _lowerCAmelCase						(	__lowerCamelCase:int ):

						'''simple docstring'''






						if n in COLLATZ_SEQUENCE_LENGTHS:
												return COLLATZ_SEQUENCE_LENGTHS[n]
						__magic_name__      =  n // 2 if n % 2 == 0 else 3 * n + 1
						__magic_name__      =  collatz_sequence_length(__lowerCamelCase ) + 1
						__magic_name__      =  sequence_length
						return sequence_length






def _lowerCAmelCase						(	__lowerCamelCase:int = 1_0_0_0_0_0_0 ):

						'''simple docstring'''






						__magic_name__      =  max((collatz_sequence_length(__lowerCamelCase ), i) for i in range(1			,    __lowerCamelCase ) )
						return result[1]


if __name__ == "__main__":
			print(solution(int(input().strip())))



