#include <bits/stdc++.h>
using namespace std;
const int MAX = 100010;
int lower(int character) {
  if ('a' <= character && character <= 'z') return character;
  return character - 'A' + 'a';
}
struct Trie {
  Trie *link[26];
  int ind;
  Trie(int ind) : ind(ind) {
    for (int i = 0; i < 26; ++i) link[i] = NULL;
  }
} * root;
string S, a[MAX];
int dp[MAX], pre[MAX], ans[MAX], N, M;
void add(string a, int ind) {
  int len = a.size();
  reverse(a.begin(), a.end());
  Trie *q, *p = root;
  for (int i = 0, j; i < len; ++i) {
    j = lower(a[i]) - 'a';
    q = p->link[j];
    if (q == NULL) p->link[j] = q = new Trie(-1);
    p = q;
  }
  p->ind = ind;
}
void openFile() { freopen("in.inp", "r", stdin); }
int main() {
  ios::sync_with_stdio(false);
  cin >> N;
  cin >> S;
  cin >> M;
  root = new Trie(-1);
  for (int i = 0; i < M; ++i) {
    cin >> a[i];
    add(a[i], i);
  }
  reverse(S.begin(), S.end());
  S = "#" + S;
  dp[0] = 1;
  Trie *p;
  for (int i = 1, j; i <= N; ++i) {
    p = root;
    j = i;
    dp[i] = 0;
    while (j >= 1 && dp[i] == 0) {
      p = p->link[S[j] - 'a'];
      if (p == NULL) break;
      if (p->ind != -1 && dp[j - 1]) {
        dp[i] = 1;
        pre[i] = j - 1;
        ans[i] = p->ind;
        break;
      }
      --j;
    }
  }
  int i = N;
  while (i > 0) {
    cout << a[ans[i]];
    i = pre[i];
    if (i) cout << " ";
  }
  return 0;
}
