#include <bits/stdc++.h>
using namespace std;
const int inf = 2000000000;
static inline int Rint() {
  struct X {
    int dig[256];
    X() {
      for (int i = '0'; i <= '9'; ++i) dig[i] = 1;
      dig['-'] = 1;
    }
  };
  static X fuck;
  int s = 1, v = 0, c;
  for (; !fuck.dig[c = getchar()];)
    ;
  if (c == '-')
    s = 0;
  else if (fuck.dig[c])
    v = c ^ 48;
  for (; fuck.dig[c = getchar()]; v = v * 10 + (c ^ 48))
    ;
  return s ? v : -v;
}
template <typename T>
static inline void cmax(T& a, const T& b) {
  if (b > a) a = b;
}
template <typename T>
static inline void cmin(T& a, const T& b) {
  if (b < a) a = b;
}
const int maxn = 100005;
unsigned data[maxn];
int main() {
  int n = Rint();
  for (int i = 0; i < n; ++i) data[i] = Rint();
  sort(data, data + n);
  n = unique(data, data + n) - data;
  for (int bit = 31; bit >= 0; --bit) {
    int ok = 1;
    vector<int> tmp;
    const unsigned f = 1 << bit;
    unsigned flag = 0;
    for (int j = 0; j < n; ++j)
      if (data[j] & f) {
        flag |= ~(data[j] & (f - 1));
        tmp.push_back(data[j]);
      }
    flag &= f - 1;
    if (flag == f - 1) {
      printf("%d\n", tmp.size());
      for (__typeof((tmp).begin()) it = (tmp).begin(); it != (tmp).end(); ++it)
        printf("%d ", it);
      puts("");
      return 0;
    }
  }
  return 0;
}
