Scavenger Hunt Your girlfriend (boy friend) set up a scavengers hunt for you to follow. An array A[0..n-1] contains the sequence of pointers to the treasure. A[0] is the first cell to look in. A[0] contains the index i1 to look in next. A[i1] contains the index i2 to look in after that. Follow this chain until you find A[i*] containing a zero. Note that the array A may contain other zeros. They are not for you. Sometimes you will be sent on a wild goose chase. For example, if n=10 and the array contents are 8 4 0 6 7 9 2 5 3 0 0 1 2 3 4 5 6 7 8 9 (indexes not part of the input) Here, the treasure is located at index 2. An example of a wild goose chase is the following array (again with n=10): 9 0 0 0 5 9 0 0 0 4 0 1 2 3 4 5 6 7 8 9 (indexes not part of the input) Any input that causes you to reach an index that is out of range (less than 0 or larger than n-1) is also considered a wild goose chase. Input: The input contains a number of examples. Each example consists of the size n of the array on one line and the contents of the array on the next. n<=100. The instances will be terminated with n=0. Output: For each input instance, the output is the index i* of your prize. If it was a wild goose chase, output -1. Sample Input: 10 8 4 0 6 7 9 2 5 3 11 10 9 0 0 0 5 9 0 0 0 4 5 2 0 -1 1 3 0 Sample Output: 2 -1 -1