#include <bits/stdc++.h>
using namespace std;
long long int gcd(long long int a, long long int b) {
  while (a && b) a > b ? a %= b : b %= a;
  return a + b;
}
long long int lcm(long long int a, long long int b) {
  return (max(a, b) / gcd(a, b)) * min(a, b);
}
long long int power(long long int a, long long int b) {
  long long int res = 1;
  while (b != 0) {
    if (b % 2 != 0) {
      res = (res * a) % 1000000007;
      b--;
    } else {
      a = (a * a) % 1000000007;
      b /= 2;
    }
  }
  return res;
}
int main() {
  ios::sync_with_stdio(0);
  ;
  long long int i, j, k, c = 0, n, m, d = 0, l, r, z, w, e = 0, t, prev, next,
                         mid, x, y;
  cin >> n;
  vector<string> s(n);
  vector<pair<long long int, long long int>> v;
  set<long long int> sp;
  stack<long long int> st;
  queue<long long int> q;
  for (i = 0; i < n; i++) {
    cin >> s[i];
  }
  for (i = 0; i < s[0].size(); i++) {
    map<char, long long int> mp1, mp2;
    c = 0;
    for (j = 0; j < n; j++) {
      if (s[j][i] == '?')
        c++;
      else
        mp1[s[j][i]]++;
    }
    if (c == n)
      cout << "a";
    else if (mp1.size() == 1)
      cout << mp1.begin()->first;
    else
      cout << "?";
  }
  return 0;
}
