//
// Created by yamunaku on 2020/12/26.
//

#include <bits/stdc++.h>
//#include <atcoder/all>

using namespace std;
//using namespace atcoder;

#define rep(i, n) for(int i = 0; i < (n); i++)
#define repl(i, l, r) for(int i = (l); i < (r); i++)
#define per(i, n) for(int i = ((n)-1); i >= 0; i--)
#define perl(i, l, r) for(int i = ((r)-1); i >= (l); i--)
#define all(x) (x).begin(),(x).end()
#define MOD9 998244353
#define MOD1 1000000007
#define IINF 1000000000
#define LINF 1000000000000000000
#define SP <<" "<<
#define CYES cout<<"Yes"<<endl
#define CNO cout<<"No"<<endl
#define CFS cin.tie(0);ios::sync_with_stdio(false)
#define CST(x) cout<<fixed<<setprecision(x)

using ll = long long;
using ld = long double;
using vi = vector<int>;
using mti = vector<vector<int>>;
using vl = vector<ll>;
using mtl = vector<vector<ll>>;
using pi = pair<int, int>;
using pl = pair<ll, ll>;
template<typename T>
using heap = priority_queue<T, vector<T>, function<bool(const T, const T)>>;

int main() {
    //CFS;
    int n;
    cin >> n;
    int m = (1 << 11) - 1;
    rep(i, n) {
        int a = (i * 2) & m, b = (i * 2 + 1) & m;
        if (a >= n) {
            per(j, 11) {
                if (a & (1 << j)) {
                    a ^= (1 << j);
                }
                if (a < n) break;
            }
        }
        if (b >= n) {
            per(j, 11) {
                if (b & (1 << j)) {
                    b ^= (1 << j);
                }
                if (b < n) break;
            }
        }
        cout << a + 1 SP b + 1 << endl;
    }
    return 0;
}

#include<stdio.h>
#include<math.h>
#include<algorithm> 
#define it register int
#define ct const int
#define il inline
typedef long long ll;
#define rll register ll
#define cll const ll
#define mkp make_pair 
using namespace std;
const int N=1000005;
int n,a,b;
ll ans1,ans2,ans3;
int main(){
	scanf("%d",&n);
	while(n--) scanf("%d",&a),a=(a<0?-a:a),ans1+=a,ans2+=(0ll+a)*a,ans3=(ans3>a?ans3:a);
	printf("%lld\n%.10lf\n%lld\n",ans1,sqrt(1.0*ans2),ans3);
	return 0;
}
