use std::io::*;
use std::str::FromStr;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char) 
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn solve(n: usize) {
    fn _solve(n: usize, m: usize, s: String) {
        for i in 0..m {
            let mut s = s.clone();
            let c: char = ('a' as u8 + i as u8) as char;
            s.push(c);
            if n == m {
                println!("{}", s);
            } else {
                _solve(n, m+1, s);
            }
        }

    }
    let s: String = "".to_string();
    _solve(n, 1, s);
}

fn main() {
    let n: usize = read();
    solve(n);
}
