#include <bits/stdc++.h>
using namespace std;
const long long MAX = 1e7 + 10;
int dx[8] = {1, 0, 0, -1, 1, -1, 1, -1};
int dy[8] = {0, 1, -1, 0, 1, -1, -1, 1};
int main() {
  cin.tie(0);
  cout.tie(0);
  std::ios::sync_with_stdio(false);
  long long n, mx = 0;
  cin >> n;
  vector<string> v(n);
  for (int i = 0; i < n; i++) {
    cin >> v[i];
    long long mxnw = v[i].size();
    mx = max(mx, mxnw);
  }
  for (int i = 0; i < n; i++) {
    while (v[i].size() < mx) {
      v[i].insert(0, "0");
    }
  }
  vector<pair<long long, string> > vv;
  for (int i = 0; i < v.size(); i++) {
    long long c = 0;
    for (int j = 0; j < v[i].size(); j++) {
      if (v[i][j] == '0') c++;
    }
    vv.push_back(make_pair(c, v[i]));
  }
  sort(vv.begin(), vv.end());
  reverse(vv.begin(), vv.end());
  for (int i = 0; i < vv.size(); i++) {
    v[i] = vv[i].second;
  }
  long long k = 0;
  while (mx--) {
    bool ok = 0;
    for (int i = 0; i < v.size(); i++) {
      if (v[i][k] > '0' && ok == 0) {
        ok = 1;
      } else if (v[i][k] > '0' && ok == 1) {
        v.erase(v.begin() + i);
        i--;
      }
    }
    k++;
  }
  cout << v.size() << endl;
  for (int i = 0; i < v.size(); i++) {
    while (v[i][0] == '0' && v[i].size() > 1) v[i].erase(v[i].begin());
    cout << v[i] << " ";
  }
  return 0;
}
