Question 1
Suppose that $\{1,2,\ldots,1998\}$ has been partitioned into disjoint pairs $\{a_i,b_i\}$, $1\le i\le999$, so that every $|a_i-b_i|$ equals $1$ or $6$. Prove that $\sum_{i=1}^{999}|a_i-b_i|$ ends in the digit $9$.
USAMO · USAMO 1998 — Days 1 and 2