loop with first EQ/LT/GT