#include <iostream>
#include <vector>
#include <string>
using namespace std ;
vector<string> w ;
int d[3] ;
int o[6][3] = {{0,1,2},{0,2,1},{1,0,2},{1,2,0},{2,0,1},{2,1,0}} ;
const int s = 6 ;
void recur(int at) {
   if (at == (int)w.size()) {
      int used = d[0] | d[1] | d[2] ;
      int fc = 0 ;
      for (int i=0; i<3; i++) {
         if (i)
            cout << ' ' ;
         for (int j=0; j<26; j++)
            if ((d[i] >> j) & 1)
               cout << (char)('a'+j) ;
         for (int j=__builtin_popcount(d[i]); j<s; j++) {
            while ((used >> fc) & 1)
               fc++ ;
            used |= 1<<fc ;
            cout << (char)('a'+fc) ;
         }
      }
      cout << endl ;
      exit(0) ;
   }
   int od[3] ;
   for (int i=0; i<3; i++)
      od[i] = d[i] ;
   for (int oi=0; oi<6; oi++) {
      int good = 1 ;
      for (int i=0; i<3; i++) {
         d[i] |= 1<<(w[at][o[oi][i]]-'a') ;
         if (__builtin_popcount(d[i]) > s)
            good = 0 ;
      }
      if ((d[0] & d[1]) || (d[0] & d[2]) || (d[1] & d[2]))
         good = 0 ;
      if (good)
         recur(at+1) ;
      for (int i=0; i<3; i++)
         d[i] = od[i] ;
      if (at == 0)
         return ;
   }
}
int main() {
   int n ;
   cin >> n ;
   w.resize(n) ;
   for (auto &s: w)
      cin >> s ;
   recur(0) ;
   cout << 0 << endl ;
}
