/* Lucky_Glass */
#include <cstdio>
#include <cstring>
#include <algorithm>

const int N = 105, MOD = 998244353;

inline int add(int a, const int &b) { return (a += b) >= MOD ? a - MOD : a; }
inline int sub(int a, const int &b) { return (a -= b) < 0 ? a + MOD : a; }
inline int mul(const int &a, const int &b) { return int(1ll * a * b % MOD); }
#define ITERON(a, b, fun) a = fun(a, b)

int n;
int dp[2][N * N * 2][N], bino[N][N];

#define f(i, s, k) dp[(i) & 1][(s) + N * N][k]

int main() {
  scanf("%d", &n);
  f(0, 0, 0) = 1;
  for (int i = 1, tmp, sum = 0; i <= n; ++i) {
    scanf("%d", &tmp);
    for (int s = -sum; s <= sum; ++s)
      for (int k = 0; k <= i; ++k)
        f(i, s, k) = 0;
    for (int s = -sum; s <= sum; ++s)
      for (int k = 0; k <= i; ++k) {
        ITERON(f(i, s + tmp, k + 1), mul(f(i - 1, s, k), k + 1), add);
        ITERON(f(i, s - tmp, k), mul(f(i - 1, s, k), i - k), add);
      }
    sum += tmp;
  }
  
  int ans = 0;
  for (int k = 0; k <= n; ++k)
    ITERON(ans, f(n, 0, k), add);
  
  printf("%d\n", ans);
  return 0;
}
#include <bits/stdc++.h>
using i64 = long long;
int main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    int n;
    std::cin >> n;
    std::set<std::tuple<int, int, int>> s;
    std::vector<std::pair<int, int>> a(n);
    for (auto &[x, y] : a) {
        std::cin >> x >> y;
    }
    sort(a.begin(), a.end());
    s.emplace(std::max(abs(a[n - 1].first - a[0].first), abs(a[n - 1].second - a[0].second)), 0, n - 1);
    s.emplace(std::max(abs(a[n - 2].first - a[0].first), abs(a[n - 2].second - a[0].second)), 0, n - 2);
    s.emplace(std::max(abs(a[n - 1].first - a[1].first), abs(a[n - 1].second - a[1].second)), 1, n - 1);
    std::vector<int> id(n);
    iota(id.begin(), id.end(), 0);
    sort(id.begin(), id.end(), [&](int i, int j){
        if (a[i].second == a[j].second) return a[i].first < a[j].first;
        return a[i].second < a[j].second;
    });
    s.emplace(std::max(abs(a[id[n - 1]].first - a[id[0]].first), abs(a[id[n - 1]].second - a[id[0]].second)), id[0], id[n - 1]);
    s.emplace(std::max(abs(a[id[n - 2]].first - a[id[0]].first), abs(a[id[n - 2]].second - a[id[0]].second)), id[0], id[n - 2]);
    s.emplace(std::max(abs(a[id[n - 1]].first - a[id[1]].first), abs(a[id[n - 1]].second - a[id[1]].second)), id[1], id[n - 1]);
    auto x = s.end();
    x--;
    x--;
    std::cout << std::get<0>(*x) << "\n";
    return 0;
}