#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define REP(i, s, n) for (int i = (s); i < (int)(n); i++)
#define ALL(v) v.begin(), v.end()
#define CHECK(a) cout << #a << " " << a << endl;
const int INF = 1e9;
const ll MOD = (ll)1e9 + 7LL;
const vector<int> dx = {1, 0, -1, 0, 1, 1, -1, -1};
const vector<int> dy = {0, 1, 0, -1, 1, -1, 1, -1};

void Main () {
    int N;
    cin >> N;

    set<int> A;
    REP (i, 0, N) {
        int a;
        cin >> a;
        A.insert(a);
    }
    
    while  (true) {
        int maximum = *rbegin(A);
        int minimum = *begin(A);
        if (maximum == minimum) break;
        else {
            A.erase(maximum);
            A.insert(maximum - minimum);
        }
    }
    
    cout << *begin(A) << endl;
}

int main () {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);
    Main();
}
#include<bits/stdc++.h>
#define rep(i,n) for (int i=0;i<(n);++i)
using namespace std;
using ll = long long;
using p = pair<int, int>;

int main(){
  int N;
  cin >> N;
  ll sum1 = 0;
  long double sum2 = 0;
  ll m = -1;
  rep(i, N) {
    ll x;
    cin >> x;
    x = abs(x);
    m = max(m, x);
    sum1 += x;
    sum2 += x*x*1.0;
  }
  cout << fixed << setprecision(15);
  cout << sum1 << endl << sqrt(sum2) << endl << m;
  return 0;
}