#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>

#include <set>
#include <map>
#include <iomanip>

using namespace std;

#define rep(i, n) for(long long i = 0; i < (long long)(n); i++)
#define rrep(i, n) for(long long i = (long long)(n - 1); i >= 0; i--)
#define all(x) (x).begin(),(x).end()

using ll = long long;
using ull = unsigned long long;

int main()
{
	int n;
	cin >> n;

	double x0, y0, x2, y2;

	cin >> x0 >> y0 >> x2 >> y2;

	const double PI = 3.14159265358979323846;
	double cx = (x2 + x0) / 2.0, cy = (y2 + y0) / 2.0;
	double l = sqrt(pow(cx - x0, 2) + pow(cy - y0, 2));

	auto dir = atan2(y0 - cy, x0 - cx);
	dir += 2 * PI / n;

	cout << fixed << setprecision(30);
	cout << cx + cos(dir) * l << " " << cy + sin(dir) * l << endl;

	return 0;
}

#define DEBUG 0

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

#if DEBUG
// basic debugging macros
int __i__,__j__;
#define printLine(l) for(__i__=0;__i__<l;__i__++){cout<<"-";}cout<<endl
#define printLine2(l,c) for(__i__=0;__i__<l;__i__++){cout<<c;}cout<<endl
#define printVar(n) cout<<#n<<": "<<n<<endl
#define printArr(a,l) cout<<#a<<": ";for(__i__=0;__i__<l;__i__++){cout<<a[__i__]<<" ";}cout<<endl
#define print2dArr(a,r,c) cout<<#a<<":\n";for(__i__=0;__i__<r;__i__++){for(__j__=0;__j__<c;__j__++){cout<<a[__i__][__j__]<<" ";}cout<<endl;}
#define print2dArr2(a,r,c,l) cout<<#a<<":\n";for(__i__=0;__i__<r;__i__++){for(__j__=0;__j__<c;__j__++){cout<<setw(l)<<setfill(' ')<<a[__i__][__j__]<<" ";}cout<<endl;}

// advanced debugging class
// debug 1,2,'A',"test";
class _Debug {
    public:
        template<typename T>
        _Debug& operator,(T val) {
            cout << val << endl;
            return *this;
        }
};
#define debug _Debug(),
#else
#define printLine(l)
#define printLine2(l,c)
#define printVar(n)
#define printArr(a,l)
#define print2dArr(a,r,c)
#define print2dArr2(a,r,c,l)
#define debug
#endif

// define
#define MAX_VAL 999999999
#define MAX_VAL_2 999999999999999999LL
#define EPS 1e-6
#define mp make_pair
#define pb push_back

// typedef
typedef unsigned int UI;
typedef long long int LLI;
typedef unsigned long long int ULLI;
typedef unsigned short int US;
typedef pair<int,int> pii;
typedef pair<LLI,LLI> plli;
typedef vector<int> vi;
typedef vector<LLI> vlli;
typedef vector<pii> vpii;
typedef vector<plli> vplli;

// ---------- END OF TEMPLATE ----------
#define MOD 998244353

int W[100],fact[1000];
int dp[2][10001][101];
int main() {
    int i;
    int N;
    scanf("%d",&N);
    for (i = 0; i < N; i++) scanf("%d",&W[i]);

    int j,k;
    int sum = 0;
    dp[1][0][0] = 1;
    fact[0] = 1;
    for (i = 1; i < 1000; i++) fact[i] = ((LLI) i*fact[i-1]) % MOD;
    for (i = 0; i < N; i++) {
        int p = i & 1;
        sum += W[i];
        for (j = 0; j <= sum; j++) {
            for (k = 0; k <= i+1; k++) {
                dp[p][j][k] = dp[!p][j][k];
                if ((j-W[i] >= 0) && (k > 0)) {
                    dp[p][j][k] += dp[!p][j-W[i]][k-1];
                    if (dp[p][j][k] >= MOD) dp[p][j][k] -= MOD;
                }
            }
        }
    }
    LLI ans = 0;
    if (!(sum & 1)) {
        i = sum/2;
        for (j = 0; j <= N; j++) {
            ans += (((LLI) dp[(N-1) & 1][i][j]*fact[j]) % MOD)*fact[N-j];
            ans %= MOD;
        }
    }
    cout << ans << endl;

    return 0;
}

