Assume we give the value from 1 to 26 to alphabets a,b,...,z.
Now given an integer ($n$) i like to generate words of specific length ($l$) that sum of them equals $n$. For instance, if$n=10$, $l=3$;
{aah,abg,acf,ade,aed,afc,agb,aha,bag,bbf,bce,bdd,bec,bfb,bga,caf,cbe,ccd,cdc,ceb,cfa,dae,dbd,dcc,ddb,dea,ead,ebc,ecb,eda,fac,fbb,fca,gab,gba,haa}
with more clear representation:
{aah,abg,acf,ade,aed,afc,agb,aha,bag,bbf,bce,bdd,bec,bfb,bga,caf,cbe,ccd,cdc,ceb,cfa,dae,dbd,dcc,ddb,dea,ead,ebc,ecb,eda,fac,fbb,fca,gab,gba,haa}
How can I write this code in Mathematica. Is teere any predefine function to do this job for me?