#include <bits/stdc++.h>
using namespace std;
template <int POS, class TUPLE>
void deploy(std::ostream &os, const TUPLE &tuple) {}
template <int POS, class TUPLE, class H, class... Ts>
void deploy(std::ostream &os, const TUPLE &t) {
  os << (POS == 0 ? "" : ", ") << get<POS>(t);
  deploy<POS + 1, TUPLE, Ts...>(os, t);
}
template <class... Ts>
std::ostream &operator<<(std::ostream &os, const std::tuple<Ts...> &t) {
  os << "(";
  deploy<0, std::tuple<Ts...>, Ts...>(os, t);
  os << ")";
  return os;
}
template <class T>
std::ostream &operator<<(std::ostream &os, std::vector<T> &v) {
  int remain = v.size();
  os << "{";
  for (auto e : v) os << e << (--remain == 0 ? "}" : ", ");
  return os;
}
template <class T>
std::ostream &operator<<(std::ostream &os, std::set<T> &v) {
  int remain = v.size();
  os << "{";
  for (auto e : v) os << e << (--remain == 0 ? "}" : ", ");
  return os;
}
template <class T>
std::ostream &operator<<(std::ostream &os, std::queue<T> q) {
  os << "{";
  for (; !q.empty(); q.pop()) {
    os << q.front() << (q.size() != 1 ? ", " : "}");
  }
  return os;
}
template <class T>
std::ostream &operator<<(std::ostream &os, std::priority_queue<T> q) {
  os << "{";
  for (; !q.empty(); q.pop()) {
    os << q.top() << (q.size() != 1 ? ", " : "}");
  }
  return os;
}
template <class T, class K>
std::ostream &operator<<(std::ostream &os, std::map<T, K> &make_pair) {
  int remain = make_pair.size();
  os << "{";
  for (auto e : make_pair)
    os << "(" << e.first << " -> " << e.second << ")"
       << (--remain == 0 ? "}" : ", ");
  return os;
}
template <class T, class K>
std::ostream &operator<<(std::ostream &os,
                         std::unordered_map<T, K> &make_pair) {
  int remain = make_pair.size();
  os << "{";
  for (auto e : make_pair)
    os << "(" << e.first << " -> " << e.second << ")"
       << (--remain == 0 ? "}" : ", ");
  return os;
}
string s[100100];
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  int n;
  cin >> n;
  string ans;
  for (int i = 0; i < (n); i++) {
    cin >> s[i];
  }
  int x = n;
  int y = ((int)(s[0]).size());
  for (int j = 0; j < (y); j++) {
    bool all_hatena = true;
    char now;
    for (int i = 0; i < (x); i++) {
      if (s[i][j] != '?') {
        all_hatena = false;
        now = s[i][j];
        break;
      }
    }
    if (all_hatena) {
      ans += 'a';
      continue;
    }
    bool OK = true;
    for (int i = 0; i < (x); i++) {
      if (s[i][j] == '?' || s[i][j] == now) {
        ;
      } else {
        OK = false;
        break;
      }
    }
    if (OK) {
      ans += now;
    } else {
      ans += '?';
    }
  }
  cout << ans << "\n";
  return 0;
}
