import java.io.*;
import java.util.*;
 
 
public class  Main{
	static TreeSet<String>all;
	static void solve(char[]in) {
		StringBuilder sb=new StringBuilder();
		for(char x:in) {
			sb.append(x);
		}
		
		if(all.contains(sb.toString()))return;
		all.add(sb.toString());
		
		
		for(int j=0;j<in.length-1;j++) {
			char c=(char)(in[j]+1);
			for(int o=j+1;o<in.length;o++) {
				if(in[o]!=c) {
					char[]tmp=in.clone();
					tmp[o]=c;
					solve(tmp);
				}
			}
			
		}
	}
	public static void main(String[] args) throws Exception{
		MScanner sc=new MScanner(System.in);
		PrintWriter pw=new PrintWriter(System.out);
		char[]in=new char[sc.nextInt()];
		for(int i=0;i<in.length;i++) {
			in[i]='a';
		}
		all=new TreeSet<String>();
		solve(in);
		while(!all.isEmpty()) {
			pw.println(all.pollFirst());
		}
		pw.flush();
	}
	static class MScanner {
		StringTokenizer st;
		BufferedReader br;
		public MScanner(InputStream system) {
			br = new BufferedReader(new InputStreamReader(system));
		}
 
		public MScanner(String file) throws Exception {
			br = new BufferedReader(new FileReader(file));
		}
 
		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}
		public int[] takearr(int n) throws IOException {
	        int[]in=new int[n];for(int i=0;i<n;i++)in[i]=nextInt();
	        return in;
		}
		public long[] takearrl(int n) throws IOException {
	        long[]in=new long[n];for(int i=0;i<n;i++)in[i]=nextLong();
	        return in;
		}
		public Integer[] takearrobj(int n) throws IOException {
	        Integer[]in=new Integer[n];for(int i=0;i<n;i++)in[i]=nextInt();
	        return in;
		}
		public Long[] takearrlobj(int n) throws IOException {
	        Long[]in=new Long[n];for(int i=0;i<n;i++)in[i]=nextLong();
	        return in;
		}
		public String nextLine() throws IOException {
			return br.readLine();
		}
 
		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}
 
		public double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}
 
		public char nextChar() throws IOException {
			return next().charAt(0);
		}
 
		public Long nextLong() throws IOException {
			return Long.parseLong(next());
		}
 
		public boolean ready() throws IOException {
			return br.ready();
		}
 
		public void waitForInput() throws InterruptedException {
			Thread.sleep(3000);
		}
	}
}