is ip v4 address valid a valid ip address must be four octets in the form of a b c d where a b c and d are numbers from 0254 for example 192 168 23 1 172 254 254 254 are valid ip address 192 168 255 0 255 192 3 121 are invalid ip address print valid ip address if ip is valid or print invalid ip address if ip is invalid isipv4addressvalid192 168 0 23 true isipv4addressvalid192 255 15 8 false isipv4addressvalid172 100 0 8 true isipv4addressvalid254 255 0 255 false isipv4addressvalid1 2 33333333 4 false isipv4addressvalid1 2 3 4 false isipv4addressvalid1 2 3 false isipv4addressvalid1 2 3 4 5 false isipv4addressvalid1 2 a 4 false isipv4addressvalid0 0 0 0 true isipv4addressvalid1 2 3 false print valid ip address if ip is valid or print invalid ip address if ip is invalid is_ip_v4_address_valid 192 168 0 23 true is_ip_v4_address_valid 192 255 15 8 false is_ip_v4_address_valid 172 100 0 8 true is_ip_v4_address_valid 254 255 0 255 false is_ip_v4_address_valid 1 2 33333333 4 false is_ip_v4_address_valid 1 2 3 4 false is_ip_v4_address_valid 1 2 3 false is_ip_v4_address_valid 1 2 3 4 5 false is_ip_v4_address_valid 1 2 a 4 false is_ip_v4_address_valid 0 0 0 0 true is_ip_v4_address_valid 1 2 3 false
def is_ip_v4_address_valid(ip_v4_address: str) -> bool:
    
    octets = [int(i) for i in ip_v4_address.split(".") if i.isdigit()]
    return len(octets) == 4 and all(0 <= int(octet) <= 254 for octet in octets)


if __name__ == "__main__":
    ip = input().strip()
    valid_or_invalid = "valid" if is_ip_v4_address_valid(ip) else "invalid"
    print(f"{ip} is a {valid_or_invalid} IP v4 address.")