#include <bits/stdc++.h>
using namespace std;
long long a, b, c, k, x, i, d[1005][1005], j, m, n, pfs[1000001], y=0, LmAo;
string s, s1;
map<long long, long long>dem;
int dec2bin(long long k) {
int s=0;
while (k>0){
    if (k%2==0)
        s++;
    k/=2;
}
return s;
}
int main () {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
cin>>c;
for(x=1; x<=c; x++){
    cin>>b;
    cout<<"Case #"<<x<<": "<<(long long)(pow(2, dec2bin(b)))<<"\n";
}
return 0;
}
