#include <bits/stdc++.h>
using namespace std;
const int MOD(1000000007);
const int INF((1 << 30) - 1);
const int MAXN(10005);
vector<string> a[15];
int main() {
  int n;
  scanf("%d", &n);
  int maxlen = -INF, minlen = INF;
  for (int i = 0; i < n; i++) {
    string x;
    cin >> x;
    maxlen = max(maxlen, (int)(x.size()));
    minlen = min(minlen, (int)(x.size()));
    a[(int)(x.size())].push_back(x);
  }
  int len = maxlen + minlen;
  for (int i = 1; i <= 10; i++) sort(a[i].begin(), a[i].end());
  char d;
  scanf(" %c", &d);
  vector<string> ans;
  for (int i = 1; i <= len / 2; i++) {
    if (len - i != i) {
      for (int j = 0; j < a[i].size(); j++) {
        string s1 = a[i][j] + d + a[len - i][j],
               s2 = a[len - i][j] + d + a[i][j];
        if (s1 < s2)
          ans.push_back(s1);
        else
          ans.push_back(s2);
      }
    } else {
      for (int j = 0; j < a[i].size(); j += 2) {
        string s1 = a[i][j] + d + a[i][j + 1], s2 = a[i][j + 1] + d + a[i][j];
        if (s1 < s2)
          ans.push_back(s1);
        else
          ans.push_back(s2);
      }
    }
  }
  sort(ans.begin(), ans.end());
  for (int i = 0; i < ans.size(); i++) cout << ans[i] << endl;
}
