/*
author : seryu
title : ABC180B_"Various distances"
*/
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < n; i++)
#define reps(i,n) for(int i = 1; i <= n; i++)
#define rrep(i,n) for(int i = n-1; i >= 0; i--)
#define rreps(i,n) for(int i = n; i >= 1; i--)
#define mrep(i,j,n) for(int i = j; i < n; i++)
#define mreps(i,j,n) for(int i = j; i <= n; i++)
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
#define ERASE(x,val) x.erase(remove(all(x), val), x.end())
#define MOD 1000000007
typedef long long ll;
typedef pair<int, int> P;
template<class T>inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; }return false; }
template<class T>inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; }return false; }

void solve()
{
    int n;
    cin >> n;
    double man = 0, euc = 0, che = 0;
    rep(i, n)
    {
        double x;
        cin >> x;
        man += abs(x);
        euc += x*x;
        chmax(che, abs(x));
    }
    euc = pow(euc, 0.5);
    cout << man << endl;
    cout << euc << endl;
    cout << che << endl;
    return;
}

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    solve();
    return 0;
}

#include <cstdio>
#include <algorithm>

const int N = 2e5 + 5;

int a[N];
int b[N];
int ans[N];

int main() {
//#ifndef ONLINE_JUDGE
	//freopen("in", "r", stdin);
//#endif
	int n;
	while (~scanf("%d", &n)) {
		for (int i = 1; i <= n; ++i) {
			scanf("%d", &a[i]);
			b[a[i]] = i;
		}
		int cnt = 0;
		for (int i = n; i >= 1; --i) {
			for (int k = b[i]; k < i; ++k) {
				std::swap(a[k], a[k + 1]);
				std::swap(b[a[k]], b[a[k + 1]]);
				ans[cnt++] = k;
				if (cnt >= n - 1) {
					break;
				}
			}
			if (cnt >= n - 1) {
				break;
			}
		}
		if (std::is_sorted(a, a +n) && cnt == n - 1) {
			for (int i = 0; i < cnt; ++i) {
				printf("%d\n", ans[i]);
			}
		} else {
			printf("-1\n");
		}
	}
	return 0;
}
