1. Write 2004 numbers on the blackboard: $1,2, \cdots, 2004$, in each step, erase some numbers from the blackboard and write down the remainder of their sum divided by 167, after several steps, two numbers remain on the blackboard, one of which is 999, what is the second number?
1. Let the second number left on the blackboard be $x$. Since $999>167$, 999 is not the number that is rewritten on the blackboard after the operation, thus $0 \leqslant x \leqslant 166$.
Notice that each operation does not change the remainder of the sum of all numbers on the blackboard when divided by 167.
$$
1+2+\cdots+2004=\frac{2004 \times 2005}{2}=1002 \times 2005 .
$$

Since $167 \mid 1002$, it follows that $x+999=0(\bmod 167) \Rightarrow x \equiv 3(\bmod 167)$.
Also, $0 \leqslant x \leqslant 166$, so $x=3$.
Therefore, the second number left on the blackboard is 3.