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

const int N = 200005;
const int MOD = 998244353;
int n, sz[N], rt[N], comp;

int get(int u) {
    if (rt[u] == u) {
        return u;
    }
    rt[u] = get(rt[u]);
    return rt[u];
}


void mrg(int u, int v) {
    u = get(u);
    v = get(v);
    if (u == v) {
        return;
    }
    if (sz[v] > sz[u]) {
        swap(u, v);
    }
    comp --;
    rt[v] = rt[u];
    sz[u] += sz[v];
}


int main(int argc, char const *argv[]) {
    cin >> n;
    comp = n;
    for (int i = 1; i <= n; ++i) {
        sz[i] = 1;
        rt[i] = i;
    }
    for (int i = 1; i <= n; ++i) {
        int x;
        cin >> x;
        mrg(i, x);
    }
    int ans = 1;
    for (int i = 0; i < comp; ++i) {
        ans = (2LL * ans) % MOD;
    }
    ans = (1LL * ans + MOD - 1) % MOD;
    cout << ans;
    return 0;
}
#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;

int main(void){
    int N, xbuf;
    cin >> N;
    long long D1buf = 0;
    long long D2buf = 0;
    long long D3buf = 0;
    for(int i=0; i<N; i++){
        cin >> xbuf;
        D1buf += abs(xbuf);
        D2buf += (long long)xbuf * xbuf;
        D3buf = max(D3buf, (long long)abs(xbuf));
    }
    cout << D1buf << endl;
    cout << setprecision(10) << sqrtl(D2buf) << endl;
    cout << D3buf << endl;
    return 0;
}