#include <bits/stdc++.h>
using namespace std;
const int maxn = 100005;
string a[maxn], b[maxn];
string text;
int n, m;
bool ok;
void dfs(int len, string ans) {
  if (len == n) {
    ans.resize(ans.size() - 1);
    cout << ans << endl;
    ok = true;
    return;
  }
  string t = "";
  for (int i = 0; i < m && !ok; ++i) {
    t = text.substr(len, b[i].size());
    if (t == b[i]) dfs(len + b[i].size(), ans + a[i] + " ");
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> text >> m;
  for (int i = 0; i < m; ++i) {
    cin >> a[i];
    b[i] = a[i];
    transform(b[i].begin(), b[i].end(), b[i].begin(), ::tolower);
    reverse(b[i].begin(), b[i].end());
  }
  dfs(0, "");
  return 0;
}
