#include<iostream>

using namespace std;

int main()

{

int array[10],odd[10],even[10],i,n,j=0,k=0;

cout<<"enter size of array ";

cin>>n;

for(i=0;i<n;i++) //inserting element in array

{

cin>>array[i];

}

for(i=0;i<n;i++)

{

if(array[i]%2==0) // logic to find even

{ even[j]=array[i];

j++;

}

else

{

odd[k]=array[i];

k++;

}

}

cout<<"even : "; //printing even array

for(i=0;i<j;i++) {cout<<even[j]<<" ";}

cout<<"odd : "; //printing odd array

for(i=0;i<k;i++) {cout<<odd[k]<<" ";}

return 0;

}