#include <bits/stdc++.h>
using namespace std;
bool cmp(const string& s1, const string& s2) { return s1 > s2; }
string str(const string& s1, const string& s2, char d) {
  string sm = max(s1 + d, s2 + d);
  string s = min(s1 + d, s2 + d) + sm.substr(0, sm.size() - 1);
  return s;
}
int main() {
  int n;
  cin >> n;
  vector<vector<string> > v(10);
  string s;
  for (int i = 0; i < n; ++i) {
    cin >> s;
    v[s.size() - 1].push_back(s);
  }
  char d;
  cin >> d;
  for (int i = 0; i < v.size(); ++i) {
    sort(v[i].begin(), v[i].end(), cmp);
  }
  int minl = 0;
  int maxl = 9;
  for (int i = 0; i < n / 2; ++i) {
    while (v[minl].empty()) ++minl;
    while (v[maxl].empty()) --maxl;
    if (minl == maxl) {
      s = str(v[minl].back(), v[minl][v[minl].size() - 2], d);
    } else {
      s = str(v[minl].back(), v[maxl].back(), d);
    }
    int used1 = minl, used2 = maxl;
    int mnl = minl;
    int mxl = maxl;
    string s1;
    while (mnl < mxl) {
      if (!v[mnl].empty() && !v[mxl].empty()) {
        s1 = str(v[mnl].back(), v[mxl].back(), d);
        if (s1 < s) {
          s = s1;
          used1 = mnl;
          used2 = mxl;
        }
      }
      ++mnl;
      --mxl;
    }
    if (mnl == mxl && !v[mxl].empty() &&
        (s1 = str(v[mnl].back(), v[mxl][v[mxl].size() - 2], d)) < s) {
      cout << s1 << endl;
      v[mnl].pop_back();
      v[mnl].pop_back();
    } else {
      cout << s << endl;
      v[used1].pop_back();
      v[used2].pop_back();
    }
  }
}
