#include <iostream>
#include<cmath>
#include<iomanip>
using namespace std;
typedef long long int LL;
LL x[100000];
int main(void){
    cout<<setprecision(16);
    LL n,i,j;
    LL ans;
    long double dans; 
    cin>>n;
    for(i=0;i<n;i++)cin>>x[i];
    
    ans=0;
    for(i=0;i<n;i++)ans+=abs(x[i]);
    cout<<ans<<endl;
    
    dans=0.0;
    for(i=0;i<n;i++)dans+=(double)(x[i]*x[i]);
    cout<<sqrt(dans)<<endl;
    
    ans=0;
    for(i=0;i<n;i++)if(ans<abs(x[i]))ans=abs(x[i]);
    cout<<ans<<endl;
}

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)



//debug用出力関数 dout("n",n);
void dout(string s, int n) {
	cout << s << ":" << n << endl;
	return;
}


int main() {

	int n,ans = 100000;
	cin >> n;
	vector<int> a(n);
	vector<int> b(n);
	vector<int> c(n);
	
	
	rep(i,n){
		cin >> a.at(i) >> b.at(i);
	}
	
	for (int i = 0; i < n; i++){
		for (int j = 0; j < n; j++){
			if(i == j){
				ans = min(ans,a.at(i) + b.at(j));
			} else {
				ans = min(ans,max(a.at(i),b.at(j)));
			}
		}
	}
	
	cout << ans << endl;
}