#include using namespace std; int ans; int f[110],t,n; bool vis[110]; inline int rd() { int x=0;char ch=getchar(); for (;ch<'0'||ch>'9';ch=getchar()); for (;ch>='0'&&ch<='9';ch=getchar()) x=x*10+ch-'0'; return x; } inline void dfs(int x,int y) { if (y==n) { ans++; return; } if (!vis[(x+y)%n]) { vis[(x+y)%n]=true; dfs((x+y)%n,y+1); vis[(x+y)%n]=false; } if (!vis[(x+n-y)%n]) { vis[(x+n-y)%n]=true; dfs((x+n-y)%n,y+1); vis[(x+n-y)%n]=false; } } int main() { f[1]=1; f[2]=2; f[3]=2; f[4]=4; f[5]=2; f[6]=4; f[7]=4; f[8]=8; f[9]=2; f[10]=4; f[11]=6; f[12]=8; f[13]=2; f[14]=8; f[15]=6; f[16]=16; f[17]=2; f[18]=4; f[19]=6; f[20]=8; f[21]=4; f[22]=12; f[23]=6; f[24]=16; f[25]=4; f[26]=4; f[27]=4; f[28]=16; f[29]=2; f[30]=12; f[31]=10; f[32]=32; f[33]=4; f[34]=4; f[35]=8; f[36]=8; f[37]=2; f[38]=12; f[39]=6; f[40]=16; f[41]=2; f[42]=8; f[43]=6; f[44]=24; f[45]=6; f[46]=12; f[47]=8; f[48]=32; f[49]=6; f[50]=8; f[51]=6; f[52]=8; f[53]=2; f[54]=8; f[55]=10; f[56]=32; f[57]=4; f[58]=4; f[59]=6; f[60]=24; f[61]=2; f[62]=20; f[63]=6; f[64]=64; f[65]=6; f[66]=8; f[67]=8; f[68]=8; f[69]=4; f[70]=16; f[71]=6; f[72]=16; f[73]=2; f[74]=4; f[75]=8; f[76]=24; f[77]=14; f[78]=12; f[79]=6; f[80]=32; t=rd(); while (t--) printf("%d\n",f[rd()]); return 0; }