#include <bits/stdc++.h>
using namespace std;
long long a, b[100001], d[10001], s[10001];
int main() {
cin >> a;
for (int i = 1; i <= a; i++) {
cin >> b[i];
if (b[i] % 2 == 0) {
s[i] = b[i];
} else {
d[i] = b[i];
}
cout << d[i] << ' ';
cout << s[i] << ' ';
}
return 0;
}