#include <bits/stdc++.h>
using namespace std;
void solutionD();
int main() {
  ios_base::sync_with_stdio(false);
  solutionD();
  return EXIT_SUCCESS;
}
long long n;
string s[10000];
char d;
struct cmp {
  bool operator()(const string& a, const string& b) {
    for (long long i = 0; i < min(a.size(), b.size()); ++i)
      if (a[i] != b[i]) return a[i] < b[i];
    if (a.size() < b.size()) {
      return d < b[a.size()];
    } else if (a.size() > b.size()) {
      return d > a[b.size()];
    } else
      return false;
  }
};
void solve() {
  map<long long, multiset<string, cmp>> c;
  long long k = 0;
  for (long long i = 0; i < n; ++i) {
    c[s[i].size()].insert(s[i]);
    k += s[i].size();
  }
  k /= n / 2;
  multiset<string, cmp> t;
  for (long long i = 0; i < n; ++i) t.insert(s[i]);
  for (long long i = 0; i < n / 2; ++i) {
    s[i * 2] = *t.begin();
    long long j = s[i * 2].size();
    c[j].erase(c[j].find(s[i * 2]));
    s[i * 2 + 1] = *c[k - j].begin();
    c[k - j].erase(c[k - j].find(s[i * 2 + 1]));
    cout << s[i * 2] << d << s[i * 2 + 1] << '\n';
    t.erase(t.find(s[i * 2]));
    t.erase(t.find(s[i * 2 + 1]));
  }
}
void solutionD() {
  for (; cin >> n;) {
    for (long long i = 0; i < n; ++i) cin >> s[i];
    cin >> d;
    solve();
    cerr << endl;
  }
}
