#include <bits/stdc++.h>
using namespace std;
int L, c[10005];
string a[10005], s;
inline bool cmp(string &p, string &q) { return p + s < q + s; }
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    L += a[i].size();
  }
  cin >> s;
  L /= (n / 2);
  sort(a, a + n, cmp);
  for (int i = 0; i < n; i++) {
    if (!c[i]) {
      for (int j = i + 1; j < n; j++) {
        if (!c[j] && a[i].size() + a[j].size() == L) {
          c[i] = c[j] = 1;
          cout << a[i] << s << a[j] << "\n";
          break;
        }
      }
    }
  }
}
