import java.util.*;class Main{public static void main(String[]a){Scanner q=new Scanner(System.in);int m,n=q.nextInt();String r,c="";Map<String,Integer>w=new HashMap();for(;n>0;n--){r=q.next();if(w.containsKey(r))w.put(r,1+(int)w.get(r));else w.put(r,1);}StringBuffer s=new StringBuffer();for(String k:new TreeSet<>(w.keySet())){r=new StringBuffer(k).reverse()+"";if(!w.containsKey(r))continue;m=Math.min(w.get(k), w.get(r));w.put(k,0);if(k.equals(r)){if(m%2==1&&(c.isEmpty()||k.compareTo(c)<0))c=k;m/=2;}for(;m>0;m--)s.append(k);}System.out.println(s+c+s.reverse());}}

@@ -12,16 +12,17 @@
 .util.*;
+%0A
 class Ma
@@ -23,17 +23,23 @@
 ass Main
-%7B
+ %7B%0A    
 public s
@@ -68,272 +68,266 @@
 %5B%5Da)
-%7BScanner q=new Scanner(System.in);int m,n=q.nextInt();String r,c=%22%22;Map%3CString,Integer%3Ew=new HashMap();for(;n%3E0;n--)%7Br=q.next();if(w.containsKey(r))w.put(r,1+(int)w.get(r));else w.put(r,1);%7DStringBuffer s=new StringBuffer();for(String k:new TreeSet%3C%3E(w.keySet()))%7B
+throws Exception %7B%0A        byte%5B%5Db=new byte%5B20000%5D;System.in.read(b);%0A        String%5B%5Dw=new String(b).split(%22%5C%5Cs%22);%0A        int n=Integer.parseInt(w%5B0%5D),i,j;%0A        String r,x=%22%22,y=x,c=x;%0A        Arrays.sort(w,1,n+1);%0A        for(i=1;i%3C=n;i++)%7B%0A            
 r=ne
@@ -341,17 +341,20 @@
 gBuffer(
-k
+w%5Bi%5D
 ).revers
@@ -360,214 +360,198 @@
 se()
-+%22%22;if(!w.containsKey(r))continue;m=Math.min(w.get(k), w.get(r));w.put(k,0);if(k.equals(r))%7Bif(m%252==1&&(c.isEmpty()%7C%7Ck.compareTo(c)%3C0))c=k;m/=2;%7Dfor(;m%3E0;m--)s.append(k);%7DSystem.out.println(s+c+s.reverse());%7D
+.toString();%0A            for(j=i+1;j%3C=n&&!r.equals(w%5Bj%5D);j++);%0A            if(j%3C=n)%7Bx+=w%5Bi%5D;y=r+y;w%5Bj%5D=%22%22;%7Delse if(r.equals(w%5Bi%5D))c+=r;%0A        %7D%0A        System.out.print(x+c+y);       %0A    %7D%0A
 %7D%0A

Update answer.java