@@ -0,0 +1,1018 @@
+import java.util.*;%0A%0Apublic class Main %7B%0A    public static void main(String%5B%5D args) %7B%0A        Scanner q = new Scanner(System.in);%0A        int n = q.nextInt();%0A        Map%3CString, Integer%3E w = new HashMap%3C%3E();%0A        for (; n %3E 0; n--) %7B%0A            String k = q.next();%0A            if (w.containsKey(k))%0A                w.put(k, 1+(int)w.get(k));%0A            else%0A                w.put(k,1);%0A        %7D%0A        StringBuffer s = new StringBuffer();%0A        String c = %22%22;%0A        for (String k : new TreeSet%3C%3E(w.keySet())) %7B%0A            String r = new StringBuffer(k).reverse().toString();%0A            if (!w.containsKey(r))%0A                continue;%0A            int m = Math.min(w.get(k), w.get(r));%0A            w.put(k,0);%0A            if (k.equals(r)) %7B%0A                if (m %25 2 == 1 && (c.isEmpty() %7C%7C k.compareTo(c) %3C 0))%0A                    c = k;%0A                m /= 2;%0A            %7D%0A            for (; m %3E 0; m--)%0A                s.append(k);%0A        %7D%0A        System.out.println(s + c + s.reverse());%0A    %7D%0A%7D%0A

Create answer.java