Remah Shulchan Aruch OC at end of 635:1 - רמ"א בשולחן ערוך אורח חיים בסוף סימן תרלה:
ואין לעשות הסכך קודם שיעשה הדפנות:
The schach should not be made (put up on the Sukkah) before making (constructing) the walls.
Question: A sukkah needs a minimum of 3 walls. If 4 walls were constructed, and schach was put on top of them, and then one removed each one of the 4 walls, one wall at a time and immediately replaced it with another wall, without removing any schach, until all 4 walls had been replaced, after the schach was already on the sukkah, would the Succah remain kosher?
Would we say that since all the present walls of the succah were constructed after the schach, the sukkah is not kosher, or do we say that since only one wall was removed and a time, and immediately replaced by another, so the sukkah always had the minimal 3 walls and remained kosher at all times, and thus is still kosher?