#include using namespace std; int main() { int N; cin >> N; for (int i = 0; i < N; i++) { unsigned int x; cin >> x; int on = 0; int off = 0; while (x != 0) { if (x & 1) on++; else off++; x >>= 1; } while (on--) x = (x << 1) | 1; x <<= off; cout << x << ' '; } cout << '\n'; }