#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  string s[100010];
  for (long long i = 0; i < n; i++) cin >> s[i];
  int si = s[0].size();
  char res[100010];
  for (long long i = 0; i < si; i++) {
    set<char> ss;
    char c;
    for (long long j = 0; j < n; j++)
      if (isalpha(s[j][i])) {
        ss.insert(s[j][i]);
        c = s[j][i];
      }
    if (ss.size() == 0)
      res[i] = 'x';
    else if (ss.size() > 1)
      res[i] = '?';
    else
      res[i] = c;
  }
  for (long long i = 0; i < si; i++) cout << res[i];
  return 0;
}
