12. Arrange all positive integers $m$ whose digits are no greater than 3 in ascending order to form a sequence $\left\{a_{n}\right\}$. Then $a_{2007}=$ $\qquad$ .
12.133113.

We call this kind of number a "good number". There are 3 one-digit good numbers; 12 two-digit good numbers, which is $3 \times 4$; 48 three-digit good numbers, which is $3 \times 4^2$; $\cdots \cdots \cdot k$-digit good numbers have $3 \times 4^{k-1}$ numbers $(k=1$, $2, \cdots)$. Let $S_{n}=3 \sum_{k=1}^{n} 4^{k-1}$.

Since $S_{5}<2007<S_{6}, 2007-S_{5}=984$, the 2007th good number is the 984th six-digit good number; and among the six-digit good numbers, those starting with 1 total $4^{5}=1024$ numbers, and those starting with $10, 11, 12, 13$ each have $4^{4}=256$ numbers, so the first two digits of the 2007th good number are 13, and it is the $984-3 \times 256=216$th number among those starting with 13; and those starting with $130, 131, 132, 133$ each have 64 numbers, so the first three digits of $a_{2007}$ are 133, and it is the $216-3 \times 64=24$th number among those starting with 133; and those starting with 1330, $1331, 1332, 1333$ each have 16 numbers, so the first four digits of $a_{2007}$ are 1331, and it is the 24 $16=8$th number among those starting with 1331; then the first five digits of $a_{200}$ are 13311, and it is the $8-4=4$th number among those starting with 13311. Therefore, $a_{2007}=133113$.