#include<iostream> using namespace std; int main(){ int n,c=1; int nums a[100]{0}; int nums b[100]{0}; cin>>n; for(int i=1;i<=n;i++){ cin>>a[i]; b[c]=a[i]; c++; } for(int i=1;i<=n;i++){ if(b[c]%2==0){ cout<<b[c]<<" "; } c--; } cout<<endl; for(int i=1;i<=n;i++){ if(b[c]%2!=0){ cout<<b[c]<<" "; } c--; } }