<?php
$n = (int)fgets(STDIN);
$ans = [];
dfs("", 0, $n);
print implode("\n", $ans);

function dfs($str, $d, $n) {
    global $ans;
    if ($d == $n) {
        $ans[] = $str;
        return;
    }

    for ($i = 0; $i <= $d; $i++) {
        dfs($str . chr(97 + $i), $d + 1, $n);
    }
}