output_description: Print the lexicographically smallest string among the longest strings that
  satisfy the condition. If the answer is an empty string, print an empty line.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      n
      S_1
      ...
      S_n
attempt: n = int(input())
  word = [sorted(input()) for _ in range(n)]
  result = []
  word_result = []
  for i in range(len(word) - 1):
      result.append(set(word[i]) & set(word[i + 1]))
  if min(result):
      for i in min(result):
          word_result.append(i * word[0].count(i))
  print("".join(sorted(word_result)))
  
problem_description: Statement
  
  Snuke loves "paper cutting": he cuts out characters from a newspaper headline
  and rearranges them to form another string.
  
  He will receive a headline which contains one of the strings S_1,...,S_n
  tomorrow. He is excited and already thinking of what string he will create.
  Since he does not know the string on the headline yet, he is interested in
  strings that can be created regardless of which string the headline contains.
  
  Find the longest string that can be created regardless of which string among
  S_1,...,S_n the headline contains. If there are multiple such strings, find
  the lexicographically smallest one among them.
samples: [{"input": "3\n    cbaa\n    daacc\n    acacac", "output": "aac\n    \n\nThe strings that can be created from each of `cbaa`, `daacc` and `acacac`, are\n`aa`, `aac`, `aca`, `caa` and so forth. Among them, `aac`, `aca` and `caa` are\nthe longest, and the lexicographically smallest of these three is `aac`.\n\n* * *"}, {"input": "3\n    a\n    aa\n    b", "output": "The answer is an empty string."}]