They go by the dates on the Polis computer system, the stamping of the passport is of secondary importance.
But for the record, what will actually happen is that the passport control guy will spend several minutes looking at it, then showing it to colleagues in adjacent kiosks, then go on the phone and a more important passport controller will come and they will give it to him and a big discussion will commence - everyone involved so far will have made fleeting serious looks deep into your eyes, perhaps one might even say "problem" in your direction - then at least 3 men in plain clothes will arrive with ID cards hanging round their necks, and pass it amongst themselves and point at it, talking in a very serious manner indeed.
Then the initial passport guy will be given the passport, he'll stamp it and give it back to you, then stare through you to indicate it's time for you to go on through, you have wasted enough of his time.