#include <bits/stdc++.h>
using namespace std;
double EPS = 1e-6;
int INF = 2000000000;
long long INFF = 8000000000000000000LL;
string data[10005];
int n;
char lho;
bool sub(string a, string b) {
  if (a.length() < b.length()) swap(a, b);
  string s1 = "";
  string s2 = "";
  for (int(i) = (0); (i) < (b.length()); (i)++) s1 = s1 + a[i];
  for (int(i) = (a.length() - b.length()); (i) < (b.length()); (i)++)
    s2 = s2 + a[i];
  if (s1 == b) return true;
  if (s2 == b) return true;
  return false;
}
bool f(string a, string b) {
  if (sub(a, b)) {
    string coba1 = a + lho + b;
    string coba2 = b + lho + a;
    return (coba1 < coba2);
  }
  return (a < b);
}
bool sudah[10005];
int main() {
  scanf("%d", &n);
  int len = 0;
  for (int(i) = (1); (i) <= (n); (i)++) {
    getchar();
    cin >> data[i];
    len = len + data[i].length();
  }
  len = len / (n / 2);
  cin >> lho;
  sort(data + 1, data + 1 + n, f);
  int ix = 1;
  while (ix <= n) {
    if (!sudah[ix]) {
      printf("%s%c", data[ix].c_str(), lho);
      sudah[ix] = 1;
      for (int(i) = (ix + 1); (i) <= (n); (i)++) {
        if (!sudah[i] && data[ix].length() + data[i].length() == len) {
          sudah[i] = 1;
          printf("%s\n", data[i].c_str());
          break;
        }
      }
    }
    ix++;
  }
  return 0;
}
