#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int v = 0;
  string s;
  vector<string> ans;
  vector<pair<int, string> > t;
  for (size_t i = 0; i < n; ++i) {
    cin >> s;
    int cnt = 0;
    for (size_t j = 0; j < s.length(); ++j) {
      if (s[j] != '0') cnt++;
    }
    t.push_back({cnt, s});
  }
  sort(t.begin(), t.end());
  for (int i = 0; i < n; ++i) {
    s = t[i].second;
    size_t j = 0;
    int flag = 0;
    for (j = 0; j < s.length(); ++j) {
      if (s[j] != '0' && !((v >> (s.length() - j - 1)) & 1))
        flag |= (1 << (s.length() - j - 1));
      else if (s[j] != '0')
        break;
    }
    if (j == s.length()) {
      ans.push_back(s);
      v |= flag;
    }
  }
  cout << ans.size() << endl;
  for (size_t i = 0; i < ans.size(); ++i) {
    cout << ans[i] << " ";
  }
}
