#include <bits/stdc++.h>
using namespace std;
string out[21];
int lens[11];
int vis[100000];
int main() {
  int i, j, n, len;
  char del;
  cin >> n;
  vector<string> fil(n, "");
  for (i = 0; i < n; i++) {
    cin >> fil[i];
    lens[fil[i].size()]++;
  }
  cin >> del;
  sort(fil.begin(), fil.end());
  for (len = 2; len <= 20; len++) {
    for (j = 1; j <= 10; j++)
      if (lens[j])
        if (!(len > j && lens[len - j] == lens[j])) break;
    if (j <= 10) continue;
    memset(vis, 0, sizeof(vis));
    vector<string> w;
    for (i = 0; i < n; i++)
      if (!vis[i]) {
        j = i + 1;
        while (vis[j] || fil[j].size() != len - fil[i].size()) j++;
        vis[j] = 1;
        string s1 = fil[i] + del + fil[j], s2 = fil[j] + del + fil[i];
        if (s1 < s2)
          w.push_back(s1);
        else
          w.push_back(s2);
      }
    sort(w.begin(), w.end());
    for (i = 0; i < w.size(); i++) out[len] += w[i];
  }
  string res;
  int d;
  for (i = 2; i <= 20; i++)
    if (out[i] != "" && (res == "" || res > out[i])) res = out[i], d = i + 1;
  string s;
  for (j = 0; j < res.size(); j++) {
    s += res[j];
    if ((j + 1) % d == 0) {
      cout << s << endl;
      s = "";
    }
  }
  return 0;
}
