It is December 24th evening. An absent minded farmer has just realized that he did not buy any gift for his wife. The farmer is on a path in the woods, and he can only think about picking up all the mushrooms on the way back home, praying that that will soften a bit the cries awaiting him. Suppose the path divided into segments 1, 2, …, and that in each one there are a certain number of mushrooms . The farmer is at the segment , and his home is at the segment . The farmer will pick up all the mushrooms in the segments between and . How many mushrooms will it be?
Input consists of several cases. Every case begins with , followed by the quantities of mushrooms . Follow the number of queries about this case, assuming different positions of the farmer and his home. Each query consists of and , both between 1 and . Suppose , , and .
For every case, print its number. For every query of every case, print the sum of the numbers between and , the extrems inclusive.
Input
4 7 0 20 105 3 1 4 3 3 4 3 1 1000 1 1 1
Output
#1 132 20 125 #2 1000