#include <bits/stdc++.h>
using namespace std;
const int maxn = 100005;
string text, p[maxn];
int trie[maxn << 4][26];
int ans[maxn >> 3], val[maxn << 4];
int n, m, cnt, total;
bool ok;
void _insert(int x) {
  int pos = 0;
  for (int i = p[x].size() - 1; i >= 0; --i) {
    int id = tolower(p[x][i]) - 'a';
    if (!trie[pos][id]) trie[pos][id] = cnt++;
    pos = trie[pos][id];
  }
  val[pos] = x;
}
void dfs(int len) {
  if (len == n - 1) {
    for (int i = 0; i < total; ++i)
      cout << p[ans[i]] << (i != total - 1 ? ' ' : '\n');
    ok = true;
    return;
  }
  int pos = 0;
  for (int i = len + 1; !ok && i < n; ++i) {
    int id = text[i] - 'a';
    pos = trie[pos][id];
    if (!pos) break;
    if (val[pos]) {
      ans[total++] = val[pos];
      dfs(len + p[val[pos]].size());
      --total;
    }
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> text >> m;
  cnt = 1;
  for (int i = 1; i <= m; ++i) {
    cin >> p[i];
    _insert(i);
  }
  dfs(-1);
  return 0;
}
