#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main(){
  int k;
  int atime,btime;
  vector<int> A;
  vector<int> B;
  cin>>k;
  for (int i=0;i<k;i++){
    int a,b;
    cin>>a>>b;
    A.push_back(a);
    B.push_back(b);
  }
  atime=*min_element(A.begin(),A.end());
  B[distance(A.begin(),min_element(A.begin(),A.end()))]+=atime;
  btime=*min_element(B.begin(),B.end());
  cout<<max(atime,btime);
}
#include<bits/stdc++.h>
using namespace std;
#define For(i,a,b) for(int i = a;i<=b;++i)
#define For_(i,a,b) for(int i = a;i>=b;--i)
#define endl '\n'
#define IOS ios::sync_with_stdio(false)
typedef long long LL;
inline int read(){
    int r = 0,f = 1;
    char c = getchar();
    while(c<'0' || c >'9'){
        if(c =='-') f = -1;
        c = getchar();
    }
    while(c>='0' && c<='9'){
        r = (r<<1) + (r<<3) + c - '0';
        c = getchar();
    }
    return r * f;
}
#define max3(a,b,c) max(a,max(b,c));
const int N = 500000+ 5 ,M = N , INF = 0x3f3f3f3f;
int n,m;
long long s1,s3;
unsigned long long s2;
int main(){
    n = read();
    For(i,1,n){
        int x = read();
        x = abs(x);
        s1 += x;
        s2 += x*(LL)x;
        s3 = max(s3,(LL)x);
    }

    cout<<s1<<'\n';
    double ans2 = (double)sqrt(s2);
    printf("%.15lf\n",ans2);
    cout<<s3<<'\n';
    //system("pause");
    return 0;
}
