#include <iostream>
#include <math.h>
using namespace std;
int main()
{
int n;
cin >> n; //ввод условий
int K[n];
for (int i=0;i<n;i++)
{
cin >> K[i];
}
int L[n]; //описание массивов и счетчиков
int M[n];
int l=0;
int m=0;
for (int i=0;i<n;i++)
{
if (K[i]%2==0) // проверка четности
{
L[l]=K[i];
l++;
}
else
{
M[m]=K[i];
m++;
}
}
cout << "num of L=" << l << endl;
cout << "L:";
for (int i=0;i<l;i++)
{
cout << L[i] << " ";
}
cout << endl;
cout << "num of M=" << m << endl;
cout << "M:";
for (int i=0;i<m;i++)
{
cout << M[i] << " ";
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8bWF0aC5oPgoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmludCBtYWluKCkKewogICAgaW50IG47CiAgICBjaW4gPj4gbjsgLy/QstCy0L7QtCDRg9GB0LvQvtCy0LjQuQogICAgaW50IEtbbl07CiAgICBmb3IgKGludCBpPTA7aTxuO2krKykKICAgIHsKICAgICAgICBjaW4gPj4gS1tpXTsKICAgIH0KICAgIGludCBMW25dOyAvL9C+0L/QuNGB0LDQvdC40LUg0LzQsNGB0YHQuNCy0L7QsiDQuCDRgdGH0LXRgtGH0LjQutC+0LIKICAgIGludCBNW25dOwogICAgaW50IGw9MDsKICAgIGludCBtPTA7CiAgICBmb3IgKGludCBpPTA7aTxuO2krKykKICAgIHsKICAgICAgICBpZiAoS1tpXSUyPT0wKSAvLyDQv9GA0L7QstC10YDQutCwINGH0LXRgtC90L7RgdGC0LgKICAgICAgICB7CiAgICAgICAgICAgIExbbF09S1tpXTsKICAgICAgICAgICAgbCsrOwogICAgICAgIH0KICAgICAgICBlbHNlCiAgICAgICAgewogICAgICAgICAgICBNW21dPUtbaV07CiAgICAgICAgICAgIG0rKzsKICAgICAgICB9CiAgICB9CiAgICBjb3V0IDw8ICJudW0gb2YgTD0iIDw8IGwgPDwgZW5kbDsKICAgIGNvdXQgPDwgIkw6IjsKICAgIGZvciAoaW50IGk9MDtpPGw7aSsrKQogICAgewogICAgICAgIGNvdXQgPDwgTFtpXSA8PCAiICI7CiAgICB9CiAgICBjb3V0IDw8IGVuZGw7CiAgICBjb3V0IDw8ICJudW0gb2YgTT0iIDw8IG0gPDwgZW5kbDsKICAgIGNvdXQgPDwgIk06IjsKICAgIGZvciAoaW50IGk9MDtpPG07aSsrKQogICAgewogICAgICAgIGNvdXQgPDwgTVtpXSA8PCAiICI7CiAgICB9CiAgICByZXR1cm4gMDsKfQo=