#include
#include
using namespace std;
double sum_of_positives(vector &v){
double s = 0;
for(auto &i: v) s += i * (i > 0);
return s;
}
double prod(vector &v, int l, int r){
if(l > r) swap(l, r);
if(l + 1 >= r)
return 0;
double p = v[l];
for(int i = l + 1; i <= r; i++)
p *= v[i];
return p;
}
int main() {
int n;
cin >> n;
vector a(n);
for (auto &i: a) cin >> i;
pair abs_min = {abs(a[0]), 0}, abs_max = {abs(a[0]), 0};
for (int i = 1; i < n; i++) {
if (a[i] < abs_min.first) abs_min = {a[i], i};
if (a[i] > abs_max.first) abs_max = {a[i], i};
}
cout << "Sum: " << sum_of_positives(a) << "\n"
<< "Product between abs_min and abs_max: " << prod(a, abs_min.second, abs_max.second);
}