#define rep(i, n) for(int i=0; i<(n); ++i)
#define rrep(i, n) for(int i=(n-1); i>=0; --i)
#define rep2(i, s, n) for(int i=s; i<(n); ++i)
#define ALL(v) (v).begin(), (v).end()
#define memr(dp, val) memset(dp, val, sizeof(dp))
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T> inline T int_ceil(T a, T b) { T res = a / b; if(a % b != 0) res++; return res; }
#include <bits/stdc++.h>
using namespace std;
template<typename T>
using min_priority_queue = priority_queue<T, vector<T>, greater<T> >;
typedef long long ll;
static const int INTINF = (INT_MAX >> 1); // 10^9 + 10^7
static const ll LLINF = (LLONG_MAX >> 1);
// sort(ALL(v), [](auto const& lhs, auto const& rhs) { return lhs > rhs; /* 左の方が大きい...というイメージ。*/ });
// --------------------------------------------------------------------------------------------- //

static const int MAX = 100001;
static const ll MOD = 1000000007;


int main(int argc, const char * argv[]) {
	std::cout << std::fixed << std::setprecision(15);

	ll N; cin >> N;
	ll ans1=0, ans2=0, ans3=0;
	rep(i, N){
		ll x; cin >> x;
		ans1 += abs(x);
		ans2 += x * x;
		ans3 = max(ans3, abs(x));
	}
	double ans2_d = sqrt((double)ans2);
	cout << ans1 << endl;
	cout << ans2_d << endl;
	cout << ans3 << endl;

	return 0;
}

#include<bits/stdc++.h>
#define rep(i, n) for (int64_t i = 0; i < (int64_t)(n); i++)
#define all(v) v.begin(), v.end()
using ll = long long;
using namespace std;

int main(){
  int n;cin>>n;
  vector<int> a(n),b(n);
  int ans=1e10;
  rep(i,n)cin>>a[i]>>b[i];
  rep(i,n){
    rep(j,n){
      if(i==j)ans=min(ans,a[i]+b[j]);
      else ans=min(ans,max(a[i],b[j]));
    }
  }
  cout<<ans;
}
  