import strutils,sequtils var N = stdin.readline.parseInt A = stdin.readline.split.map(parseInt) m,M : int m = A[0] M = A[0] for a in A[1..high(A)]: (m, M) = (min([m + a,m - a,m * a,M * a]),max([M + a,M - a,M * a,m * a])) echo M