A sequence $A_1, A_2, \ldots, A_N$ of length $N$ is given. Write a program to process the following queries:
x1 y1 x2 y2: For all pairs $(i, j)$ such that $x1 \le i \le y1$, $x2 \le j \le y2$, and $i \le j$, output the maximum value of $A_i + \ldots + A_j$. ($1 \le x1 \le x2 \le N$, $1 \le y1 \le y2 \le N$, $x1 \le y1$, $x2 \le y2$)
Input
The first line contains the length $N$ of the sequence ($1 \le N \le 100{,}000$).
The second line contains $A_1, A_2, \ldots, A_N$. ($-100{,}000 \le A_i \le 100{,}000$)
The third line contains the number of queries $M$ ($1 \le M \le 100{,}000$).
The next $M$ lines each contain a query $x1, y1, x2, y2$.
Output
For each query, output the answer on a separate line.
Examples
Input 1
6 3 -2 1 -4 5 2 2 1 1 2 3 1 3 2 5
Output 1
2 3
Input 2
1 1 1 1 1 1 1
Output 2
1