#include <bits/stdc++.h>
using namespace std;
struct debugger {
  template <typename T>
  debugger& operator,(const T& v) {
    cerr << v << " ";
    return *this;
  }
} dbg;
int main() {
  int n;
  while (scanf("%d", &n) == 1) {
    string s[n + 5];
    for (int i = 0; i < n; i++) cin >> s[i];
    sort(s, s + n);
    int len = (int)s[0].size();
    string str = "";
    for (int i = 0; i < len; i++) {
      char ch = '?';
      for (int j = n - 1; j >= 0; j--) {
        if (s[j][i] != '?') {
          ch = s[j][i];
          break;
        }
      }
      if (ch == '?')
        str += 'a';
      else {
        int f = 0;
        for (int j = n - 1; j >= 0; j--) {
          if (s[j][i] != '?') {
            if (s[j][i] != ch) {
              f = 1;
              break;
            }
          }
        }
        if (f) ch = '?';
        str += ch;
      }
    }
    cout << str << endl;
  }
  return 0;
}
