solve if a condition has two terminal