#include <bits/stdc++.h>
using namespace std;
const int A7MED = 0xA73ED;
pair<string, int> ar[A7MED];
string d;
set<pair<string, int> > szBased[20];
int cnt;
bool used[A7MED];
vector<string> ans;
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> ar[i].first;
    ar[i].second = i;
    int sz = ar[i].first.size();
    szBased[sz].insert(ar[i]);
    cnt += sz;
  }
  sort(ar, ar + n);
  cin >> d;
  int perLine = 2 * cnt / n;
  for (int i = 0; i < n; i++) {
    if (used[ar[i].second]) continue;
    int f = ar[i].first.size();
    szBased[f].erase(szBased[f].begin());
    string c1 = ar[i].first + d + (szBased[perLine - f].begin())->first;
    string c2 = (szBased[perLine - f].begin())->first + d + ar[i].first;
    if (c1 < c2)
      ans.push_back(c1);
    else
      ans.push_back(c2);
    used[ar[i].second] = used[(szBased[perLine - f].begin())->second] = 1;
    szBased[perLine - f].erase(szBased[perLine - f].begin());
  }
  sort(ans.begin(), ans.end());
  for (int i = 0; i < ans.size(); i++) cout << ans[i] << '\n';
}
