C. Sled Circle
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

There are $$$n$$$ dogs all facing clockwise in a circle with $$$n$$$ evenly spaced points. They are all feeling energetic and want to chase the dog in front of them by running over $$$v_i$$$ points. Sometimes, this causes them to miss their target. Being a dog photographer, you want to find the earliest time $$$t$$$ and position $$$p$$$ that the dogs will all be at one point, such that you can take a picture of all of the dogs together. Of course, you have limited time to take the photos, so at $$$t = 1001$$$, you will decide to take pictures of other groups of dogs and leave.

Input

The first integer will contain $$$n (1\leq n\leq 1000)$$$. The next lines will each contain $$$n$$$ integers $$$v_i (1\leq v_i \leq 100, 0\leq i\leq n - 1)$$$, where the $$$i$$$-th dog starts at position $$$i$$$ at $$$t = 0$$$.

Output

Two space-separated integers, the earliest time $$$t$$$ and position $$$p$$$. If all the dogs cannot be at one point, print $$$-1$$$

Example
Input
3
1 2 3
Output
2 2