class Codechef
{
public static void main (String[] args) throws java.lang.Exception
{
Scanner sc=new Scanner(System.in);
int t=sc.nextInt();
while(t–>0)
{
int n=sc.nextInt();
String s=Integer.toString(n,2);
int val=Integer.parseInt(s);
BigInteger bi=new BigInteger("2");
BigInteger ans=bi.pow(val*2);
System.out.println(ans);}
// your code goes here
}
}