#include
#include
#include
using namespace std;
int main() {
ifstream fi;
ofstream fo;
fi.open("input.txt");
string sd,sw,inp = "";
int i,j;
while(!fi.eof())
{
fi>>i>>j;
if (((i%2==0) && (j%2==0)) || ((i%2==1) && (j%2==1)))
sd=sd+char(i+48)+" "+char(j+48)+" ";
else sw=sw+char(i+48)+" "+char(j+48)+" ";
}
fi.close();
fo.open("output.txt");
fo<<sw<<endl;<br> fo<<sd<<endl;<br> fo.close();
return 0;
}