#include <bits/stdc++.h>
using namespace std;
vector<string> poss[11];
int main() {
  int n;
  cin >> n;
  n /= 2;
  int needlen = 0;
  for (int i = 0; i < 2 * n; i++) {
    string s;
    cin >> s;
    poss[s.size()].push_back(s);
    needlen += s.size();
  }
  needlen /= n;
  for (int i = 1; i <= 10; i++) {
    sort(poss[i].rbegin(), poss[i].rend());
  }
  char delim;
  cin >> delim;
  for (int i = 0; i < n; i++) {
    string best = "~";
    int bestj, bestk;
    for (int j = 1; j <= 10; j++) {
      int k = needlen - j;
      if (k >= 1 && k <= 10) {
        if (k != j) {
          if (poss[j].size() && poss[k].size()) {
            string cur = poss[j].back() + delim + poss[k].back();
            if (cur < best) {
              best = cur;
              bestj = j;
              bestk = k;
            }
          }
        } else {
          if (poss[j].size() >= 2) {
            string cur = poss[j].back() + delim + poss[j][poss[j].size() - 2];
            if (cur < best) {
              best = cur;
              bestj = j;
              bestk = k;
            }
          }
        }
      }
    }
    cout << best << endl;
    poss[bestj].pop_back();
    poss[bestk].pop_back();
  }
}
