/* dotp.cpp
 *
 *
 */



//#include "dotp.h"
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <list>
#include <deque>
#include <cmath>

using namespace std;


int main()
{

    int n ;

    cin >> n ;
    vector<int> x(n, 0), y(n, 0) ;

    for(int i = 0; i < n; i++) cin >> x[i] ;
    for(int i = 0; i < n; i++) cin >> y[i] ;

    int sum = 0 ;
    for(int i = 0; i < n; i++) sum += (x[i] * y[i]) ;

    if( sum ) cout << "No" << endl ;
    else cout << "Yes" << endl ;

	return 0;
}



// Best practice
 
#include<bits/stdc++.h>
 
#define int         long long
#define pb          push_back
#define pf          emplace_front
#define all(a)      (a).begin(),(a).end()
#define rall(a)     (a).rbegin(),(a).rend()
#define pii 		pair<int,int>
#define psi 		pair<string,int>
#define vi 			vector<int>
#define vpii  		vector<pii>
#define vvi 		vector<vi>
#define sz(x)	    (int)(x).size()
#define x           first
#define y           second
#define endl        '\n'
#define tezz        ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define MOD         1000000007
#define hell        998244353
#define ini(a, i) 	memset(a, i, sizeof(a))
#define output(x)   cout << (x ? "YES" : "NO")<<endl;
using namespace std;

#define debug(vec) cout<<(#vec)<<" : [ "; for (auto& i: vec) cout<<i<<" "; cout<< "]" << endl
#define debugp(vec) cout<<(#vec)<<" : [ "; for (auto& i: vec) cout<<"("<<i.x<<","<<i.y<<")"<<" "; cout<< "]" << endl
#define trace(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args);cout << endl; }
void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
    cout << "[" << *it << ": " << a << "]\t";
    err(++it, args...);
}

// const int dx[4] = { -1, 1, 0, 0};
// const int dy[4] = {0, 0, -1, 1};
// int dX[] = { -1, -1, -1, 0, 0, 1, 1, 1 };
// int dY[] = { -1, 0, 1, -1, 1, -1, 0, 1 }; 
// bool valid(int x, int y, int n, int m){return (x>=0 && y>=0 && x<n && y<m);}
 
// Code from Here -------------------------------------------------------------------------------

void solver(){
	int n;
    cin >> n;
    int x;
    double ans1=0, ans2=0;
    int ans3=0;
    for(int i=0; i<n; i++){
        cin >> x;
        ans1 += abs(x);
        ans2 += (x*x);
        ans3 = max(ans3, abs(x));
    }
    cout << fixed << setprecision(15);
    cout << ans1 << endl;
    cout << sqrt(ans2) << endl;
    cout << ans3 << endl;
}

signed main() {
	tezz

	// #ifndef ONLINE_JUDGE
	// 	freopen("input.txt", "r", stdin);
	// 	freopen("output.txt", "w", stdout);
	// #endif

	int t=1;
	// cin >> t;
	while(t--){
		solver();
	}
 
	return 0;
}  