#include <bits/stdc++.h>
using namespace std;
const int inf = (int)1e9;
const int mod = (int)1e9 + 7;
const double pi = acos(-1.0);
const double eps = 1e-9;
string second[100005];
int n;
string ans = "";
int a[200];
int main() {
  scanf("%d\n", &n);
  for (int i = 0; i < n; i++) getline(cin, second[i]);
  for (int i = 0; i < second[0].length(); i++) {
    memset(a, 0, sizeof a);
    for (int j = 0; j < n; j++) {
      a[second[j][i]]++;
    }
    int k = 0;
    char c;
    for (int j = 'a'; j <= 'z'; j++)
      if (a[j]) {
        k++;
        c = (char)(j);
      }
    if (k == 0)
      ans += 'a';
    else if (k == 1)
      ans += c;
    else
      ans += '?';
  }
  cout << ans << endl;
  return 0;
}
