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

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

#include <bits/stdc++.h>
using namespace std;
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifndef ONLINE_JUDGE
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
// debug & operator << (debug & dd, P p) { dd << ", " << p.x << ", " << p.y << ")"; return dd; }

#define ll long long

const ll nax = 2e5 + 5;
vector<ll> edges[nax], vis(nax, 0);
ll cnt = 0;

void dfs(ll node) {
    cnt++;
    vis[node] = 1;
    for(ll x: edges[node]) {
        if(vis[x] == 0) {
            dfs(x);
        }
    }
}

int main() {
    #ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
        freopen("error.txt", "w", stderr);
    #endif
    
    ll n;
    cin >> n;
    vector<ll> a(n);
    for(ll i = 0; i < n; ++i) {
        cin >> a[i];
    }
    for(ll i = 0; i < n; ++i) {
        edges[a[i]].push_back(a[n - i - 1]);
        edges[a[n - i - 1]].push_back(a[i]);
    }
    ll ans = 0;
    for(ll i = 0; i < nax; ++i) {
        if(vis[i] == 0) {
            cnt = 0;
            dfs(i);
            ans = ans + max(0ll, cnt - 1);
        }
    }
    cout << ans << endl;
    return 0;
}