#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<string> v(n);
  for (int i = 0; i < n; i++) cin >> v[i];
  for (int j = 0; j < v[0].size(); j++) {
    char letter;
    bool flag = 0;
    for (int i = 0; i < n; i++) {
      if (!flag && v[i][j] != '?') {
        flag = 1;
        letter = v[i][j];
      } else if (flag && v[i][j] != '?' && v[i][j] != letter)
        letter = '?';
    }
    if (!flag)
      cout << "x";
    else
      cout << letter;
  }
  return 0;
}
