def merge_q(label_a, start_a, stop_a, label_b, start_b, stop_b):
    """
    Whether or not range `A` and range `B` can be merged.

    Arguments:
        label_a (int): label of range `A`
        start_a (int): start of range `A`
        stop_a (int): stop of range `A`
        label_b(int): label of range `B`
        start_b(int): start of range `B`
        stop_b (int): stop of range `B`

    Returns:
        answer (bool)
    """
    if label_a != label_b:
        return False
    elif stop_a < start_b:
        return False
    elif stop_b < start_a:
        return False
    else:
        return True
