import java.util.*; //mport java.io.*; // class MyComparator implements Comparator{ // @Override // int compare(String str1,String str2){ // } // } public class Main{ static int INFTY = Integer.MAX_VALUE; public static void main (String args[]){ //初期処理 Scanner sc=new Scanner(System.in); // BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); // try{ // int n = Integer.parseInt(br.readLine()); int n= sc.nextInt(); sc.nextLine(); String T = ""; List str = new LinkedList<>(); for(int i=0;i