1. Write 2004 numbers on the blackboard: $1,2, \cdots, 2004$, in each step, erase some numbers from the blackboard, and rewrite 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 remaining number?