SBE201A4 - Array Minimum

Given an array of n integers, find the value of its minimum element.

Input

Each test case is described in two lines. The first line contains n, the size of the array (1 <= n <= 106). The second line contains n integers separated by one or more spaces. Each integer in the array will be between -109 and 109, inclusive.

The last line of the input contains a single 0 and should not be processed.

Output

For each test case, write the minimum element in the array on a single line.

Example

Input:
4
1 2 3 4
2
-1 0
3
-1000000000 0 1000000000
0

Output:
1
-1
-1000000000

(Problem is inspired by MAXINARR)


Added by:Islam Samir Badreldin
Date:2012-03-12
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:C99

© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.