// Starcraft 2 enjoyer //
#include <bits/stdc++.h>
// #pragma GCC target("avx2")
// #pragma GCC optimize("O3")
// #pragma GCC optimize("unroll-loops")
using namespace std;
#define LSOne(X) ((X) & -(X))
#define int long long
const int N = 5e2 + 5;
const int M = 15e5;
const int B = 18;
const long long K = 2;
const int LG = 60;
const long long INF = 1e18 + 5;
const int C = 26;
const int MOD = 1e9 + 7;
int n, a[N], cnt[M], sum;
bitset<M> dp;
vector<int> v;
inline void solve()
{
cin >> n;
sum = 0;
dp.set(0);
for (int x = 0; x < n; x++)
{
cin >> a[x];
sum += a[x];
dp = dp | (dp << a[x]);
}
if (sum % 2 == 1)
{
cout << 0;
return;
}
else if (!dp[sum / 2])
{
cout << 0;
return;
}
for (int x = 1; x <= n / B + 2; x++)
{
if ((x - 1) * B >= n)
break;
dp.reset();
dp.set(0);
for (int y = x * B; y < n; y++)
{
dp = dp | (dp << a[y]);
}
for (int y = 0; y < (x - 1) * B; y++)
{
dp = dp | (dp << a[y]);
}
bitset<M> cur;
for (int y = (x - 1) * B; y < min(x * B, n); y++)
{
cur = dp;
for (int z = (x - 1) * B; z < min(x * B, n); z++)
{
if (z == y)
continue;
cur = cur | (cur << a[z]);
}
for (int z = 0; z < M; z++)
{
if (sum - a[y] - z < z)
break;
if (cur[z])
{
cnt[sum - a[y] - 2 * z]++;
}
}
}
}
for (int x = 0; x < M; x++)
{
if (cnt[x] == n)
{
v.push_back(x);
}
}
cout << v.size() << "\n";
for (int i : v)
cout << i << " ";
}
signed main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int t = 1;
// cin >> t;
for (int x = 1; x <= t; x++)
{
solve();
}
return 0;
}