





"""simple docstring"""





def 					__A  (_SCREAMING_SNAKE_CASE	,  _SCREAMING_SNAKE_CASE     )   ->List[str]:





  """simple docstring"""


  _enforce_args(_SCREAMING_SNAKE_CASE	,  _SCREAMING_SNAKE_CASE     )
  if n == 0:
    return 0
  lowerCAmelCase__     :Union[str, Any]											=				float('-inf'     )
  for i in range(1	,  n + 1     ):
    lowerCAmelCase__     :Optional[Any]											=				max(
        _SCREAMING_SNAKE_CASE	,  prices[i - 1] + naive_cut_rod_recursive(n - i	,  _SCREAMING_SNAKE_CASE     )     )

  return max_revue
def 					__A  (_SCREAMING_SNAKE_CASE	,  _SCREAMING_SNAKE_CASE     )   ->Optional[Any]:





  """simple docstring"""


  _enforce_args(_SCREAMING_SNAKE_CASE	,  _SCREAMING_SNAKE_CASE     )
  lowerCAmelCase__     :int											=				[float('-inf'     ) for _ in range(n + 1     )]
  return _top_down_cut_rod_recursive(_SCREAMING_SNAKE_CASE	,  _SCREAMING_SNAKE_CASE	,  _SCREAMING_SNAKE_CASE     )
def 					__A  (_SCREAMING_SNAKE_CASE	,  _SCREAMING_SNAKE_CASE	,  _SCREAMING_SNAKE_CASE     )   ->Optional[int]:





  """simple docstring"""


  if max_rev[n] >= 0:
    return max_rev[n]
  elif n == 0:
    return 0
  else:
    lowerCAmelCase__     :int											=				float('-inf'     )
    for i in range(1	,  n + 1     ):
      lowerCAmelCase__     :int											=				max(
          _SCREAMING_SNAKE_CASE	,  prices[i - 1] + _top_down_cut_rod_recursive(n - i	,  _SCREAMING_SNAKE_CASE	,  _SCREAMING_SNAKE_CASE     )	,  )

    lowerCAmelCase__     :int											=				max_revenue

  return max_rev[n]
def 					__A  (_SCREAMING_SNAKE_CASE	,  _SCREAMING_SNAKE_CASE     )   ->Optional[int]:





  """simple docstring"""


  _enforce_args(_SCREAMING_SNAKE_CASE	,  _SCREAMING_SNAKE_CASE     )

  # length(max_rev) = n + 1, to accommodate for the revenue obtainable from a rod of
  # length 0.
  lowerCAmelCase__     :Any											=				[float('-inf'     ) for _ in range(n + 1     )]
  lowerCAmelCase__     :Tuple											=				0

  for i in range(1	,  n + 1     ):
    lowerCAmelCase__     :Any											=				max_rev[i]
    for j in range(1	,  i + 1     ):
      lowerCAmelCase__     :Tuple											=				max(_SCREAMING_SNAKE_CASE	,  prices[j - 1] + max_rev[i - j]     )

    lowerCAmelCase__     :Union[str, Any]											=				max_revenue_i

  return max_rev[n]
def 					__A  (_SCREAMING_SNAKE_CASE	,  _SCREAMING_SNAKE_CASE     )   ->Optional[int]:





  """simple docstring"""


  if n < 0:
    lowerCAmelCase__     :Union[str, Any]											=				F"n must be greater than or equal to 0. Got n = {n}"
    raise ValueError(_SCREAMING_SNAKE_CASE     )

  if n > len(_SCREAMING_SNAKE_CASE     ):
    lowerCAmelCase__     :str											=				(
        'Each integral piece of rod must have a corresponding price. '
        F"Got n = {n} but length of prices = {len(_SCREAMING_SNAKE_CASE     )}"
    )
    raise ValueError(_SCREAMING_SNAKE_CASE     )
def 					__A  ()   ->int:





  """simple docstring"""


  lowerCAmelCase__     :Optional[int]											=				[6, 10, 12, 15, 20, 23]
  lowerCAmelCase__     :Optional[int]											=				len(_SCREAMING_SNAKE_CASE     )

  # the best revenue comes from cutting the rod into 6 pieces, each
  # of length 1 resulting in a revenue of 6 * 6 = 36.
  lowerCAmelCase__     :Union[str, Any]											=				36

  lowerCAmelCase__     :str											=				top_down_cut_rod(_SCREAMING_SNAKE_CASE	,  _SCREAMING_SNAKE_CASE     )
  lowerCAmelCase__     :Tuple											=				bottom_up_cut_rod(_SCREAMING_SNAKE_CASE	,  _SCREAMING_SNAKE_CASE     )
  lowerCAmelCase__     :List[str]											=				naive_cut_rod_recursive(_SCREAMING_SNAKE_CASE	,  _SCREAMING_SNAKE_CASE     )

  assert expected_max_revenue == max_rev_top_down
  assert max_rev_top_down == max_rev_bottom_up
  assert max_rev_bottom_up == max_rev_naive


if __name__ == "__main__":
  main()




'''simple docstring'''

def _SCREAMING_SNAKE_CASE (A			)			->			bool:






       """simple docstring"""







       lowercase__      =					[int(A			) for i in ip_va_address.split('''.'''			) if i.isdigit()]
       return len(A			) == 4 and all(0 <= int(A			) <= 254 for octet in octets			)


if __name__ == "__main__":
 lowerCamelCase				:  Optional[Any]    		=      input().strip()
 lowerCamelCase				:  Union[str, Any]    		=      'valid' if is_ip_va_address_valid(ip) else 'invalid'
 print(f"""{ip} is a {valid_or_invalid} IP v4 address.""")




