#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-9;
const int INF = 1 << 30;
const long long LINF = 1ll << 60;
const int BUFFER_SZ = 1 << 15;
const int MOD = 1000 * 1000 * 1000 + 7;
char BUFFER[BUFFER_SZ];
int gi() {
  int x;
  scanf("%d", &x);
  return x;
}
double gd() {
  double x;
  scanf("%lf", &x);
  return x;
}
long long gll() {
  long long x;
  cin >> x;
  return x;
}
vector<int> gvi(int n) {
  vector<int> a;
  while (n-- > 0) a.push_back(gi());
  return a;
}
string gs() {
  scanf("%s", BUFFER);
  return string(BUFFER);
}
template <class T>
void print(vector<T> &x, string format) {
  format += "%c";
  for (int i = 0; i < x.size(); ++i)
    printf(format.c_str(), x[i], i + 1 == x.size() ? '\n' : ' ');
}
int dp[50][10][10][10][2][2][2][2];
vector<int> dpP[50][10][10][10][2][2][2][2];
vector<int> a, b, c;
int go(int pos, int p1, int p2, int p3, int nz1, int nz2, int nz3, int carry) {
  int &r = dp[pos][p1][p2][p3][nz1][nz2][nz3][carry];
  if (r == -1) {
    r = 1 << 20;
    if (pos > 40) return r;
    if (!carry && a.size() == p1 && b.size() == p2 && c.size() == p3)
      return r = 0;
    for (int d1 = 0; d1 < 10; ++d1) {
      for (int d2 = 0; d2 < 10; ++d2) {
        for (int cr = 0; cr < 2; ++cr) {
          if (carry && d1 + d2 + cr < 10) continue;
          if (!carry && d1 + d2 + cr >= 10) continue;
          int pp1 = p1;
          if (p1 < a.size() && a[p1] == d1) ++pp1;
          int pp2 = p2;
          if (p2 < b.size() && b[p2] == d2) ++pp2;
          int v = (d1 + d2 + cr) % 10;
          int pp3 = p3;
          if (p3 < c.size() && c[p3] == v) ++pp3;
          int nnz1 = (d1 > 0 || nz1) ? 1 : 0;
          int nnz2 = (d2 > 0 || nz2) ? 1 : 0;
          int nnz3 = (v > 0 || nz3) ? 1 : 0;
          int rr = go(pos + 1, pp1, pp2, pp3, nnz1, nnz2, nnz3, cr) + nnz1 +
                   nnz2 + nnz3;
          if (rr < r) {
            dpP[pos][p1][p2][p3][nz1][nz2][nz3][carry] = {
                d1, d2, v, pp1, pp2, pp3, nnz1, nnz2, nnz3, cr};
            r = rr;
          }
        }
      }
    }
  }
  return r;
}
set<string> A[21];
int main() {
  int n = gi();
  vector<string> W;
  int L = 0;
  for (int i = 0; i < n; ++i) {
    string s = gs();
    L += s.size();
    W.push_back(s);
    A[s.size()].insert(s);
  }
  L /= n / 2;
  string sep = gs();
  vector<string> pairs;
  for (int i = 1; i <= 10; ++i) {
    if (L - i <= 0 || L - i > 10) continue;
    while (A[i].size()) {
      string a = *A[i].begin();
      A[i].erase(A[i].begin());
      string b = *A[L - i].begin();
      A[L - i].erase(A[L - i].begin());
      if (a + sep + b > b + sep + a) {
        swap(a, b);
      }
      pairs.push_back(a + sep + b);
    }
  }
  sort((pairs).begin(), (pairs).end());
  for (string s : pairs) printf("%s\n", s.c_str());
  return 0;
}
