#include<bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
ll n, m, s, r, x, y, i, j, ans, t;
cin >> x >> y;
queue < string> v;
for ( i = 0; i < 26; i ++) {
string str = string(1,'a' + i);
v.push(str);
}
r = 0;
while(1) {
string str = v.front();
v.pop();
if (str.size() == 4) break;
for (j =0; j < 26; j ++) {
string str1 = str + char(j + 'a');
v.push(str1);
}
r ++;
}
r = 0;
for (i = 0; i < y; i ++) {
cout << v.front() << " ";
v.pop();
}
cout << "\n";
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |