#include <bits/stdc++.h>
using namespace std;
int n, c;
string s[10022];
map<int, set<string>> k;
char d;
map<string, int> vis;
bool com(string i, string j) {
  if (i + d < j + d) return 1;
  return 0;
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> s[i];
    int l = s[i].size();
    c += l;
    k[l].insert(s[i]);
  }
  cin >> d;
  sort(s + 1, s + n + 1, com);
  c /= (n / 2);
  for (int i = 1; i <= n; i++) {
    int l = s[i].size();
    if (vis[s[i]] == 0) {
      auto it = k[c - l].begin();
      while (1) {
        if (*it != s[i]) {
          cout << s[i] << d << *it << endl;
          vis[s[i]] = 1;
          vis[*it] = 1;
          k[c - l].erase(it);
          k[l].erase(k[l].begin());
          break;
        }
        it++;
      }
    }
  }
  return 0;
}
