#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const int PRIME = 97;
const int MAXN = 100100;
vector<int> dp(MAXN, -1);
vector<int> idx(MAXN);
unordered_map<long long, int> rk;
long long calRk(string str) {
  long long res = 0;
  for (int i = 0; i < str.length(); i++) {
    res = res * PRIME + str[i];
  }
  return res;
}
string reverse(const string& str) {
  string res;
  for (int i = str.length() - 1; i >= 0; i--) {
    res += tolower(str[i]);
  }
  return res;
}
int main() {
  cin.sync_with_stdio(0);
  cin.tie(nullptr);
  int n;
  string str, dict;
  cin >> n >> str >> n;
  str = " " + str;
  vector<string> words(n);
  int len = 0;
  for (int i = 0; i < n; i++) {
    cin >> words[i];
    len = max(len, (int)words[i].length());
    rk[calRk(reverse(words[i]))] = i;
  }
  dp[0] = 0;
  for (int i = 0; i < str.length(); i++) {
    if (dp[i] != -1) {
      long long hash = 0;
      for (int j = 1; j <= len && i + j < str.length(); j++) {
        hash = hash * PRIME + str[i + j];
        if (rk.count(hash)) {
          dp[i + j] = i;
          idx[i + j] = rk[hash];
        }
      }
    }
  }
  stack<int> stk;
  if (dp[str.length() - 1] != -1) {
    int pos = str.length() - 1;
    do {
      stk.push(idx[pos]);
      pos = dp[pos];
    } while (pos != 0);
    while (stk.size() > 1) {
      cout << words[stk.top()] << " ";
      stk.pop();
    }
    cout << words[stk.top()] << endl;
  }
  return 0;
}
