#include <iostream>
#include <fstream>

using namespace std;

int main ()
{
	ifstream f("xuathien1lan.inp");
	long int am[10001], dg[10001],kq[100001];
	int i,n,j,k;
	long int a;
		
	f>>n;
		
	for (i = 0; i<=10000; i++)
	{
		am[i] = 0;
		dg[i] = 0;
	}
	
	for (i = 1;i<=n;i++)
	{
		f>>a;
		if (a>=0) dg[a]++;
		else
			am[(-a)]++;
	}
	f.close();
	
	ofstream g("xuathien1lan.out");
	
	j = 0;
	
	for (i = 10000;i>0;i--)
	if (am[i]==1) 
	{
		kq[j] = -i;
		j++;
	}
	
	for (i = 0;i<=10000;i++)
	if (dg[i]==1) 
	{
		kq[j] = i;
		j++;
	}
	
	g<<j<<endl;
	if (j>0)
	for (i = 0;i<=j-1;i++)
	g<<kq[i]<<" ";
	
	if (j = 0)
	g<<0;
	
	return 0;
}
