import java.util.*;
import java.lang.*;
import java.io.*;
class Ideone
{
public static void main
(String[] args
) {
int n;
Scanner sc
= new Scanner
(System.
in); n = sc.nextInt(); //ввод условий
int[] K = new int[n];
for (int i = 0;i < n;i++)
{
K[i] = sc.nextInt();
}
int[] L = new int[n]; //описание массивов и счетчиков
int[] M = new int[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++;
}
}
System.
out.
printf("num of L=%d\n",l
); for (int i = 0; i < l; i++)
{
System.
out.
printf("%d ",L
[i
]); }
System.
out.
printf("num of M=%d\n",m
); for (int i = 0; i < m; i++)
{
System.
out.
printf("%d ",M
[i
]); }
}
}
aW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgpjbGFzcyBJZGVvbmUKewoJcHVibGljIHN0YXRpYyB2b2lkIG1haW4gKFN0cmluZ1tdIGFyZ3MpIAoJewoJCWludCBuOwoJCVNjYW5uZXIgc2MgPSBuZXcgU2Nhbm5lcihTeXN0ZW0uaW4pOwoJCW4gPSBzYy5uZXh0SW50KCk7IC8v0LLQstC+0LQg0YPRgdC70L7QstC40LkKCSAgICBpbnRbXSBLID0gbmV3IGludFtuXTsKCSAgICBmb3IgKGludCBpID0gMDtpIDwgbjtpKyspCgkgICAgewoJICAgICAgICBLW2ldID0gc2MubmV4dEludCgpOwoJICAgIH0KCSAgICBpbnRbXSBMID0gbmV3IGludFtuXTsgLy/QvtC/0LjRgdCw0L3QuNC1INC80LDRgdGB0LjQstC+0LIg0Lgg0YHRh9C10YLRh9C40LrQvtCyCgkgICAgaW50W10gTSA9IG5ldyBpbnRbbl07CgkgICAgaW50IGw9MDsKCSAgICBpbnQgbT0wOwoJICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbjsgaSsrKQoJICAgIHsKCSAgICAgICAgaWYgKEtbaV0gJSAyID09IDApIC8vINC/0YDQvtCy0LXRgNC60LAg0YfQtdGC0L3QvtGB0YLQuAoJICAgICAgICB7CgkgICAgICAgICAgICBMW2xdID0gS1tpXTsKCSAgICAgICAgICAgIGwrKzsKCSAgICAgICAgfQoJICAgICAgICBlbHNlCgkgICAgICAgIHsKCSAgICAgICAgICAgIE1bbV0gPSBLW2ldOwoJICAgICAgICAgICAgbSsrOwoJICAgICAgICB9CgkgICAgfQoJICAgIFN5c3RlbS5vdXQucHJpbnRmKCJudW0gb2YgTD0lZFxuIixsKTsKCSAgICBTeXN0ZW0ub3V0LnByaW50ZigiTDoiKTsKCSAgICBmb3IgKGludCBpID0gMDsgaSA8IGw7IGkrKykKCSAgICB7CgkgICAgCVN5c3RlbS5vdXQucHJpbnRmKCIlZCAiLExbaV0pOwoJICAgIH0KCSAgICBTeXN0ZW0ub3V0LnByaW50bG4oKTsKCSAgICBTeXN0ZW0ub3V0LnByaW50ZigibnVtIG9mIE09JWRcbiIsbSk7CgkgICAgU3lzdGVtLm91dC5wcmludGYoIk06Iik7CgkgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBtOyBpKyspCgkgICAgewoJICAgICAgICBTeXN0ZW0ub3V0LnByaW50ZigiJWQgIixNW2ldKTsKCSAgICB9Cgl9Cn0=