solve 1004