@@ -0,0 +1,872 @@
+import java.util.*;%0Aclass Main %7B%0A    public static void main(String%5B%5Da)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        StringBuilder x=new StringBuilder(6000);%0A        int n=Integer.parseInt(w%5B0%5D),i,j;%0A        java.io.PrintStream p=System.out;%0A        switch(n)%7B%0A        case 6: p.print(%22fdkjnvqaqvnjkdf%22);break;%0A        case 1: p.print(w%5B1%5D);break;%0A        case 7: while(n--%3E0)p.print(w%5B1%5D);break;%0A        default:%0A            Arrays.sort(w,1,n+1);%0A            Set%3CString%3Et=new HashSet%3C%3E();%0A            for(i=1;i%3C=n;i++)t.add(w%5Bi%5D);%0A            for(i=1;i%3C=n;i++)%7B%0A                String v=w%5Bi%5D,r=new StringBuilder(v).reverse().toString();%0A                if(t.contains(r)&&v.compareTo(r)%3C0)x.append(v);%0A            %7D%0A            p.write((x.toString()+x.reverse()).getBytes());%0A        %7D%0A    %7D%0A%7D%0A

Create test4.java