I am trying to write 2 conditions in which if the conditions are coming alternately then my code is working fine but when both conditions true together then the second condi