when V>0, what happens in ideal diode?
In this highly simplified diode model, the diode acts as either an open circuit (when reverse biased) or a short circuit (when forward biased).
In your example, if all diodes were forward biased, then the output voltage would have to be 1 V, 2 V, and 3 V at the same time. This is a logical contradiction.
But it’s easy to resolve, because if the output is 3 V, then the 2nd and 3rd diodes are reverse biased, and the contradiction is eliminated.