




class        __snake_case  :



				def __init__(      self      :		Union[str, Any]      )  ->    Tuple:





								'''simple docstring'''




								_lowerCAmelCase    :    Union[str, Any]										=      0
								_lowerCAmelCase    :    Tuple										=      0
								_lowerCAmelCase    :    Any										=      {}



				def       SCREAMING_SNAKE_CASE       (      self      :		Optional[int]		,	_UpperCAmelCase      :		Dict      )  ->    Tuple:





								'''simple docstring'''




								if vertex not in self.adjacency:
												_lowerCAmelCase    :    Tuple										=      {}
												self.num_vertices += 1



				def       SCREAMING_SNAKE_CASE       (      self      :		str		,	_UpperCAmelCase      :		Optional[int]		,	_UpperCAmelCase      :		Tuple		,	_UpperCAmelCase      :		Optional[int]      )  ->    Dict:





								'''simple docstring'''




								self.add_vertex(_UpperCAmelCase      )
								self.add_vertex(_UpperCAmelCase      )

								if head == tail:
												return

								_lowerCAmelCase    :    Optional[Any]										=      weight
								_lowerCAmelCase    :    List[Any]										=      weight



				def       SCREAMING_SNAKE_CASE       (      self      :		Optional[Any]      )  ->    Dict:





								'''simple docstring'''




								_lowerCAmelCase    :    str										=      self.get_edges()
								for edge in edges:
												_lowerCAmelCase    :    Union[str, Any]										=      edge
												edges.remove((tail, head, weight)      )
								for i in range(len(_UpperCAmelCase      )      ):
												_lowerCAmelCase    :    Union[str, Any]										=      list(edges[i]      )

								edges.sort(key=lambda _UpperCAmelCase      : e[2]      )
								for i in range(len(_UpperCAmelCase      ) - 1      ):
												if edges[i][2] >= edges[i + 1][2]:
																_lowerCAmelCase    :    Tuple										=      edges[i][2] + 1
								for edge in edges:
												_lowerCAmelCase    :    Optional[Any]										=      edge
												_lowerCAmelCase    :    int										=      weight
												_lowerCAmelCase    :    Dict										=      weight



				def __str__(      self      :		Any      )  ->    int:





								'''simple docstring'''




								_lowerCAmelCase    :    Union[str, Any]										=      """"""
								for tail in self.adjacency:
												for head in self.adjacency[tail]:
																_lowerCAmelCase    :    Optional[int]										=      self.adjacency[head][tail]
																string += f"{head} -> {tail} == {weight}\n"
								return string.rstrip("""\n"""      )



				def       SCREAMING_SNAKE_CASE       (      self      :		Tuple      )  ->    str:





								'''simple docstring'''




								_lowerCAmelCase    :    Union[str, Any]										=      []
								for tail in self.adjacency:
												for head in self.adjacency[tail]:
																output.append((tail, head, self.adjacency[head][tail])      )
								return output



				def       SCREAMING_SNAKE_CASE       (      self      :		Optional[Any]      )  ->    str:





								'''simple docstring'''




								return self.adjacency.keys()



				@staticmethod
				def       SCREAMING_SNAKE_CASE       (      _UpperCAmelCase      :		str=None		,	_UpperCAmelCase      :		int=None      )  ->    Optional[int]:





								'''simple docstring'''




								_lowerCAmelCase    :    Dict										=      Graph()
								if vertices is None:
												_lowerCAmelCase    :    List[Any]										=      []
								if edges is None:
												_lowerCAmelCase    :    Dict										=      []
								for vertex in vertices:
												g.add_vertex(_UpperCAmelCase      )
								for edge in edges:
												g.add_edge(*_UpperCAmelCase      )
								return g
				class        __snake_case  :



								def __init__(      self      :		int      )  ->    str:





												'''simple docstring'''




												_lowerCAmelCase    :    int										=      {}
												_lowerCAmelCase    :    str										=      {}



								def __len__(      self      :		Union[str, Any]      )  ->    Optional[int]:





												'''simple docstring'''




												return len(self.parent      )



								def       SCREAMING_SNAKE_CASE       (      self      :		Any		,	_UpperCAmelCase      :		List[Any]      )  ->    Any:





												'''simple docstring'''




												if item in self.parent:
																return self.find(_UpperCAmelCase      )

												_lowerCAmelCase    :    Any										=      item
												_lowerCAmelCase    :    Union[str, Any]										=      0
												return item



								def       SCREAMING_SNAKE_CASE       (      self      :		Optional[int]		,	_UpperCAmelCase      :		Any      )  ->    List[str]:





												'''simple docstring'''




												if item not in self.parent:
																return self.make_set(_UpperCAmelCase      )
												if item != self.parent[item]:
																_lowerCAmelCase    :    List[Any]										=      self.find(self.parent[item]      )
												return self.parent[item]



								def       SCREAMING_SNAKE_CASE       (      self      :		Union[str, Any]		,	_UpperCAmelCase      :		List[str]		,	_UpperCAmelCase      :		List[str]      )  ->    Optional[int]:





												'''simple docstring'''




												_lowerCAmelCase    :    Optional[int]										=      self.find(_UpperCAmelCase      )
												_lowerCAmelCase    :    Optional[int]										=      self.find(_UpperCAmelCase      )

												if roota == roota:
																return roota

												if self.rank[roota] > self.rank[roota]:
																_lowerCAmelCase    :    Tuple										=      roota
																return roota

												if self.rank[roota] < self.rank[roota]:
																_lowerCAmelCase    :    List[str]										=      roota
																return roota

												if self.rank[roota] == self.rank[roota]:
																self.rank[roota] += 1
																_lowerCAmelCase    :    Union[str, Any]										=      roota
																return roota
												return None






				@staticmethod
				def       SCREAMING_SNAKE_CASE       (      _UpperCAmelCase      :		Union[str, Any]      )  ->    Union[str, Any]:





								'''simple docstring'''




								_lowerCAmelCase    :    List[str]										=      graph.num_vertices

								_lowerCAmelCase    :    str										=      Graph.UnionFind()
								_lowerCAmelCase    :    List[Any]										=      []
								while num_components > 1:
												_lowerCAmelCase    :    Optional[int]										=      {}
												for vertex in graph.get_vertices():
																_lowerCAmelCase    :    Optional[Any]										=      -1

												_lowerCAmelCase    :    Any										=      graph.get_edges()
												for edge in edges:
																_lowerCAmelCase    :    Union[str, Any]										=      edge
																edges.remove((tail, head, weight)      )
												for edge in edges:
																_lowerCAmelCase    :    Tuple										=      edge
																_lowerCAmelCase    :    Union[str, Any]										=      union_find.find(_UpperCAmelCase      )
																_lowerCAmelCase    :    Optional[Any]										=      union_find.find(_UpperCAmelCase      )
																if seta != seta:
																				if cheap_edge[seta] == -1 or cheap_edge[seta][2] > weight:
																								_lowerCAmelCase    :    Tuple										=      [head, tail, weight]

																				if cheap_edge[seta] == -1 or cheap_edge[seta][2] > weight:
																								_lowerCAmelCase    :    List[Any]										=      [head, tail, weight]
												for vertex in cheap_edge:
																if cheap_edge[vertex] != -1:
																				_lowerCAmelCase    :    Any										=      cheap_edge[vertex]
																				if union_find.find(_UpperCAmelCase      ) != union_find.find(_UpperCAmelCase      ):
																								union_find.union(_UpperCAmelCase		,	_UpperCAmelCase      )
																								mst_edges.append(cheap_edge[vertex]      )
																								_lowerCAmelCase    :    Any										=      num_components - 1
								_lowerCAmelCase    :    Tuple										=      Graph.build(edges=_UpperCAmelCase      )
								return mst







def 							_UpperCAmelCase  (UpperCamelCase_ : str       ):
				'''simple docstring'''
				_lowerCAmelCase    :    List[str]										=      [int(UpperCamelCase_       ) for i in ip_va_address.split("""."""       ) if i.isdigit()]
				return len(UpperCamelCase_       ) == 4 and all(0 <= int(UpperCamelCase_       ) <= 254 for octet in octets       )


if __name__ == "__main__":
	_lowerCamelCase      :  List[str]      						=						input().strip()
	_lowerCamelCase      :  int      						=						"valid" if is_ip_va_address_valid(ip) else "invalid"
	print(F'''{ip} is a {valid_or_invalid} IP v4 address.''')

