2004 AIME I Problem 2

Set \mathcal{A} consists of m consecutive integers whose sum is 2 m$, and set \mathcal{B} consists of 2 m consecutive integers whose sum is m. The absolute value of the difference between the greatest element of \mathcal{A} and the greatest element of \mathcal{B} is 99 . Find m.