#include <iostream>
#include <string>
#include <vector>
using namespace std;
int N;
string s;
vector<string> sentence;
int main() {
cin>>N;
cin>>s;
if(N==1) {cout<<s; return 0;}
for(int i=1;i<N;i++)
{
string tmp ="";
cin>>tmp;
sentence.push_back(tmp);
}
for(int j=0;j<N-1;j++){
for(int i=0;i<s.size();i++)
{
if(s[i]!=sentence[j][i]) s[i]='?';
}
}
cout<<s;
}