a Principle of a last-in first-out data structure; the last data item “pushed” is the first one “popped”. b Formal specification of a stack as an Abstract Data Type. c A minimal stack implementation in Python (omitting peek()). d DNA reaction network implementation of a stack recording two signal types, X and Y. Hybridisation reactions result in polymerisation and recording of signals X and Y (left side). Conversely, strand displacement reactions (arrows with black dots) reverse polymerisation to retrieve signals in the order opposite to which they were recorded (right side). Domains marked as * are reverse complements, W denotes washing step (see text). e Secondary structure prediction of hairpin loops distinguishing X and Y signals (ViennaRNA: colour bar indicates base pairing probability). f Correspondence between in vitro DNA stack reaction sequence and in silico Python stack function calls push() and pop(). g Linear signal w (no hairpin loop) used to create a DNA stack system amenable to PAGE analysis and model fitting (see text). h Hybridisation/strand displacement method of tethering/releasing stack complexes to/from sepharose beads during washing procedure.