#include<bits/stdc++.h>
using namespace std;

#define LOCAL
//Credit: Errichto's debug template
#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 {
#ifdef LOCAL
~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__) << "] "

using ll = long long int;
using ld = long double;
using vi = vector<int>;
using mii = map<int, int>;
using pii = pair<int, int>;

const int inf = 1e9;
const int N = 100005;
const ll mod = (ll) 1e9 + 7;
const ll mod2 = (ll) 998244353;


void test(){
	int n;
	cin >> n;
	vi arr(n);

	for(int i = 0; i < n; i++)
		cin >> arr[i];

	set<int> s;

	for(int i = 0; i <= n; i++)
		s.insert(i);

	for(int i = 0; i < n; i++){
		if(s.find(arr[i]) != s.end())
			s.erase(arr[i]);

		int ans = *s.begin();
		cout << ans << '\n';
	}
}

int32_t main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL), cout.tie(NULL);

    int tt = 1;
    //cin >> tt;
    while(tt--){
    	test();
    }

    return 0;
}

/*

 */

#include <bits/stdc++.h>
using namespace std;

int main(void) {
  int n;
  cin >> n;
  vector<long long> xs(n);
  for (long long &x : xs) cin >> x;
  long long result0 = 0;
  long long result1 = 0;
  long long result2 = 0;
  for (int i = 0; i < n; ++i) {
    result0 += abs(xs[i]);
    result1 += xs[i] * xs[i];
    result2 = max(result2, abs(xs[i]));
  }

  double result1a = sqrt(result1);

  cout << setprecision(10);
  cout << result0 << endl << result1a << endl << result2 << endl;
  return 0;
}