#include <bits/stdc++.h>
using namespace std;
enum { MaxDolz = 10 };
int main() {
  vector<string> vsaImena, poDolzini[MaxDolz + 1];
  set<string> used;
  int nasl[MaxDolz + 1];
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    vsaImena.push_back(s);
    poDolzini[s.length()].push_back(s);
  }
  string sep;
  cin >> sep;
  assert(sep.length() == 1);
  int minDolz = -1, maxDolz = 0;
  for (int dolz = 1; dolz <= MaxDolz; ++dolz) {
    auto &v = poDolzini[dolz];
    sort(v.begin(), v.end());
    nasl[dolz] = 0;
    if (v.empty()) continue;
    maxDolz = dolz;
    if (minDolz < 0) minDolz = dolz;
  }
  for (string &s : vsaImena) s.push_back(sep[0]);
  sort(vsaImena.begin(), vsaImena.end());
  for (string &s : vsaImena) {
    s.pop_back();
    if (used.find(s) != used.end()) continue;
    used.insert(s);
    int d1 = s.length();
    int d2 = maxDolz + minDolz - d1;
    auto &v2 = poDolzini[d2];
    int &n2 = nasl[d2];
    bool ok = false;
    while (n2 < v2.size()) {
      const string &t = v2[n2++];
      if (used.find(t) != used.end()) continue;
      used.insert(t);
      ok = true;
      cout << s << sep << t << endl;
      break;
    }
    assert(ok);
  }
  return 0;
}
