def get_output_port(component, input_port):
    """Get output port of the component."""
    if component[0] == component[1]:
        return input_port
    return [port for port in component if port != input_port][0]