import java.io.*; import java.util.*; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(); int n = sc.nextInt(); boolean[][] exists = new boolean[n + 1][1024]; exists[0][0] = true; HashSet prev = new HashSet<>(); StringBuilder sb = new StringBuilder(); for (int i = 1; i <= n; i++) { HashSet next = new HashSet<>(); int a = sc.nextInt(); for (int j = 0; j < 1024; j++) { if (exists[i - 1][j]) { exists[i][a & j] = true; if (a + j >= 1024) { next.add(a + j); } else { exists[i][a + j] = true; } } } for (int x : prev) { exists[i][x & a] = true; next.add(x + a); } prev = next; sb.append(next.size() + getCount(exists[i])).append("\n"); } System.out.print(sb); } static int getCount(boolean[] arr) { int count = 0; for (boolean b : arr) { if (b) { count++; } } return count; } } class Scanner { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(""); public Scanner() throws Exception { } public int nextInt() throws Exception { return Integer.parseInt(next()); } public long nextLong() throws Exception { return Long.parseLong(next()); } public String next() throws Exception { if (!st.hasMoreTokens()) { st = new StringTokenizer(br.readLine()); } return st.nextToken(); } }