#include <stdio.h>
#include <iostream>
#include <vector>
#include <queue>
#include <set>
#include <algorithm>

using ll = long long int;
const int INF = (1<<30);
const ll INFLL = (1ll<<60);
const ll MOD = (ll)(1e9+7);

#define l_ength size

void mul_mod(ll& a, ll b){
	a *= b;
	a %= MOD;
}

void add_mod(ll& a, ll b){
	a = (a<MOD)?a:(a-MOD);
	b = (b<MOD)?b:(b-MOD);
	a += b;
	a = (a<MOD)?a:(a-MOD);
}

std::set<int> s;

int main(void){
	int n,i,p;
	for(i=0; i<200002; ++i){
		s.insert(i);
	}
	std::cin >> n;
	for(i=0; i<n; ++i){
		std::cin >> p;
		s.erase(p);
		std::cout << *s.begin() << std::endl;
	}
	return 0;
}

#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;++i)
#define ll long long
const ll mod=1000000007;
inline int roundup(int a, int b) { return (((a + (b -1)) / b)); }
inline ll powmod(ll x, ll y) {ll res=1; for(ll i=0;i<y;i++){ res=res*x%mod; } return res;}
using namespace std;

signed main(void) {
    cout << fixed << setprecision(15);
    ll n, x[100000], m=0, c=0, u_sq=0;
    cin >> n;
    rep(i, n) {
        cin >> x[i];
    }
    rep(i, n) {
        c = max(c, abs(x[i]));
        m += abs(x[i]);
        u_sq += abs(x[i])*abs(x[i]);
    }
    cout << m << '\n' << sqrt(u_sq) <<'\n' << c << '\n';
    return 0;
}