#include <bits/stdc++.h>
using namespace std;
string str[111111], str2;
map<int, char> m;
int cnt[26];
int main() {
  int j, n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> str[i];
  int len = str[0].length();
  for (j = 0; j < len; j++) {
    vector<char> v;
    memset(cnt, 0, sizeof(cnt));
    int cnt1 = 0;
    for (int i = 0; i < n; i++) {
      if (str[i][j] != '?') {
        if (!v.size() || v[0] != str[i][j]) v.push_back(str[i][j]);
        if (v.size() == 2) break;
      } else
        ++cnt1;
    }
    if (v.size() == 2)
      cout << '?';
    else if (v.size() == 1)
      cout << v[0];
    else if (cnt1 == n)
      cout << 'x';
    else
      cout << '?';
  }
  return 0;
}
