there is a table with format entries:
id | A | B | C | D |
so you need to insert, let's say some id on the cycle, in the cell that is not busy! those. let's say if there is data:
0 | 12 | 32 | 43 | 14 | 1 | 54 | 55 |___|___|
then insert id into the next. empty cell, in this example it is a cell that comes after 55, if all the cells are filled, then you need to make a new record and insert id into the 1st cell of the new record. I hope clearly explained.