#include <bits/stdc++.h>
using namespace std;
long long a[1000],dem1,dem2,i,n;
int main()
{
cin>>n;
dem1=0;
dem2=0;
for (i=1; i<=n; i++)
{
cin>>a[i];
if (a[i]%2==0) dem1++;
else dem2++;
}
cout<<dem1<<" "<<dem2<<endl;
sort(a+1,a+n+1);
for (i=n; i>=1; i--) cout<<a[i]<<" ";
return 0;
}