You have 5 weights with the following masses: 1000 grams, 1001 grams, 1002 grams, 1004 grams, and 1007 grams, but the weights are unmarked and look identical. You have a scale with a pointer which shows the mass in grams. How can you determine which weight is 1000 grams in exactly 3 weighings?