#include<bits/stdc++.h>

using namespace std;
int main()
{
    int n;
    int a[57];
    int b[30];
    int cnt = 0;
    int s;
    cin >> n;
    for(int i=0;i<n;i++)
    {  
        cin >> a[i];
    }

    for(int i =1;i<n;i++)
    {
        for(int j=0;j<=n-1-i;j++)
        {
            if(a[j]>a[j+1]) swap(a[j],a[j+1]);
        }
    }
    for(int i =0;i<=n-2;i++)
    {
        for(int j=i+1;j<=n-1;j++)
        {
            s = a[i]+a[j];
            b[s] = 1;
        }
    }
    for(int i =0;i<=26;i++)
    {
        if(b[i]==1) cnt++;
    }
    cout << cnt<<endl;
    for(int i =0;i<=26;i++)
    {
        if (b[i]==1)  cout << i<< " ";
    }
    return 0;
}
/**************************************************************
	Problem: 1334
	User: mariooo
	Language: C++
	Result: Accepted
	Time:7 ms
	Memory:2072 kb
****************************************************************/