#include <bits/stdc++.h>
using namespace std;
void asciii() {
  for (int i = 33; i < 127; i++) {
    cout << (char)i << endl;
  }
}
string concate(string a, string b, string c) {
  string ret1 = a + c + b;
  string ret2 = b + c + a;
  return min(ret1, ret2);
}
int vis[10004];
int begvs2[15];
int main() {
  int n;
  string s, c;
  vector<string> vs, vs2[15], ans;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> s;
    vs.push_back(s);
  }
  cin >> c;
  sort(vs.begin(), vs.end());
  int maxlen = 0, minlen = 30;
  for (int i = 0; i < n; i++) {
    vs2[vs[i].size()].push_back(vs[i]);
    maxlen = max(maxlen, (int)vs[i].size());
    minlen = min(minlen, (int)vs[i].size());
  }
  int mx = maxlen + minlen;
  map<string, int> M;
  int indx = 0;
  for (int i = 0; i < n; i++) {
    if (!M[vs[i]]) {
      M[vs[i]] = ++indx;
      int req = mx - vs[i].size();
      int curpos = begvs2[req];
      for (int j = curpos; j < vs2[req].size(); j++) {
        if (!M[vs2[req][j]]) {
          M[vs2[req][j]] = ++indx;
          ans.push_back(concate(vs[i], vs2[req][j], c));
          begvs2[req] = j + 1;
          break;
        }
      }
    }
  }
  sort(ans.begin(), ans.end());
  for (int i = 0; i < ans.size(); i++) {
    cout << ans[i] << endl;
  }
  return 0;
}
