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

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define fi first
#define se second
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const int INF = (1<<30) - 1;
const ll LINF = (1LL<<62) - 1;

int main(){
    int n;
    cin >> n;
    ll res1 = 0;
    ll res2 = 0;
    ll res3 = 0;
    for (int i = 0; i < n; ++i) {
        ll x;
        cin >> x;
        res1 += abs(x);
        res2 += x * x;
        chmax(res3, abs(x));
    }

    cout << res1 << endl;
    cout << fixed << setprecision(10) << sqrt(res2) << endl;
    cout << res3 << endl;
}
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define rrep(ri,n) for(int ri = (int)(n-1); ri >= 0; ri--)
#define rep2(i,x,n) for(int i = (int)(x); i < (int)(n); i++)
#define rrep2(ri,x,n) for(int ri = (int)(n-1); ri >= (int)(x); ri--)
#define repit(itr,x) for(auto itr = x.begin(); itr != x.end(); itr++)
#define rrepit(ritr,x) for(auto ritr = x.rbegin(); ritr != x.rend(); ritr++)
#define ALL(x) x.begin(), x.end()
using ll = long long;
using namespace std;

int main() {
  int n;
  cin >> n;
  vector<tuple<int, int, int>> lr;
  int ans = 0;
  rep(i, n) {
    int t, l, r;
    cin >> t >> l >> r;
    for(auto [pt, pl, pr] : lr) {
      if(pr < l || r < pl) continue;
      if(pr == l) {
        if((pt == 1 || pt == 3) && (t == 1 || t == 2)) {
        } else {
          continue;
        }
      }
      if(r == pl) {
        if((pt == 1 || pt == 2) && (t == 1 || t == 3)) {
        } else {
          continue;
        }
      }
      ans++;
    }
    lr.push_back({t, l, r});
  }
  cout << ans << endl;
  return 0;
}