import java.util.*;
class Main{
public static void main
(String[] args
){ Scanner in
= new Scanner
(System.
in); long q, x, res, two;
q = in.nextInt();
for(long i = 0; i < q; ++ i){
x = in.nextLong();
res = 0;
two = 1; // two = 2^0
while(x > 0){
if(x % 2 == 0) // check if the last bit is equal to zero
res += two;
x >>= 1; // moving to the next bit
two <<= 1; // same as two *= 2
}
}
}
}
aW1wb3J0IGphdmEudXRpbC4qOwoKY2xhc3MgTWFpbnsKCXB1YmxpYyBzdGF0aWMgdm9pZCBtYWluIChTdHJpbmdbXSBhcmdzKXsKCQlTY2FubmVyIGluID0gbmV3IFNjYW5uZXIoU3lzdGVtLmluKTsKCQlsb25nIHEsIHgsIHJlcywgdHdvOyAKCQlxID0gaW4ubmV4dEludCgpOwoJCWZvcihsb25nIGkgPSAwOyBpIDwgcTsgKysgaSl7CgkJCXggPSBpbi5uZXh0TG9uZygpOwoJCQlyZXMgPSAwOwoJCQl0d28gPSAxOyAvLyB0d28gPSAyXjAKCQkJd2hpbGUoeCA+IDApewoJCQkJaWYoeCAlIDIgPT0gMCkgLy8gY2hlY2sgaWYgdGhlIGxhc3QgYml0IGlzIGVxdWFsIHRvIHplcm8KCQkJCQlyZXMgKz0gdHdvOwoJCQkJeCA+Pj0gMTsJLy8gbW92aW5nIHRvIHRoZSBuZXh0IGJpdAoJCQkJdHdvIDw8PSAxOyAvLyBzYW1lIGFzIHR3byAqPSAyCgkJCX0KCQkJU3lzdGVtLm91dC5wcmludGxuKHJlcyk7CgkJfQoJfQp9