problem 1004