#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
#include <map>
using namespace std;
int main()
{
vector<string> s;
int n;
cin>>n;
s.resize(n);
for(auto i:s)cin>>i;
map<char,int> mm;
for(int i=0;i<s[0].size();i++){
for(auto j:s)mm[j[i]]++;
cout<<max_element(mm.begin(),mm.end(),[](pair<char,int> a,pair<char,int> b){return a.second<b.second;})->first;
mm.clear();
};
return 0;
}
I2luY2x1ZGUgPGFsZ29yaXRobT4KI2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RyaW5nPgojaW5jbHVkZSA8dmVjdG9yPgojaW5jbHVkZSA8bWFwPgoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmludCBtYWluKCkKewogICAgdmVjdG9yPHN0cmluZz4gczsKICAgIGludCBuOwogICAgY2luPj5uOwogICAgcy5yZXNpemUobik7CiAgICBmb3IoYXV0byBpOnMpY2luPj5pOwogICAgbWFwPGNoYXIsaW50PiBtbTsKICAgIGZvcihpbnQgaT0wO2k8c1swXS5zaXplKCk7aSsrKXsKICAgICAgICBmb3IoYXV0byBqOnMpbW1baltpXV0rKzsKICAgICAgICBjb3V0PDxtYXhfZWxlbWVudChtbS5iZWdpbigpLG1tLmVuZCgpLFtdKHBhaXI8Y2hhcixpbnQ+IGEscGFpcjxjaGFyLGludD4gYil7cmV0dXJuIGEuc2Vjb25kPGIuc2Vjb25kO30pLT5maXJzdDsKICAgICAgICBtbS5jbGVhcigpOwogICAgICAgIH07CiAgICByZXR1cm4gMDsKfQo=