#include<iostream>
#include<cmath>
#include<bitset>
using namespace std;
int t;
int main(){
cin >> t;
for(int i = 1; i <= t; i++){
int num;
cin >> num;
bitset<32> bs(num);//将数字变为32位二进制字符串
string str = bs.to_string();
int ans;
for(int i = str.length() - 1; i >= 0; i--){
if(str[i] == '1'){
ans = pow(2, str.length() - i - 1);//一定要正确理解题意,人家没要下标
break;
}
}
cout << "Case #" << i << ": " << ans << endl;
}
return 0;
}
//presented by 大吉大利,今晚AC