#include #define rep(i,a,b) for(int i=int(a);i> N; rep(i,0,N-1){ cout << "a" + S + "a" << endl; next_permutation(S.begin(), S.end()); } cout << "an" << endl; }