import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.util.Arrays; import java.util.NoSuchElementException; public class Main { public static void main(String[] args) throws FileNotFoundException { long t = System.currentTimeMillis(); new Main().run(); System.err.println(System.currentTimeMillis() - t); } void run() { FastScanner sc = new FastScanner(); int N=sc.nextInt(); String[] A=new String[N]; for(int i=0;iAB[p].length())continue; if(AB[p].substring(0, AB[q].length()-j).equals(AB[q].substring(j,AB[q].length()))) { update=true; used[q]=true; AB[p]=AB[q].substring(0,j)+AB[p]; continue out; } } //AB[q]がAB[p]に完全に含まれる。 for(int j=0;j<=AB[p].length()-AB[q].length();++j) { if(AB[q].equals(AB[p].substring(j,j+AB[q].length()))) { update=true; used[q]=true; continue out; } } } } } int cnt=0; String ans=""; for(int i=0;i