Language: C++

int main(){
	int lnth;
	cin>>lnth;
	int cntlnth=0;
	string bas="abcdefghij";
	string st="aaaaaaaaaa";
	
	//while(cntlnth<lnth){
		for(int a=0;a<=0;a++){
			st[cntlnth]=bas[a];
			if(cntlnth==lnth-1)cout<<st.substr(0,lnth)<<endl;
			for(int b=0;cntlnth+1<lnth&&b<=a+1;b++){
				st[cntlnth+1]=bas[b];
				if(cntlnth+1==lnth-1)cout<<st.substr(0,lnth)<<endl;
				for(int c=0;cntlnth+2<lnth&&c<=b+1;c++){
					st[cntlnth+2]=bas[c];
					if(cntlnth+2==lnth-1)cout<<st.substr(0,lnth)<<endl;
					for(int d=0;cntlnth+3<lnth&&d<=max(c,max(a,b))+1;d++){
						st[cntlnth+3]=bas[d];
						if(cntlnth+3==lnth-1)cout<<st.substr(0,lnth)<<endl;
						for(int e=0;cntlnth+4<lnth&&e<=max(d,max(c,max(a,b)))+1;e++){
							st[cntlnth+4]=bas[e];
							if(cntlnth+4==lnth-1)cout<<st.substr(0,lnth)<<endl;
						for(int f=0;cntlnth+5<lnth&&f<=max(e,max(d,max(c,max(a,b))))+1;f++){
							st[cntlnth+5]=bas[f];
							if(cntlnth+5==lnth-1)cout<<st.substr(0,lnth)<<endl;
						for(int g=0;cntlnth+6<lnth&&g<=max(f,max(e,max(d,max(c,max(a,b)))))+1;g++){
							st[cntlnth+6]=bas[e];
							if(cntlnth+6==lnth-1)cout<<st.substr(0,lnth)<<endl;
			      for(int h=0;cntlnth+7<lnth&&h<=max(g,max(f,max(e,max(d,max(c,max(a,b))))))+1;h++){
							st[cntlnth+7]=bas[h];
							if(cntlnth+7==lnth-1)cout<<st.substr(0,lnth)<<endl;
						for(int i=0;cntlnth+8<lnth&&i<=max(h,max(g,max(f,max(e,max(d,max(c,max(a,b)))))))+1;i++){
							st[cntlnth+8]=bas[i];
							if(cntlnth+8==lnth-1)cout<<st.substr(0,lnth)<<endl;
						for(int j=0;cntlnth+9<lnth&&j<=max(i,max(h,max(g,max(f,max(e,max(d,max(c,max(a,b))))))))+1;j++){
							st[cntlnth+9]=bas[e];
							if(cntlnth+9==lnth-1)cout<<st.substr(0,lnth)<<endl;
		
						}
						}	
						}
						}
						}
						}
					}
				}
			}
		}
		//cntlnth++;		
	//}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:9: error: 'cin' was not declared in this scope
    3 |         cin>>lnth;
      |         ^~~
a.cc:5:9: error: 'string' was not declared in this scope
    5 |         string bas="abcdefghij";
      |         ^~~~~~
a.cc:6:15: error: expected ';' before 'st'
    6 |         string st="aaaaaaaaaa";
      |               ^~~
      |               ;
a.cc:10:25: error: 'st' was not declared in this scope; did you mean 'std'?
   10 |                         st[cntlnth]=bas[a];
      |                         ^~
      |                         std
a.cc:10:37: error: 'bas' was not declared in this scope
   10 |                         st[cntlnth]=bas[a];
      |                                     ^~~
a.cc:11:44: error: 'cout' was not declared in this scope
   11 |                         if(cntlnth==lnth-1)cout<<st.substr(0,lnth)<<endl;
      |                                            ^~~~
a.cc:11:69: error: 'endl' was not declared in this scope
   11 |                         if(cntlnth==lnth-1)cout<<st.substr(0,lnth)<<endl;
      |                                                                     ^~~~
a.cc:14:54: error: 'cout' was not declared in this scope
   14 |                                 if(cntlnth+1==lnth-1)cout<<st.substr(0,lnth)<<endl;
      |                                                      ^~~~
a.cc:14:79: error: 'endl' was not declared in this scope
   14 |                                 if(cntlnth+1==lnth-1)cout<<st.substr(0,lnth)<<endl;
      |                                                                               ^~~~
a.cc:17:62: error: 'cout' was not declared in this scope
   17 |                                         if(cntlnth+2==lnth-1)cout<<st.substr(0,lnth)<<endl;
      |                                                              ^~~~
a.cc:17:87: error: 'endl' was not declared in this scope
   17 |                                         if(cntlnth+2==lnth-1)cout<<st.substr(0,lnth)<<endl;
      |                                                                                       ^~~~
a.cc:18:78: error: 'max' was not declared in this scope
   18 |                                         for(int d=0;cntlnth+3<lnth&&d<=max(c,max(a,b))+1;d++){
      |                                                                              ^~~
a.cc:18:72: error: 'max' was not declared in this scope
   18 |                                         for(int d=0;cntlnth+3<lnth&&d<=max(c,max(a,b))+1;d++){
      |                                                                        ^~~
a.cc:20:70: error: 'cout' was not declared in this scope
   20 |                                                 if(cntlnth+3==lnth-1)cout<<st.substr(0,lnth)<<endl;
      |                                                                      ^~~~
a.cc:20:95: error: 'endl' was not declared in this scope
   20 |                                                 if(cntlnth+3==lnth-1)cout<<st.substr(0,lnth)<<endl;
      |                                                                                               ^~~~
a.cc:23:78: error: 'cout' was not declared in this scope
   23 |                                                         if(cntlnth+4==lnth-1)cout<<st.substr(0,lnth)<<endl;
      |                                                                              ^~~~
a.cc:23:103: error: 'endl' was not declared in this scope
   23 |                                                         if(cntlnth+4==lnth-1)cout<<st.substr(0,lnth)<<endl;
      |                                                                                                       ^~~~
a.cc:26:78: error: 'cout' was not declared in this scope
   26 |                                                         if(cntlnth+5==lnth-1)cout<<st.substr(0,lnth)<<endl;
      |                                                                              ^~~~
a.cc:26:103: error: 'endl' was not declared in this scope
   26 |                                                         if(cntlnth+5==lnth-1)cout<<st.substr(0,lnth)<<endl;
      |                                                                                                       ^~~~
a.cc:29:78: error: 'cout' was not declared in this scope
   29 |                                                         if(cntlnth+6==lnth-1)cout<<st.substr(0,lnth)<<endl;
      |                                                                              ^~~~
a.cc:29:103: error: 'endl' was not declared in this scope
   29 |                                                         if(cntlnth+6==lnth-1)cout<<st.substr(0,lnth)<<endl;
      |                                                                                                       ^~~~
a.cc:32:78: error: 'cout' was not declared in this scope
   32 |                                                         if(cntlnth+7==lnth-1)cout<<st.substr(0,lnth)<<endl;
      |                                                                              ^~~~
a.cc:32:103: error: 'endl' was not declared in this scope
   32 |                                                         if(cntlnth+7==lnth-1)cout<<st.substr(0,lnth)<<endl;
      |                                                                                                       ^~~~
a.cc:35:78: error: 'cout' was not declared in this scope
   35 |                                                         if(cntlnth+8==lnth-1)cout<<st.substr(0,lnth)<<endl;
      |                                                                              ^~~~
a.cc:35:103: error: 'endl' was not declared in this scope
   35 |                                                         if(cntlnth+8==lnth-1)cout<<st.substr(0,lnth)<<endl;
      |                                                                                                       ^~~~
a.cc:38:78: error: 'cout' was not declared in this scope
   38 |                                                         if(cntlnth+9==lnth-1)cout<<st.substr(0,lnth)<<endl;
      |                                                                              ^~~~
a.cc:38:103: error: 'endl' was not declared in this scope
   38 |                                                         if(cntlnth+9==lnth-1)cout<<st.substr(0,lnth)<<endl;
      |                                                                                                       ^~~~