import java.util.;
import java.io.;
public class Main{
public static void main(String[] args)throws Exception{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int n = Integer.parseInt(br.readLine());
String[] numStr = br.readLine().split(” “);
int[] nums = new int[n];
for(int i = 0; i < n; i){
nums[i] = Integer.parseInt(numStr[i]);
}
for(int i = 0; i < n; i){
int sum = 0;
while(nums[i] > 0){
nums[i] -= lowbit(nums[i]);
sum++;
}
System.out.print(sum + ” “);
}
}
public static int lowbit(int num){
return num & (-num);
}
}