# Challenges

Problem Statement

Given an array of integers, find out and print the maximum sub-array of non-negative numbers. The sub-array should be continuous. Sub-array A is greater than subarray B if sum(A) > sum(B). And in case if the sum of two subarrays A and B is same, print the subarray with more number of elements.

Input

First line contains N, the number of elements.
The next line contains N space-separated elements representing the elements of array A.

Output

Print the maximum sub-array.

Constraints

1 ≤ N ≤ 100
-1000 ≤ A[i] ≤ 1000

Sample Input

5 2 7 9 -5 12 3

Sample Output

2 7 9

Dcoded By: Mrudul Sankhere

Solved By: 253

Maximum Marks: 12