#include #define MAXN 26 FILE * input = fopen("nthword.in","r"); FILE * output = fopen("nthword.out","w"); int N,K,L, current; char letters[MAXN], word[MAXN]; void build(int depth, int last){ if(N == current) return; if (depth == K){ //printf("%s\n", word); if ( word[0] == word[K-1] ) return; if (++current == N) fprintf(output,"%s\n", word); return; } for (int i=last;i