#include <bits/stdc++.h>
#define ll long long
#define vi vector<int>
#define vl vector<long long>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep_lr(i, f, n) for (int i = f; i < (int)(n); i++)
#define maxe(v) *max_element(v.begin(),v.end())
#define mine(v) *min_element(v.begin(),v.end())
#define sorts(v) sort(v.begin(),v.end())
#define sortg(v) sort(v.begin(),v.end(),greater<int>)
using namespace std;

string replace_all(string &s, string from, string to) {
    ll pos = s.find(from);
    while(true){
      pos = s.find(from, pos);
      if(pos==-1) break;
      s.replace(pos, from.length(), to);
      pos += to.length();
    }
    return s;
}


void solve(){

    setprecision(15);

    int N;
    cin >> N;
    vl x(N);
    rep(i,N){
        cin>>x.at(i);
        x.at(i) = abs(x.at(i));
    }

    ll ans=0;
    rep(i,N){
        ans += x.at(i);
    }
    cout << ans << endl;

    ans = 0;
    rep(i,N){
        ans += pow(x.at(i),2);
    }
    cout << setprecision(20) << sqrtl(ans) << endl;

    cout << maxe(x) << endl;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    solve();
    return 0;
}
#include <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <functional>
#include <iterator>
#include <numeric>
#include <cstdint>
#include <cmath>
#include <bitset>
#include <string>
#include <list>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <random>
#include <chrono>
#include <cassert>

#define N_TIMES(i, n)     for ( uint64_t i = 0;     i <  n; ++i )
#define N_TIMES_REV(i, n) for (  int64_t i = n - 1; i >= 0; --i )

template<typename T>
std::istream& operator>>(std::istream &is, std::vector<T> &v)
{
  for (typename std::vector<T>::size_type i = 0; i < v.size(); ++i) {
    is >> v[i];
  }
  return is;
}

template<typename T>
const T& max(const std::vector<T> &v)
{
  return *std::max_element(v.begin(), v.end());
}

template<typename T>
const T& min(const std::vector<T> &v)
{
  return *std::min_element(v.begin(), v.end());
}

using namespace std;

ostream& operator<<(ostream &os, const vector<int64_t> &a)
{
  for (vector<int64_t>::size_type i = 0; i < a.size(); ++i) {
    os << a[i];
    if (i + 1 < a.size()) { os << ' '; }
  }
  return os;
}

int main()
{
  uint64_t N;
  cin >> N;

  string S;
  cin >> S;

  vector<int64_t> A(N + 1);
  cin >> A;

  vector<int64_t> D(N, 0);
  N_TIMES(n, N) { D[n] = abs(A[n + 1] - A[n]); }
  int64_t min_D = min(D);

  vector< vector<int64_t> > Bs(min_D, vector<int64_t>(N + 1, 0));
  N_TIMES(n, N + 1) {
    N_TIMES(i, min_D) {
      Bs[i][n] = (A[n] / min_D) + (i < (A[n] % min_D) ? 1 : 0);
    }
  }

  cout << Bs.size() << endl;
  for (const vector<int64_t> &B : Bs) {
    cout << B << endl;
  }

  return 0;
}