#include<bits/stdc++.h>

using namespace std;

int main()
{
    int n;
    cin>>n;
    long long int a[n],b[n];
    long long int l[n];
    for(int i=0;i<n;i++)
    {
        cin>>a[i];
    }
    for(int i=0;i<n;i++)
    {
        cin>>b[i];
    }
    int maxa[n],maxb[n];
    maxa[0] = a[0];
    maxb[0] = b[0];
    for(int i=1;i<n;i++)
    {
        maxa[i] = maxa[i-1];
        if(a[i]>maxa[i])
        {
            maxa[i] = a[i];
        }
    }
    l[0] = a[0]*b[0];
    for(int i=1;i<n;i++)
    {
        l[i] = l[i-1];
        if(maxa[i] * b[i] > l[i-1])
        {
            l[i] = maxa[i] * b[i];
        }
    }
    for(int i=0;i<n;i++)
    {
        cout<<l[i]<<endl;
    }
}

#include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
#include <cmath>
#include <bitset>
#include <iomanip>
#include <stack>
#include <list>
#include <map>
#include <unordered_map>
#include <chrono>
#include <numeric>
using namespace std;
using ll = long long;
const ll INF = (ll)1e18+1;
const ll DIV = 1000000007;
//#define TEST
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
#ifdef TEST
    chrono::system_clock::time_point start, end;
    start = chrono::system_clock::now();
#endif
    long N;
    cin >> N;
    vector<ll> x(N);
    for(size_t i=0;i<N; i++)
    {
        cin >> x[i];
    }
    ll ans_a=0;
    double ans_b=0;
    ll ans_c = 0;
    for(size_t i=0;i<N; i++)
    {
        ans_a+=abs(x[i]);
        ans_b += x[i]*x[i];
        ans_c = max(ans_c, abs(x[i]));
    }
    cout << ans_a << endl;
    cout << fixed << setprecision(10) << sqrt(ans_b) << endl;
    cout << ans_c << endl;
#ifdef TEST
    end = chrono::system_clock::now();
    cerr << static_cast<double>(chrono::duration_cast<chrono::microseconds>(end - start).count() / 1000.0) << "[ms]" << endl;
#endif
    return 0;
}