#include <bits/stdc++.h>
using namespace std;
const long long Long_max = numeric_limits<long long>::max();
const int Int_max = numeric_limits<int>::max();
int dx[] = {1, -1, 0, 0, 1, -1, -1, 1};
int dy[] = {0, 0, -1, 1, 1, -1, 1, -1};
void File_input(string pathIn) { freopen(pathIn.c_str(), "r", stdin); }
void File_output(string pathOut) { freopen(pathOut.c_str(), "w", stdout); }
int msg() {
  srand(time(0));
  vector<string> st = {"Wish everyone high ratings!", "Good luck!", "Have fun!",
                       "Please, read all the problems!", "Go Go fight!"};
  cerr << st[rand() % (int)st.size()];
  return 0;
}
void FastInputOutput() {
  ios_base ::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
int n;
vector<string> ans;
string str;
deque<int> s;
set<int> sm;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> str;
    ans.push_back(str);
    sm.insert((int)str.size());
  }
  for (auto i : sm) s.push_back(i);
  sort(ans.begin(), ans.end());
  deque<string> indx[s.back() + 2];
  for (auto i : ans) indx[(int)i.size()].push_back(i);
  ans.clear();
  char sp;
  cin >> sp;
  while ((int)s.size() - 2 >= 0) {
    int s1 = s.front();
    int s2 = s.back();
    for (int i = 0; i < (int)indx[s2].size(); i++) {
      ans.push_back(indx[s2][i]);
      ans.push_back(indx[s1][i]);
    }
    if ((int)s.size() - 2 >= 0) {
      s.pop_back();
      s.pop_front();
    }
  }
  while ((int)s.size()) {
    for (auto i : indx[s.front()]) ans.push_back(i);
    s.pop_back();
  }
  vector<string> a;
  for (int i = 0; i < n; i += 2) {
    string s3, s4;
    s3 = s4 = "";
    if ((int)ans[i].size() > (int)ans[i + 1].size() && (int)ans[i].size() &&
        (int)ans[i + 1].size()) {
      s3 = s4 = "";
      s3 = ans[i] + sp + ans[i + 1];
      s4 = ans[i + 1] + sp + ans[i];
      if (s3 > s4) swap(s3, s4);
    } else if ((int)ans[i].size() <= (int)ans[i + 1].size() &&
               (int)ans[i].size() && (int)ans[i + 1].size()) {
      s3 = s4 = "";
      s3 = ans[i + 1] + sp + ans[i];
      s4 = ans[i] + sp + ans[i + 1];
      if (s3 > s4) swap(s3, s4);
    }
    a.push_back(s3);
  }
  sort(a.begin(), a.end());
  for (auto i : a) cout << i << "\n";
}
