fn read1<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn dfs(n: usize, v: Vec<u8>) -> String {
    let l = v.len();
    if l == n {
        return v.iter().map(|&i| i as char).collect::<String>() + "\n";
    }

    let mut ans = "".to_string();
    let c = v[l-1];
    for i in 97..c+2 {
        let mut v2 = v.clone();
        v2.push(i);
        ans = ans + &dfs(n, v2);
    }

    return ans;
}

fn main() {
    let n = read1::<usize>();

    println!("{}", dfs(n, vec![97u8]));
}