## https://yukicoder.me/problems/no/1443 def main(): N = int(input()) A = list(map(int, input().split())) maxa = max(A) k = 0 while (1 << k) < maxa: k += 1 answer = [0] * N a_set = {0} for i in range(N): a = A[i] new_a_set = set() for b in a_set: new_a_set.add(a + b) new_a_set.add(a & b) answer[i] = len(new_a_set) a_set = new_a_set for i in range(N): print(answer[i]) if __name__ == "__main__": main()