#include using namespace std; using ll = long long; #define rep(i, s, e) for (int i = (int)s; i < (int)e; ++i) #define all(a) (a).begin(), (a).end() int main() { cin.tie(nullptr); int N; string S, T; cin >> N >> S >> T; int Ssiz = S.size(); int Tsiz = T.size(); rep(line, 0, N) { int A; cin >> A; int cnt = A / Ssiz; while ((A - cnt * Ssiz) % Tsiz != 0) cnt--; rep(i, 0, cnt) cout << S << ' '; rep(i, 0, (A - cnt * Ssiz) / Tsiz) cout << T << ' '; cout << '\n'; } }