I am confident on the algorithm but it may lose to a slower but way cheaper solve. Some points can be scraped from this solve by throughly iterating but it looks decent enough How it works: performs 4 is fire checks and assembles the fires in one stick and the salts/waters in the other. Every salt is duped to water to enable output conditionals. Both sticks are joined by grabbing and joining the two last atoms that were added to the stick. The joined stick guarantees that every fire is on one side and every water is on the other. To distinguish every salt case I use output conditionals. The fire-water stick is fed conditionally to an arm that grabs it on different cycles depending on the initial lenght of the water sub-stick. Then the waters are sequentially calcified after each output conditional, which covers every case. Thanks to the delay the fires skip the calcification of the initial steps as the output gets delayed by the amount of fires present in the stick. There is an edge case when there are 4 fires, since it would crash if the next input is 4 waters. To mitigate that, when the fire stick is 4 long the last atom is conditionally grabbed to feed the stick earlier. Since the full fire stick outputs directly, there are no wrong calcifications if the stick is fed earlier than it should.