You are in a room with two adjacent doors locked by four sliding bolts. The bolts are movable and only block one door at a time, however you do not know which bolt currently is before which door. An example configuration: ![two doors blocked by four sliding bolts (example configuration)][1] Luckily, there are three buttons A, B, C, which cause some bolts to slide from the door they are curently blocking over to the other door. However, each button can trigger different actions, which one is used is determined at each push in a fully random way: * Button A slides *at random* either - bolt 1 *or* - bolt 2 *or* - bolt 3 *or* - bolt 4. * Button B slides at random either - bolt 1 and 2 *or* - bolt 2 and 3 *or* - bolt 3 and 4 *or* - bolt 4 and 1. * Button C slides at random either - bolt 1 and 3 *or* - bolt 2 and 4. Your task is to find a sequence of button activations to get out of the room (i.e. to move all the buttons in front of one door so the other one is open) regardless of the unknown initial position of the bolts. (You may try the doors after each touch of a button to see whether they are open.) The sequence should be as short as possible. *Source:* [Newsgroup de.rec.denksport, *Zwei Tueren, vier Riegel*, GJ Woeginger, 2011-10-15 (German)](https://groups.google.com/d/msg/de.rec.denksport/JlxxqX7-4Hs/WGeV4Boiw) [1]: https://i.sstatic.net/Di9bU.png