#include <bits/stdc++.h>
#pragma GCC optimize(2)
using namespace std;
const int mod = 1e9 + 7;
const double eps = 1e-6;
const int N = 1e5 + 7, M = 1e6 + 7;
string s[N], str;
int tr[M][26], id[M], idx;
int n, m, len[N];
bool flag;
int trans(char c) {
  if (c >= 'A' && c <= 'Z') c = c - 'A' + 'a';
  return c;
}
void insert(int first) {
  int p = 0;
  for (int i = len[first] - 1; ~i; i--) {
    int t = trans(s[first][i]) - 'a';
    if (!tr[p][t]) tr[p][t] = ++idx;
    p = tr[p][t];
  }
  id[p] = first;
}
int res[N], cnt;
void dfs(int first) {
  if (flag) return;
  if (first == n) {
    for (int i = 0; i < cnt; i++) cout << s[res[i]] << " ";
    cout << endl;
    flag = true;
    return;
  }
  int p = 0;
  for (int i = first; i <= n - 1; i++) {
    int t = str[i] - 'a';
    if (!tr[p][t]) break;
    p = tr[p][t];
    if (id[p] != -1) {
      res[cnt++] = id[p];
      dfs(first + len[id[p]]);
      cnt--;
    }
  }
}
int main() {
  ios::sync_with_stdio(false);
  memset(id, -1, sizeof(id));
  cin >> n >> str >> m;
  for (int i = 0; i <= m - 1; i++) {
    cin >> s[i];
    len[i] = s[i].size();
    insert(i);
  }
  dfs(0);
  return 0;
}
