#include <bits/stdc++.h>
using namespace std;
int n;
int a[111111];
int ans[111111];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
  for (int i = 30; i >= 0; --i) {
    int tmp = 1 << i;
    int aa = tmp - 1, cnt = 0;
    for (int j = 1; j <= n; ++j) {
      if (a[j] & tmp) {
        aa = aa & (a[j] & (tmp - 1));
        cnt++;
      }
    }
    if (aa == 0 && cnt >= 1) {
      int tt = 0;
      for (int j = 1; j <= n; ++j)
        if (a[j] & tmp) ans[++tt] = a[j];
      sort(ans + 1, ans + 1 + cnt);
      cnt = unique(ans + 1, ans + 1 + cnt) - ans - 1;
      printf("%d\n", cnt);
      for (int j = 1; j <= cnt; ++j) printf(j < cnt ? "%d " : "%d\n", ans[j]);
      return 0;
    }
  }
}
