12. On the board, there is a 17-digit number composed only of 1s and 2s. Paolo enters and writes the number in reverse order, aligning it below the previous one. Gianni enters and writes below each column the highest digit that appears in that column. Alberto enters and writes below each column the lowest digit that appears in that column, then erases the first two rows. Carla enters and finds the numbers 12212212221221221 and 11211111211111211 written, and she is explained what Paolo, Gianni, and Alberto did. How many different numbers could have been written on the board as the first number?
12. The answer is 16. Before Alberto erases the first two lines, in column $k(k=1, \ldots, 17)$ appear the number in position $k$, the number in the symmetric position $17-(k-1)$, the maximum of the two, the minimum of the two. When the maximum and minimum coincide, the number in position $k$ and the number in the symmetric position $17-(k-1)$ are equal. This happens in columns 1, 3, 4, 7, necessarily in column 9, and then symmetrically in positions $11,14,15,17$. In these positions, the numbers are certainly $1,2,1,1,2,1,1,2,1$, respectively. In the other pairs of symmetric positions, there is 1 in one and 2 in the other. Therefore, the numbers that could have led to the two lines that Carla finds on the board were $2^{4}=16$.