#pragma GCC optimize(2)
#pragma GCC optimize(3)
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define bg begin()
#define en end()
#define endl "\n"
#define vvl(n,m) vector<vector<ll> > a( n , vector<ll> (m))
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define mod 1000000007
using namespace std;
ll gcd(ll a,ll b){
    if(a==0)
        return b;
    else return gcd(b%a,a);
}
ll power(ll x, ll y, ll m) 
{ 
    if (y == 0) 
        return 1; 
    ll p = power(x, y / 2, m) % m; 
    p = (p * p) % m; 
  
    return (y % 2 == 0) ? p : (x * p) % m; 
} 
ll modInverse(ll a, ll m) 
{ 
    return power(a, m - 2, m); 
}
ll ncr(ll n, ll k) 
{ 
    ll res = 1; 
  
    if (k > n - k) 
        k = n - k; 
    for (ll i = 0; i < k; ++i) { 
        res *= (n - i); 
        res /= (i + 1); 
    } 
  
    return res; 
} 
void permute(string str)
{
    set<string> s;
    sort(str.begin(), str.end());
    do {
        if(s.count(str)==0)
        cout << str << endl;
        s.insert(str);
    } while (next_permutation(str.begin(), str.end()));  
}
void solve()
{
    ll n,i;
    cin>>n;
    ll r=power(2,n,10000000);
    ll a[r+1],l=1,b[r+1][2];
    for(i=1;i<=r;i++){
        cin>>a[i];
        b[i][1]=a[i];
        b[i][0]=i;
    }
    while(r!=2){
        for(l=1;l<=r/2;l++){
            if(b[2*l-1][1]>b[2*l][1]){
                b[l][0]=b[2*l-1][0];
                b[l][1]=b[2*l-1][1];
            }
            else{
                b[l][0]=b[2*l][0];
                b[l][1]=b[2*l][1];
            }
        }
        r/=2;
    }
    if(b[1][1]<b[2][1]){
        cout<<b[1][0];
    }
    else
        cout<<b[2][0];
}
int main()
{
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    fast
    solve();
    #ifndef ONLINE_JUDGE
    cout << "\nTime Elapsed: " << 1.0 * clock()  / CLOCKS_PER_SEC << " sec\n";
    #endif
    return 0;
}
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define P pair<ll,ll>

int main(){
  cout<<setprecision(15)<<fixed;
  int n;
  cin>>n;
  vector<ll> x(n);
  rep(i,n){
    ll a; cin>>a;
    x[i]=abs(a);
  }
  ll M=0, C=0;
  double E=0;
  rep(i,n) M+=x[i];
  rep(i,n) E+=x[i]*x[i];
  E=sqrt(E);
  rep(i,n) C=max(C,x[i]);
  cout<<M<<endl;
  cout<<E<<endl;
  cout<<C<<endl;
}